From 189b26cbc844cc55f991a1cb2956294bfcc065a0 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Mon, 19 Apr 2021 15:02:17 +0200 Subject: [PATCH 01/15] Add metadata parsing from kontlinx.metadata --- .../google/protobuf/AbstractMessageLite.java | 356 + .../com/google/protobuf/AbstractParser.java | 253 + .../google/protobuf/BoundedByteString.java | 163 + .../java/com/google/protobuf/ByteString.java | 1022 + .../com/google/protobuf/CodedInputStream.java | 1311 + .../google/protobuf/CodedOutputStream.java | 1297 + .../protobuf/ExtensionRegistryLite.java | 186 + .../java/com/google/protobuf/FieldSet.java | 907 + .../google/protobuf/GeneratedMessageLite.java | 960 + .../java/com/google/protobuf/Internal.java | 391 + .../InvalidProtocolBufferException.java | 122 + .../java/com/google/protobuf/LazyField.java | 154 + .../com/google/protobuf/LazyFieldLite.java | 176 + .../google/protobuf/LazyStringArrayList.java | 367 + .../com/google/protobuf/LazyStringList.java | 163 + .../google/protobuf/LiteralByteString.java | 362 + .../java/com/google/protobuf/MessageLite.java | 320 + .../google/protobuf/MessageLiteOrBuilder.java | 60 + .../main/java/com/google/protobuf/Parser.java | 261 + .../google/protobuf/ProtocolStringList.java | 48 + .../com/google/protobuf/RopeByteString.java | 957 + .../com/google/protobuf/SmallSortedMap.java | 618 + .../UninitializedMessageException.java | 99 + .../protobuf/UnmodifiableLazyStringList.java | 205 + .../main/java/com/google/protobuf/Utf8.java | 349 + .../java/com/google/protobuf/WireFormat.java | 163 + .../java/kotlinx/metadata.impl/readUtils.kt | 58 + .../java/kotlinx/metadata.impl/readers.kt | 510 + .../main/java/kotlinx/metadata/ClassName.kt | 23 + .../src/main/java/kotlinx/metadata/Flag.kt | 520 + .../src/main/java/kotlinx/metadata/Flags.kt | 25 + .../InconsistentKotlinMetadataException.kt | 8 + .../main/java/kotlinx/metadata/annotations.kt | 67 + .../main/java/kotlinx/metadata/extensions.kt | 105 + .../impl/extensions/MetadataExtensions.kt | 51 + .../impl/extensions/extensionNodes.kt | 18 + .../impl/extensions/extensionUtils.kt | 24 + .../metadata/jvm/JvmMemberSignature.kt | 57 + .../kotlinx/metadata/jvm/KotlinClassHeader.kt | 179 + .../metadata/jvm/KotlinClassMetadata.kt | 78 + .../jvm/impl/JvmMetadataExtensions.kt | 119 + .../metadata/jvm/impl/jvmExtensionNodes.kt | 60 + .../metadata/jvm/jvmExtensionVisitors.kt | 405 + .../kotlinx/metadata/jvm/jvmExtensions.kt | 22 + .../src/main/java/kotlinx/metadata/nodes.kt | 1007 + .../main/java/kotlinx/metadata/visitors.kt | 903 + .../kotlin/metadata.serialization/Interner.kt | 29 + .../metadata.serialization/MutableTable.kt | 62 + .../metadata.serialization/StringTable.kt | 15 + .../jetbrains/kotlin/metadata/ProtoBuf.java | 26745 ++++++++++++++++ .../metadata/deserialization/BinaryVersion.kt | 91 + .../metadata/deserialization/Flags.java | 322 + .../metadata/deserialization/NameResolver.kt | 17 + .../metadata/deserialization/ProtoBufUtil.kt | 16 + .../metadata/deserialization/TypeTable.kt | 35 + .../deserialization/VersionRequirement.kt | 118 + .../deserialization/protoTypeTableUtil.kt | 115 + .../kotlin/metadata/jvm/JvmProtoBuf.java | 4183 +++ .../jvm/deserialization/BitEncoding.java | 276 + .../jvm/deserialization/ClassMapperLite.kt | 82 + .../metadata/jvm/deserialization/JvmFlags.kt | 27 + .../jvm/deserialization/JvmMemberSignature.kt | 29 + .../jvm/deserialization/JvmMetadataVersion.kt | 34 + .../jvm/deserialization/JvmNameResolver.kt | 120 + .../jvm/deserialization/JvmProtoBufUtil.kt | 137 + .../jvm/deserialization/utfEncoding.kt | 72 + .../jvm/serialization/JvmStringTable.kt | 101 + .../java/retrofit2/HttpServiceMethod.java | 6 +- .../main/java/retrofit2/KotlinExtensions.kt | 64 + ...etadata.impl.extensions.MetadataExtensions | 1 + .../test/java/retrofit2/KotlinSuspendTest.kt | 52 +- .../ToNullStringResponseConverterFactory.java | 36 + 72 files changed, 48288 insertions(+), 6 deletions(-) create mode 100644 retrofit/src/main/java/com/google/protobuf/AbstractMessageLite.java create mode 100644 retrofit/src/main/java/com/google/protobuf/AbstractParser.java create mode 100644 retrofit/src/main/java/com/google/protobuf/BoundedByteString.java create mode 100644 retrofit/src/main/java/com/google/protobuf/ByteString.java create mode 100644 retrofit/src/main/java/com/google/protobuf/CodedInputStream.java create mode 100644 retrofit/src/main/java/com/google/protobuf/CodedOutputStream.java create mode 100644 retrofit/src/main/java/com/google/protobuf/ExtensionRegistryLite.java create mode 100644 retrofit/src/main/java/com/google/protobuf/FieldSet.java create mode 100644 retrofit/src/main/java/com/google/protobuf/GeneratedMessageLite.java create mode 100644 retrofit/src/main/java/com/google/protobuf/Internal.java create mode 100644 retrofit/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java create mode 100644 retrofit/src/main/java/com/google/protobuf/LazyField.java create mode 100644 retrofit/src/main/java/com/google/protobuf/LazyFieldLite.java create mode 100644 retrofit/src/main/java/com/google/protobuf/LazyStringArrayList.java create mode 100644 retrofit/src/main/java/com/google/protobuf/LazyStringList.java create mode 100644 retrofit/src/main/java/com/google/protobuf/LiteralByteString.java create mode 100644 retrofit/src/main/java/com/google/protobuf/MessageLite.java create mode 100644 retrofit/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java create mode 100644 retrofit/src/main/java/com/google/protobuf/Parser.java create mode 100644 retrofit/src/main/java/com/google/protobuf/ProtocolStringList.java create mode 100644 retrofit/src/main/java/com/google/protobuf/RopeByteString.java create mode 100644 retrofit/src/main/java/com/google/protobuf/SmallSortedMap.java create mode 100644 retrofit/src/main/java/com/google/protobuf/UninitializedMessageException.java create mode 100644 retrofit/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java create mode 100644 retrofit/src/main/java/com/google/protobuf/Utf8.java create mode 100644 retrofit/src/main/java/com/google/protobuf/WireFormat.java create mode 100644 retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata.impl/readers.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/ClassName.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/Flag.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/Flags.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/InconsistentKotlinMetadataException.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/annotations.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/extensions.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionUtils.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassMetadata.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensions.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/nodes.kt create mode 100644 retrofit/src/main/java/kotlinx/metadata/visitors.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/Interner.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/MutableTable.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/StringTable.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/NameResolver.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/TypeTable.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmFlags.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt create mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/serialization/JvmStringTable.kt create mode 100644 retrofit/src/main/resources/META-INF/services/kotlinx.metadata.impl.extensions.MetadataExtensions create mode 100644 retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java diff --git a/retrofit/src/main/java/com/google/protobuf/AbstractMessageLite.java b/retrofit/src/main/java/com/google/protobuf/AbstractMessageLite.java new file mode 100644 index 0000000000..d2df96a04f --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/AbstractMessageLite.java @@ -0,0 +1,356 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.FilterInputStream; +import java.io.InputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Collection; + +/** + * A partial implementation of the {@link MessageLite} interface which + * implements as many methods of that interface as possible in terms of other + * methods. + * + * @author kenton@google.com Kenton Varda + */ +public abstract class AbstractMessageLite implements MessageLite { + protected int memoizedHashCode = 0; + + @Override + public ByteString toByteString() { + try { + final ByteString.CodedBuilder out = + ByteString.newCodedBuilder(getSerializedSize()); + writeTo(out.getCodedOutput()); + return out.build(); + } catch (IOException e) { + throw new RuntimeException( + "Serializing to a ByteString threw an IOException (should " + + "never happen).", e); + } + } + + @Override public byte[] toByteArray() { + try { + final byte[] result = new byte[getSerializedSize()]; + final CodedOutputStream output = CodedOutputStream.newInstance(result); + writeTo(output); + output.checkNoSpaceLeft(); + return result; + } catch (IOException e) { + throw new RuntimeException( + "Serializing to a byte array threw an IOException " + + "(should never happen).", e); + } + } + + @Override public void writeTo(final OutputStream output) throws IOException { + final int bufferSize = + CodedOutputStream.computePreferredBufferSize(getSerializedSize()); + final CodedOutputStream codedOutput = + CodedOutputStream.newInstance(output, bufferSize); + writeTo(codedOutput); + codedOutput.flush(); + } + + @Override public void writeDelimitedTo(final OutputStream output) throws IOException { + final int serialized = getSerializedSize(); + final int bufferSize = CodedOutputStream.computePreferredBufferSize( + CodedOutputStream.computeRawVarint32Size(serialized) + serialized); + final CodedOutputStream codedOutput = + CodedOutputStream.newInstance(output, bufferSize); + codedOutput.writeRawVarint32(serialized); + writeTo(codedOutput); + codedOutput.flush(); + } + + + /** + * Package private helper method for AbstractParser to create + * UninitializedMessageException. + */ + UninitializedMessageException newUninitializedMessageException() { + return new UninitializedMessageException(this); + } + + protected static void checkByteStringIsUtf8(ByteString byteString) + throws IllegalArgumentException { + if (!byteString.isValidUtf8()) { + throw new IllegalArgumentException("Byte string is not UTF-8."); + } + } + + /** + * A partial implementation of the {@link Message.Builder} interface which + * implements as many methods of that interface as possible in terms of + * other methods. + */ + @SuppressWarnings("unchecked") + public static abstract class Builder + implements MessageLite.Builder { + // The compiler produces an error if this is not declared explicitly. + @Override + public abstract BuilderType clone(); + + @Override public BuilderType mergeFrom(final CodedInputStream input) + throws IOException { + return mergeFrom(input, ExtensionRegistryLite.getEmptyRegistry()); + } + + // Re-defined here for return type covariance. + @Override public abstract BuilderType mergeFrom( + final CodedInputStream input, + final ExtensionRegistryLite extensionRegistry) + throws IOException; + + @Override public BuilderType mergeFrom(final ByteString data) + throws InvalidProtocolBufferException { + try { + final CodedInputStream input = data.newCodedInput(); + mergeFrom(input); + input.checkLastTagWas(0); + return (BuilderType) this; + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "Reading from a ByteString threw an IOException (should " + + "never happen).", e); + } + } + + @Override public BuilderType mergeFrom( + final ByteString data, + final ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + try { + final CodedInputStream input = data.newCodedInput(); + mergeFrom(input, extensionRegistry); + input.checkLastTagWas(0); + return (BuilderType) this; + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "Reading from a ByteString threw an IOException (should " + + "never happen).", e); + } + } + + @Override public BuilderType mergeFrom(final byte[] data) + throws InvalidProtocolBufferException { + return mergeFrom(data, 0, data.length); + } + + @Override public BuilderType mergeFrom(final byte[] data, final int off, + final int len) + throws InvalidProtocolBufferException { + try { + final CodedInputStream input = + CodedInputStream.newInstance(data, off, len); + mergeFrom(input); + input.checkLastTagWas(0); + return (BuilderType) this; + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "Reading from a byte array threw an IOException (should " + + "never happen).", e); + } + } + + @Override public BuilderType mergeFrom( + final byte[] data, + final ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return mergeFrom(data, 0, data.length, extensionRegistry); + } + + @Override public BuilderType mergeFrom( + final byte[] data, final int off, final int len, + final ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + try { + final CodedInputStream input = + CodedInputStream.newInstance(data, off, len); + mergeFrom(input, extensionRegistry); + input.checkLastTagWas(0); + return (BuilderType) this; + } catch (InvalidProtocolBufferException e) { + throw e; + } catch (IOException e) { + throw new RuntimeException( + "Reading from a byte array threw an IOException (should " + + "never happen).", e); + } + } + + @Override public BuilderType mergeFrom(final InputStream input) throws IOException { + final CodedInputStream codedInput = CodedInputStream.newInstance(input); + mergeFrom(codedInput); + codedInput.checkLastTagWas(0); + return (BuilderType) this; + } + + @Override public BuilderType mergeFrom( + final InputStream input, + final ExtensionRegistryLite extensionRegistry) + throws IOException { + final CodedInputStream codedInput = CodedInputStream.newInstance(input); + mergeFrom(codedInput, extensionRegistry); + codedInput.checkLastTagWas(0); + return (BuilderType) this; + } + + /** + * An InputStream implementations which reads from some other InputStream + * but is limited to a particular number of bytes. Used by + * mergeDelimitedFrom(). This is intentionally package-private so that + * UnknownFieldSet can share it. + */ + static final class LimitedInputStream extends FilterInputStream { + private int limit; + + LimitedInputStream(InputStream in, int limit) { + super(in); + this.limit = limit; + } + + @Override + public int available() throws IOException { + return Math.min(super.available(), limit); + } + + @Override + public int read() throws IOException { + if (limit <= 0) { + return -1; + } + final int result = super.read(); + if (result >= 0) { + --limit; + } + return result; + } + + @Override + public int read(final byte[] b, final int off, int len) + throws IOException { + if (limit <= 0) { + return -1; + } + len = Math.min(len, limit); + final int result = super.read(b, off, len); + if (result >= 0) { + limit -= result; + } + return result; + } + + @Override + public long skip(final long n) throws IOException { + final long result = super.skip(Math.min(n, limit)); + if (result >= 0) { + limit -= result; + } + return result; + } + } + + @Override public boolean mergeDelimitedFrom( + final InputStream input, + final ExtensionRegistryLite extensionRegistry) + throws IOException { + final int firstByte = input.read(); + if (firstByte == -1) { + return false; + } + final int size = CodedInputStream.readRawVarint32(firstByte, input); + final InputStream limitedInput = new LimitedInputStream(input, size); + mergeFrom(limitedInput, extensionRegistry); + return true; + } + + @Override public boolean mergeDelimitedFrom(final InputStream input) + throws IOException { + return mergeDelimitedFrom(input, + ExtensionRegistryLite.getEmptyRegistry()); + } + + /** + * Construct an UninitializedMessageException reporting missing fields in + * the given message. + */ + protected static UninitializedMessageException + newUninitializedMessageException(MessageLite message) { + return new UninitializedMessageException(message); + } + + /** + * Adds the {@code values} to the {@code list}. This is a helper method + * used by generated code. Users should ignore it. + * + * @throws NullPointerException if any of the elements of {@code values} is + * null. When that happens, some elements of {@code values} may have already + * been added to the result {@code list}. + */ + protected static void addAll(final Iterable values, + final Collection list) { + if (values instanceof LazyStringList) { + // For StringOrByteStringLists, check the underlying elements to avoid + // forcing conversions of ByteStrings to Strings. + checkForNullValues(((LazyStringList) values).getUnderlyingElements()); + list.addAll((Collection) values); + } else if (values instanceof Collection) { + checkForNullValues(values); + list.addAll((Collection) values); + } else { + for (final T value : values) { + if (value == null) { + throw new NullPointerException(); + } + list.add(value); + } + } + } + + private static void checkForNullValues(final Iterable values) { + for (final Object value : values) { + if (value == null) { + throw new NullPointerException(); + } + } + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/AbstractParser.java b/retrofit/src/main/java/com/google/protobuf/AbstractParser.java new file mode 100644 index 0000000000..1a4c63110a --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/AbstractParser.java @@ -0,0 +1,253 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; + +import java.io.IOException; +import java.io.InputStream; + +/** + * A partial implementation of the {@link Parser} interface which implements + * as many methods of that interface as possible in terms of other methods. + * + * Note: This class implements all the convenience methods in the + * {@link Parser} interface. See {@link Parser} for related javadocs. + * Subclasses need to implement + * {@link Parser#parsePartialFrom(CodedInputStream, ExtensionRegistryLite)} + * + * @author liujisi@google.com (Pherl Liu) + */ +public abstract class AbstractParser + implements Parser { + /** + * Creates an UninitializedMessageException for MessageType. + */ + private UninitializedMessageException + newUninitializedMessageException(MessageType message) { + if (message instanceof AbstractMessageLite) { + return ((AbstractMessageLite) message).newUninitializedMessageException(); + } + return new UninitializedMessageException(message); + } + + /** + * Helper method to check if message is initialized. + * + * @throws InvalidProtocolBufferException if it is not initialized. + * @return The message to check. + */ + private MessageType checkMessageInitialized(MessageType message) + throws InvalidProtocolBufferException { + if (message != null && !message.isInitialized()) { + throw newUninitializedMessageException(message) + .asInvalidProtocolBufferException() + .setUnfinishedMessage(message); + } + return message; + } + + private static final ExtensionRegistryLite EMPTY_REGISTRY + = ExtensionRegistryLite.getEmptyRegistry(); + + public MessageType parsePartialFrom(CodedInputStream input) + throws InvalidProtocolBufferException { + return parsePartialFrom(input, EMPTY_REGISTRY); + } + + public MessageType parseFrom(CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return checkMessageInitialized( + parsePartialFrom(input, extensionRegistry)); + } + + public MessageType parseFrom(CodedInputStream input) + throws InvalidProtocolBufferException { + return parseFrom(input, EMPTY_REGISTRY); + } + + public MessageType parsePartialFrom(ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + MessageType message; + try { + CodedInputStream input = data.newCodedInput(); + message = parsePartialFrom(input, extensionRegistry); + try { + input.checkLastTagWas(0); + } catch (InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(message); + } + return message; + } catch (InvalidProtocolBufferException e) { + throw e; + } + } + + public MessageType parsePartialFrom(ByteString data) + throws InvalidProtocolBufferException { + return parsePartialFrom(data, EMPTY_REGISTRY); + } + + public MessageType parseFrom(ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return checkMessageInitialized(parsePartialFrom(data, extensionRegistry)); + } + + public MessageType parseFrom(ByteString data) + throws InvalidProtocolBufferException { + return parseFrom(data, EMPTY_REGISTRY); + } + + public MessageType parsePartialFrom(byte[] data, int off, int len, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + try { + CodedInputStream input = CodedInputStream.newInstance(data, off, len); + MessageType message = parsePartialFrom(input, extensionRegistry); + try { + input.checkLastTagWas(0); + } catch (InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(message); + } + return message; + } catch (InvalidProtocolBufferException e) { + throw e; + } + } + + public MessageType parsePartialFrom(byte[] data, int off, int len) + throws InvalidProtocolBufferException { + return parsePartialFrom(data, off, len, EMPTY_REGISTRY); + } + + public MessageType parsePartialFrom(byte[] data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return parsePartialFrom(data, 0, data.length, extensionRegistry); + } + + public MessageType parsePartialFrom(byte[] data) + throws InvalidProtocolBufferException { + return parsePartialFrom(data, 0, data.length, EMPTY_REGISTRY); + } + + public MessageType parseFrom(byte[] data, int off, int len, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return checkMessageInitialized( + parsePartialFrom(data, off, len, extensionRegistry)); + } + + public MessageType parseFrom(byte[] data, int off, int len) + throws InvalidProtocolBufferException { + return parseFrom(data, off, len, EMPTY_REGISTRY); + } + + public MessageType parseFrom(byte[] data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return parseFrom(data, 0, data.length, extensionRegistry); + } + + public MessageType parseFrom(byte[] data) + throws InvalidProtocolBufferException { + return parseFrom(data, EMPTY_REGISTRY); + } + + public MessageType parsePartialFrom(InputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + CodedInputStream codedInput = CodedInputStream.newInstance(input); + MessageType message = parsePartialFrom(codedInput, extensionRegistry); + try { + codedInput.checkLastTagWas(0); + } catch (InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(message); + } + return message; + } + + public MessageType parsePartialFrom(InputStream input) + throws InvalidProtocolBufferException { + return parsePartialFrom(input, EMPTY_REGISTRY); + } + + public MessageType parseFrom(InputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return checkMessageInitialized( + parsePartialFrom(input, extensionRegistry)); + } + + public MessageType parseFrom(InputStream input) + throws InvalidProtocolBufferException { + return parseFrom(input, EMPTY_REGISTRY); + } + + public MessageType parsePartialDelimitedFrom( + InputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + int size; + try { + int firstByte = input.read(); + if (firstByte == -1) { + return null; + } + size = CodedInputStream.readRawVarint32(firstByte, input); + } catch (IOException e) { + throw new InvalidProtocolBufferException(e.getMessage()); + } + InputStream limitedInput = new LimitedInputStream(input, size); + return parsePartialFrom(limitedInput, extensionRegistry); + } + + public MessageType parsePartialDelimitedFrom(InputStream input) + throws InvalidProtocolBufferException { + return parsePartialDelimitedFrom(input, EMPTY_REGISTRY); + } + + public MessageType parseDelimitedFrom( + InputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { + return checkMessageInitialized( + parsePartialDelimitedFrom(input, extensionRegistry)); + } + + public MessageType parseDelimitedFrom(InputStream input) + throws InvalidProtocolBufferException { + return parseDelimitedFrom(input, EMPTY_REGISTRY); + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/BoundedByteString.java b/retrofit/src/main/java/com/google/protobuf/BoundedByteString.java new file mode 100644 index 0000000000..2828e9c74b --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/BoundedByteString.java @@ -0,0 +1,163 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.NoSuchElementException; + +/** + * This class is used to represent the substring of a {@link ByteString} over a + * single byte array. In terms of the public API of {@link ByteString}, you end + * up here by calling {@link ByteString#copyFrom(byte[])} followed by {@link + * ByteString#substring(int, int)}. + * + *

This class contains most of the overhead involved in creating a substring + * from a {@link LiteralByteString}. The overhead involves some range-checking + * and two extra fields. + * + * @author carlanton@google.com (Carl Haverl) + */ +class BoundedByteString extends LiteralByteString { + + private final int bytesOffset; + private final int bytesLength; + + /** + * Creates a {@code BoundedByteString} backed by the sub-range of given array, + * without copying. + * + * @param bytes array to wrap + * @param offset index to first byte to use in bytes + * @param length number of bytes to use from bytes + * @throws IllegalArgumentException if {@code offset < 0}, {@code length < 0}, + * or if {@code offset + length > + * bytes.length}. + */ + BoundedByteString(byte[] bytes, int offset, int length) { + super(bytes); + if (offset < 0) { + throw new IllegalArgumentException("Offset too small: " + offset); + } + if (length < 0) { + throw new IllegalArgumentException("Length too small: " + offset); + } + if ((long) offset + length > bytes.length) { + throw new IllegalArgumentException( + "Offset+Length too large: " + offset + "+" + length); + } + + this.bytesOffset = offset; + this.bytesLength = length; + } + + /** + * Gets the byte at the given index. + * Throws {@link ArrayIndexOutOfBoundsException} + * for backwards-compatibility reasons although it would more properly be + * {@link IndexOutOfBoundsException}. + * + * @param index index of byte + * @return the value + * @throws ArrayIndexOutOfBoundsException {@code index} is < 0 or >= size + */ + @Override + public byte byteAt(int index) { + // We must check the index ourselves as we cannot rely on Java array index + // checking for substrings. + if (index < 0) { + throw new ArrayIndexOutOfBoundsException("Index too small: " + index); + } + if (index >= size()) { + throw new ArrayIndexOutOfBoundsException( + "Index too large: " + index + ", " + size()); + } + + return bytes[bytesOffset + index]; + } + + @Override + public int size() { + return bytesLength; + } + + @Override + protected int getOffsetIntoBytes() { + return bytesOffset; + } + + // ================================================================= + // ByteString -> byte[] + + @Override + protected void copyToInternal(byte[] target, int sourceOffset, + int targetOffset, int numberToCopy) { + System.arraycopy(bytes, getOffsetIntoBytes() + sourceOffset, target, + targetOffset, numberToCopy); + } + + // ================================================================= + // ByteIterator + + @Override + public ByteIterator iterator() { + return new BoundedByteIterator(); + } + + private class BoundedByteIterator implements ByteIterator { + + private int position; + private final int limit; + + private BoundedByteIterator() { + position = getOffsetIntoBytes(); + limit = position + size(); + } + + public boolean hasNext() { + return (position < limit); + } + + public Byte next() { + // Boxing calls Byte.valueOf(byte), which does not instantiate. + return nextByte(); + } + + public byte nextByte() { + if (position >= limit) { + throw new NoSuchElementException(); + } + return bytes[position++]; + } + + public void remove() { + throw new UnsupportedOperationException(); + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/ByteString.java b/retrofit/src/main/java/com/google/protobuf/ByteString.java new file mode 100644 index 0000000000..7da56127d7 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/ByteString.java @@ -0,0 +1,1022 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * Immutable sequence of bytes. Substring is supported by sharing the reference + * to the immutable underlying bytes, as with {@link String}. Concatenation is + * likewise supported without copying (long strings) by building a tree of + * pieces in {@link RopeByteString}. + *

+ * Like {@link String}, the contents of a {@link ByteString} can never be + * observed to change, not even in the presence of a data race or incorrect + * API usage in the client code. + * + * @author crazybob@google.com Bob Lee + * @author kenton@google.com Kenton Varda + * @author carlanton@google.com Carl Haverl + * @author martinrb@google.com Martin Buchholz + */ +public abstract class ByteString implements Iterable { + + /** + * When two strings to be concatenated have a combined length shorter than + * this, we just copy their bytes on {@link #concat(ByteString)}. + * The trade-off is copy size versus the overhead of creating tree nodes + * in {@link RopeByteString}. + */ + static final int CONCATENATE_BY_COPY_SIZE = 128; + + /** + * When copying an InputStream into a ByteString with .readFrom(), + * the chunks in the underlying rope start at 256 bytes, but double + * each iteration up to 8192 bytes. + */ + static final int MIN_READ_FROM_CHUNK_SIZE = 0x100; // 256b + static final int MAX_READ_FROM_CHUNK_SIZE = 0x2000; // 8k + + /** + * Empty {@code ByteString}. + */ + public static final ByteString EMPTY = new LiteralByteString(new byte[0]); + + // This constructor is here to prevent subclassing outside of this package, + ByteString() {} + + /** + * Gets the byte at the given index. This method should be used only for + * random access to individual bytes. To access bytes sequentially, use the + * {@link ByteIterator} returned by {@link #iterator()}, and call {@link + * #substring(int, int)} first if necessary. + * + * @param index index of byte + * @return the value + * @throws ArrayIndexOutOfBoundsException {@code index} is < 0 or >= size + */ + public abstract byte byteAt(int index); + + /** + * Return a {@link ByteString.ByteIterator} over the bytes in the ByteString. + * To avoid auto-boxing, you may get the iterator manually and call + * {@link ByteIterator#nextByte()}. + * + * @return the iterator + */ + public abstract ByteIterator iterator(); + + /** + * This interface extends {@code Iterator}, so that we can return an + * unboxed {@code byte}. + */ + public interface ByteIterator extends Iterator { + /** + * An alternative to {@link Iterator#next()} that returns an + * unboxed primitive {@code byte}. + * + * @return the next {@code byte} in the iteration + * @throws NoSuchElementException if the iteration has no more elements + */ + byte nextByte(); + } + + /** + * Gets the number of bytes. + * + * @return size in bytes + */ + public abstract int size(); + + /** + * Returns {@code true} if the size is {@code 0}, {@code false} otherwise. + * + * @return true if this is zero bytes long + */ + public boolean isEmpty() { + return size() == 0; + } + + // ================================================================= + // ByteString -> substring + + /** + * Return the substring from {@code beginIndex}, inclusive, to the end of the + * string. + * + * @param beginIndex start at this index + * @return substring sharing underlying data + * @throws IndexOutOfBoundsException if {@code beginIndex < 0} or + * {@code beginIndex > size()}. + */ + public ByteString substring(int beginIndex) { + return substring(beginIndex, size()); + } + + /** + * Return the substring from {@code beginIndex}, inclusive, to {@code + * endIndex}, exclusive. + * + * @param beginIndex start at this index + * @param endIndex the last character is the one before this index + * @return substring sharing underlying data + * @throws IndexOutOfBoundsException if {@code beginIndex < 0}, + * {@code endIndex > size()}, or {@code beginIndex > endIndex}. + */ + public abstract ByteString substring(int beginIndex, int endIndex); + + /** + * Tests if this bytestring starts with the specified prefix. + * Similar to {@link String#startsWith(String)} + * + * @param prefix the prefix. + * @return true if the byte sequence represented by the + * argument is a prefix of the byte sequence represented by + * this string; false otherwise. + */ + public boolean startsWith(ByteString prefix) { + return size() >= prefix.size() && + substring(0, prefix.size()).equals(prefix); + } + + /** + * Tests if this bytestring ends with the specified suffix. + * Similar to {@link String#endsWith(String)} + * + * @param suffix the suffix. + * @return true if the byte sequence represented by the + * argument is a suffix of the byte sequence represented by + * this string; false otherwise. + */ + public boolean endsWith(ByteString suffix) { + return size() >= suffix.size() && + substring(size() - suffix.size()).equals(suffix); + } + + // ================================================================= + // byte[] -> ByteString + + /** + * Copies the given bytes into a {@code ByteString}. + * + * @param bytes source array + * @param offset offset in source array + * @param size number of bytes to copy + * @return new {@code ByteString} + */ + public static ByteString copyFrom(byte[] bytes, int offset, int size) { + byte[] copy = new byte[size]; + System.arraycopy(bytes, offset, copy, 0, size); + return new LiteralByteString(copy); + } + + /** + * Copies the given bytes into a {@code ByteString}. + * + * @param bytes to copy + * @return new {@code ByteString} + */ + public static ByteString copyFrom(byte[] bytes) { + return copyFrom(bytes, 0, bytes.length); + } + + /** + * Copies the next {@code size} bytes from a {@code java.nio.ByteBuffer} into + * a {@code ByteString}. + * + * @param bytes source buffer + * @param size number of bytes to copy + * @return new {@code ByteString} + */ + public static ByteString copyFrom(ByteBuffer bytes, int size) { + byte[] copy = new byte[size]; + bytes.get(copy); + return new LiteralByteString(copy); + } + + /** + * Copies the remaining bytes from a {@code java.nio.ByteBuffer} into + * a {@code ByteString}. + * + * @param bytes sourceBuffer + * @return new {@code ByteString} + */ + public static ByteString copyFrom(ByteBuffer bytes) { + return copyFrom(bytes, bytes.remaining()); + } + + /** + * Encodes {@code text} into a sequence of bytes using the named charset + * and returns the result as a {@code ByteString}. + * + * @param text source string + * @param charsetName encoding to use + * @return new {@code ByteString} + * @throws UnsupportedEncodingException if the encoding isn't found + */ + public static ByteString copyFrom(String text, String charsetName) + throws UnsupportedEncodingException { + return new LiteralByteString(text.getBytes(charsetName)); + } + + /** + * Encodes {@code text} into a sequence of UTF-8 bytes and returns the + * result as a {@code ByteString}. + * + * @param text source string + * @return new {@code ByteString} + */ + public static ByteString copyFromUtf8(String text) { + try { + return new LiteralByteString(text.getBytes("UTF-8")); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF-8 not supported?", e); + } + } + + // ================================================================= + // InputStream -> ByteString + + /** + * Completely reads the given stream's bytes into a + * {@code ByteString}, blocking if necessary until all bytes are + * read through to the end of the stream. + * + * Performance notes: The returned {@code ByteString} is an + * immutable tree of byte arrays ("chunks") of the stream data. The + * first chunk is small, with subsequent chunks each being double + * the size, up to 8K. If the caller knows the precise length of + * the stream and wishes to avoid all unnecessary copies and + * allocations, consider using the two-argument version of this + * method, below. + * + * @param streamToDrain The source stream, which is read completely + * but not closed. + * @return A new {@code ByteString} which is made up of chunks of + * various sizes, depending on the behavior of the underlying + * stream. + * @throws IOException IOException is thrown if there is a problem + * reading the underlying stream. + */ + public static ByteString readFrom(InputStream streamToDrain) + throws IOException { + return readFrom( + streamToDrain, MIN_READ_FROM_CHUNK_SIZE, MAX_READ_FROM_CHUNK_SIZE); + } + + /** + * Completely reads the given stream's bytes into a + * {@code ByteString}, blocking if necessary until all bytes are + * read through to the end of the stream. + * + * Performance notes: The returned {@code ByteString} is an + * immutable tree of byte arrays ("chunks") of the stream data. The + * chunkSize parameter sets the size of these byte arrays. In + * particular, if the chunkSize is precisely the same as the length + * of the stream, unnecessary allocations and copies will be + * avoided. Otherwise, the chunks will be of the given size, except + * for the last chunk, which will be resized (via a reallocation and + * copy) to contain the remainder of the stream. + * + * @param streamToDrain The source stream, which is read completely + * but not closed. + * @param chunkSize The size of the chunks in which to read the + * stream. + * @return A new {@code ByteString} which is made up of chunks of + * the given size. + * @throws IOException IOException is thrown if there is a problem + * reading the underlying stream. + */ + public static ByteString readFrom(InputStream streamToDrain, int chunkSize) + throws IOException { + return readFrom(streamToDrain, chunkSize, chunkSize); + } + + // Helper method that takes the chunk size range as a parameter. + public static ByteString readFrom(InputStream streamToDrain, int minChunkSize, + int maxChunkSize) throws IOException { + Collection results = new ArrayList(); + + // copy the inbound bytes into a list of chunks; the chunk size + // grows exponentially to support both short and long streams. + int chunkSize = minChunkSize; + while (true) { + ByteString chunk = readChunk(streamToDrain, chunkSize); + if (chunk == null) { + break; + } + results.add(chunk); + chunkSize = Math.min(chunkSize * 2, maxChunkSize); + } + + return ByteString.copyFrom(results); + } + + /** + * Blocks until a chunk of the given size can be made from the + * stream, or EOF is reached. Calls read() repeatedly in case the + * given stream implementation doesn't completely fill the given + * buffer in one read() call. + * + * @return A chunk of the desired size, or else a chunk as large as + * was available when end of stream was reached. Returns null if the + * given stream had no more data in it. + */ + private static ByteString readChunk(InputStream in, final int chunkSize) + throws IOException { + final byte[] buf = new byte[chunkSize]; + int bytesRead = 0; + while (bytesRead < chunkSize) { + final int count = in.read(buf, bytesRead, chunkSize - bytesRead); + if (count == -1) { + break; + } + bytesRead += count; + } + + if (bytesRead == 0) { + return null; + } else { + return ByteString.copyFrom(buf, 0, bytesRead); + } + } + + // ================================================================= + // Multiple ByteStrings -> One ByteString + + /** + * Concatenate the given {@code ByteString} to this one. Short concatenations, + * of total size smaller than {@link ByteString#CONCATENATE_BY_COPY_SIZE}, are + * produced by copying the underlying bytes (as per Rope.java, + * BAP95 . In general, the concatenate involves no copying. + * + * @param other string to concatenate + * @return a new {@code ByteString} instance + */ + public ByteString concat(ByteString other) { + int thisSize = size(); + int otherSize = other.size(); + if ((long) thisSize + otherSize >= Integer.MAX_VALUE) { + throw new IllegalArgumentException("ByteString would be too long: " + + thisSize + "+" + otherSize); + } + + return RopeByteString.concatenate(this, other); + } + + /** + * Concatenates all byte strings in the iterable and returns the result. + * This is designed to run in O(list size), not O(total bytes). + * + *

The returned {@code ByteString} is not necessarily a unique object. + * If the list is empty, the returned object is the singleton empty + * {@code ByteString}. If the list has only one element, that + * {@code ByteString} will be returned without copying. + * + * @param byteStrings strings to be concatenated + * @return new {@code ByteString} + */ + public static ByteString copyFrom(Iterable byteStrings) { + Collection collection; + if (!(byteStrings instanceof Collection)) { + collection = new ArrayList(); + for (ByteString byteString : byteStrings) { + collection.add(byteString); + } + } else { + collection = (Collection) byteStrings; + } + ByteString result; + if (collection.isEmpty()) { + result = EMPTY; + } else { + result = balancedConcat(collection.iterator(), collection.size()); + } + return result; + } + + // Internal function used by copyFrom(Iterable). + // Create a balanced concatenation of the next "length" elements from the + // iterable. + private static ByteString balancedConcat(Iterator iterator, + int length) { + assert length >= 1; + ByteString result; + if (length == 1) { + result = iterator.next(); + } else { + int halfLength = length >>> 1; + ByteString left = balancedConcat(iterator, halfLength); + ByteString right = balancedConcat(iterator, length - halfLength); + result = left.concat(right); + } + return result; + } + + // ================================================================= + // ByteString -> byte[] + + /** + * Copies bytes into a buffer at the given offset. + * + * @param target buffer to copy into + * @param offset in the target buffer + * @throws IndexOutOfBoundsException if the offset is negative or too large + */ + public void copyTo(byte[] target, int offset) { + copyTo(target, 0, offset, size()); + } + + /** + * Copies bytes into a buffer. + * + * @param target buffer to copy into + * @param sourceOffset offset within these bytes + * @param targetOffset offset within the target buffer + * @param numberToCopy number of bytes to copy + * @throws IndexOutOfBoundsException if an offset or size is negative or too + * large + */ + public void copyTo(byte[] target, int sourceOffset, int targetOffset, + int numberToCopy) { + if (sourceOffset < 0) { + throw new IndexOutOfBoundsException("Source offset < 0: " + sourceOffset); + } + if (targetOffset < 0) { + throw new IndexOutOfBoundsException("Target offset < 0: " + targetOffset); + } + if (numberToCopy < 0) { + throw new IndexOutOfBoundsException("Length < 0: " + numberToCopy); + } + if (sourceOffset + numberToCopy > size()) { + throw new IndexOutOfBoundsException( + "Source end offset < 0: " + (sourceOffset + numberToCopy)); + } + if (targetOffset + numberToCopy > target.length) { + throw new IndexOutOfBoundsException( + "Target end offset < 0: " + (targetOffset + numberToCopy)); + } + if (numberToCopy > 0) { + copyToInternal(target, sourceOffset, targetOffset, numberToCopy); + } + } + + /** + * Internal (package private) implementation of + * @link{#copyTo(byte[],int,int,int}. + * It assumes that all error checking has already been performed and that + * @code{numberToCopy > 0}. + */ + protected abstract void copyToInternal(byte[] target, int sourceOffset, + int targetOffset, int numberToCopy); + + /** + * Copies bytes into a ByteBuffer. + * + * @param target ByteBuffer to copy into. + * @throws java.nio.ReadOnlyBufferException if the {@code target} is read-only + * @throws java.nio.BufferOverflowException if the {@code target}'s + * remaining() space is not large enough to hold the data. + */ + public abstract void copyTo(ByteBuffer target); + + /** + * Copies bytes to a {@code byte[]}. + * + * @return copied bytes + */ + public byte[] toByteArray() { + int size = size(); + if (size == 0) { + return Internal.EMPTY_BYTE_ARRAY; + } + byte[] result = new byte[size]; + copyToInternal(result, 0, 0, size); + return result; + } + + /** + * Writes the complete contents of this byte string to + * the specified output stream argument. + * + * @param out the output stream to which to write the data. + * @throws IOException if an I/O error occurs. + */ + public abstract void writeTo(OutputStream out) throws IOException; + + /** + * Writes a specified part of this byte string to an output stream. + * + * @param out the output stream to which to write the data. + * @param sourceOffset offset within these bytes + * @param numberToWrite number of bytes to write + * @throws IOException if an I/O error occurs. + * @throws IndexOutOfBoundsException if an offset or size is negative or too + * large + */ + void writeTo(OutputStream out, int sourceOffset, int numberToWrite) + throws IOException { + if (sourceOffset < 0) { + throw new IndexOutOfBoundsException("Source offset < 0: " + sourceOffset); + } + if (numberToWrite < 0) { + throw new IndexOutOfBoundsException("Length < 0: " + numberToWrite); + } + if (sourceOffset + numberToWrite > size()) { + throw new IndexOutOfBoundsException( + "Source end offset exceeded: " + (sourceOffset + numberToWrite)); + } + if (numberToWrite > 0) { + writeToInternal(out, sourceOffset, numberToWrite); + } + + } + + /** + * Internal version of {@link #writeTo(OutputStream,int,int)} that assumes + * all error checking has already been done. + */ + abstract void writeToInternal(OutputStream out, int sourceOffset, + int numberToWrite) throws IOException; + + /** + * Constructs a read-only {@code java.nio.ByteBuffer} whose content + * is equal to the contents of this byte string. + * The result uses the same backing array as the byte string, if possible. + * + * @return wrapped bytes + */ + public abstract ByteBuffer asReadOnlyByteBuffer(); + + /** + * Constructs a list of read-only {@code java.nio.ByteBuffer} objects + * such that the concatenation of their contents is equal to the contents + * of this byte string. The result uses the same backing arrays as the + * byte string. + *

+ * By returning a list, implementations of this method may be able to avoid + * copying even when there are multiple backing arrays. + * + * @return a list of wrapped bytes + */ + public abstract List asReadOnlyByteBufferList(); + + /** + * Constructs a new {@code String} by decoding the bytes using the + * specified charset. + * + * @param charsetName encode using this charset + * @return new string + * @throws UnsupportedEncodingException if charset isn't recognized + */ + public abstract String toString(String charsetName) + throws UnsupportedEncodingException; + + // ================================================================= + // UTF-8 decoding + + /** + * Constructs a new {@code String} by decoding the bytes as UTF-8. + * + * @return new string using UTF-8 encoding + */ + public String toStringUtf8() { + try { + return toString("UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF-8 not supported?", e); + } + } + + /** + * Tells whether this {@code ByteString} represents a well-formed UTF-8 + * byte sequence, such that the original bytes can be converted to a + * String object and then round tripped back to bytes without loss. + * + *

More precisely, returns {@code true} whenever:

 {@code
+   * Arrays.equals(byteString.toByteArray(),
+   *     new String(byteString.toByteArray(), "UTF-8").getBytes("UTF-8"))
+   * }
+ * + *

This method returns {@code false} for "overlong" byte sequences, + * as well as for 3-byte sequences that would map to a surrogate + * character, in accordance with the restricted definition of UTF-8 + * introduced in Unicode 3.1. Note that the UTF-8 decoder included in + * Oracle's JDK has been modified to also reject "overlong" byte + * sequences, but (as of 2011) still accepts 3-byte surrogate + * character byte sequences. + * + *

See the Unicode Standard,
+ * Table 3-6. UTF-8 Bit Distribution,
+ * Table 3-7. Well Formed UTF-8 Byte Sequences. + * + * @return whether the bytes in this {@code ByteString} are a + * well-formed UTF-8 byte sequence + */ + public abstract boolean isValidUtf8(); + + /** + * Tells whether the given byte sequence is a well-formed, malformed, or + * incomplete UTF-8 byte sequence. This method accepts and returns a partial + * state result, allowing the bytes for a complete UTF-8 byte sequence to be + * composed from multiple {@code ByteString} segments. + * + * @param state either {@code 0} (if this is the initial decoding operation) + * or the value returned from a call to a partial decoding method for the + * previous bytes + * @param offset offset of the first byte to check + * @param length number of bytes to check + * + * @return {@code -1} if the partial byte sequence is definitely malformed, + * {@code 0} if it is well-formed (no additional input needed), or, if the + * byte sequence is "incomplete", i.e. apparently terminated in the middle of + * a character, an opaque integer "state" value containing enough information + * to decode the character when passed to a subsequent invocation of a + * partial decoding method. + */ + protected abstract int partialIsValidUtf8(int state, int offset, int length); + + // ================================================================= + // equals() and hashCode() + + @Override + public abstract boolean equals(Object o); + + /** + * Return a non-zero hashCode depending only on the sequence of bytes + * in this ByteString. + * + * @return hashCode value for this object + */ + @Override + public abstract int hashCode(); + + // ================================================================= + // Input stream + + /** + * Creates an {@code InputStream} which can be used to read the bytes. + *

+ * The {@link InputStream} returned by this method is guaranteed to be + * completely non-blocking. The method {@link InputStream#available()} + * returns the number of bytes remaining in the stream. The methods + * {@link InputStream#read(byte[]), {@link InputStream#read(byte[],int,int)} + * and {@link InputStream#skip(long)} will read/skip as many bytes as are + * available. + *

+ * The methods in the returned {@link InputStream} might not be + * thread safe. + * + * @return an input stream that returns the bytes of this byte string. + */ + public abstract InputStream newInput(); + + /** + * Creates a {@link CodedInputStream} which can be used to read the bytes. + * Using this is often more efficient than creating a {@link CodedInputStream} + * that wraps the result of {@link #newInput()}. + * + * @return stream based on wrapped data + */ + public abstract CodedInputStream newCodedInput(); + + // ================================================================= + // Output stream + + /** + * Creates a new {@link Output} with the given initial capacity. Call {@link + * Output#toByteString()} to create the {@code ByteString} instance. + *

+ * A {@link ByteString.Output} offers the same functionality as a + * {@link ByteArrayOutputStream}, except that it returns a {@link ByteString} + * rather than a {@code byte} array. + * + * @param initialCapacity estimate of number of bytes to be written + * @return {@code OutputStream} for building a {@code ByteString} + */ + public static Output newOutput(int initialCapacity) { + return new Output(initialCapacity); + } + + /** + * Creates a new {@link Output}. Call {@link Output#toByteString()} to create + * the {@code ByteString} instance. + *

+ * A {@link ByteString.Output} offers the same functionality as a + * {@link ByteArrayOutputStream}, except that it returns a {@link ByteString} + * rather than a {@code byte array}. + * + * @return {@code OutputStream} for building a {@code ByteString} + */ + public static Output newOutput() { + return new Output(CONCATENATE_BY_COPY_SIZE); + } + + /** + * Outputs to a {@code ByteString} instance. Call {@link #toByteString()} to + * create the {@code ByteString} instance. + */ + public static final class Output extends OutputStream { + // Implementation note. + // The public methods of this class must be synchronized. ByteStrings + // are guaranteed to be immutable. Without some sort of locking, it could + // be possible for one thread to call toByteSring(), while another thread + // is still modifying the underlying byte array. + + private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; + // argument passed by user, indicating initial capacity. + private final int initialCapacity; + // ByteStrings to be concatenated to create the result + private final ArrayList flushedBuffers; + // Total number of bytes in the ByteStrings of flushedBuffers + private int flushedBuffersTotalBytes; + // Current buffer to which we are writing + private byte[] buffer; + // Location in buffer[] to which we write the next byte. + private int bufferPos; + + /** + * Creates a new ByteString output stream with the specified + * initial capacity. + * + * @param initialCapacity the initial capacity of the output stream. + */ + Output(int initialCapacity) { + if (initialCapacity < 0) { + throw new IllegalArgumentException("Buffer size < 0"); + } + this.initialCapacity = initialCapacity; + this.flushedBuffers = new ArrayList(); + this.buffer = new byte[initialCapacity]; + } + + @Override + public synchronized void write(int b) { + if (bufferPos == buffer.length) { + flushFullBuffer(1); + } + buffer[bufferPos++] = (byte)b; + } + + @Override + public synchronized void write(byte[] b, int offset, int length) { + if (length <= buffer.length - bufferPos) { + // The bytes can fit into the current buffer. + System.arraycopy(b, offset, buffer, bufferPos, length); + bufferPos += length; + } else { + // Use up the current buffer + int copySize = buffer.length - bufferPos; + System.arraycopy(b, offset, buffer, bufferPos, copySize); + offset += copySize; + length -= copySize; + // Flush the buffer, and get a new buffer at least big enough to cover + // what we still need to output + flushFullBuffer(length); + System.arraycopy(b, offset, buffer, 0 /* count */, length); + bufferPos = length; + } + } + + /** + * Creates a byte string. Its size is the current size of this output + * stream and its output has been copied to it. + * + * @return the current contents of this output stream, as a byte string. + */ + public synchronized ByteString toByteString() { + flushLastBuffer(); + return ByteString.copyFrom(flushedBuffers); + } + + /** + * Implement java.util.Arrays.copyOf() for jdk 1.5. + */ + private byte[] copyArray(byte[] buffer, int length) { + byte[] result = new byte[length]; + System.arraycopy(buffer, 0, result, 0, Math.min(buffer.length, length)); + return result; + } + + /** + * Writes the complete contents of this byte array output stream to + * the specified output stream argument. + * + * @param out the output stream to which to write the data. + * @throws IOException if an I/O error occurs. + */ + public void writeTo(OutputStream out) throws IOException { + ByteString[] cachedFlushBuffers; + byte[] cachedBuffer; + int cachedBufferPos; + synchronized (this) { + // Copy the information we need into local variables so as to hold + // the lock for as short a time as possible. + cachedFlushBuffers = + flushedBuffers.toArray(new ByteString[flushedBuffers.size()]); + cachedBuffer = buffer; + cachedBufferPos = bufferPos; + } + for (ByteString byteString : cachedFlushBuffers) { + byteString.writeTo(out); + } + + out.write(copyArray(cachedBuffer, cachedBufferPos)); + } + + /** + * Returns the current size of the output stream. + * + * @return the current size of the output stream + */ + public synchronized int size() { + return flushedBuffersTotalBytes + bufferPos; + } + + /** + * Resets this stream, so that all currently accumulated output in the + * output stream is discarded. The output stream can be used again, + * reusing the already allocated buffer space. + */ + public synchronized void reset() { + flushedBuffers.clear(); + flushedBuffersTotalBytes = 0; + bufferPos = 0; + } + + @Override + public String toString() { + return String.format("", + Integer.toHexString(System.identityHashCode(this)), size()); + } + + /** + * Internal function used by writers. The current buffer is full, and the + * writer needs a new buffer whose size is at least the specified minimum + * size. + */ + private void flushFullBuffer(int minSize) { + flushedBuffers.add(new LiteralByteString(buffer)); + flushedBuffersTotalBytes += buffer.length; + // We want to increase our total capacity by 50%, but as a minimum, + // the new buffer should also at least be >= minSize and + // >= initial Capacity. + int newSize = Math.max(initialCapacity, + Math.max(minSize, flushedBuffersTotalBytes >>> 1)); + buffer = new byte[newSize]; + bufferPos = 0; + } + + /** + * Internal function used by {@link #toByteString()}. The current buffer may + * or may not be full, but it needs to be flushed. + */ + private void flushLastBuffer() { + if (bufferPos < buffer.length) { + if (bufferPos > 0) { + byte[] bufferCopy = copyArray(buffer, bufferPos); + flushedBuffers.add(new LiteralByteString(bufferCopy)); + } + // We reuse this buffer for further writes. + } else { + // Buffer is completely full. Huzzah. + flushedBuffers.add(new LiteralByteString(buffer)); + // 99% of the time, we're not going to use this OutputStream again. + // We set buffer to an empty byte stream so that we're handling this + // case without wasting space. In the rare case that more writes + // *do* occur, this empty buffer will be flushed and an appropriately + // sized new buffer will be created. + buffer = EMPTY_BYTE_ARRAY; + } + flushedBuffersTotalBytes += bufferPos; + bufferPos = 0; + } + } + + /** + * Constructs a new {@code ByteString} builder, which allows you to + * efficiently construct a {@code ByteString} by writing to a {@link + * CodedOutputStream}. Using this is much more efficient than calling {@code + * newOutput()} and wrapping that in a {@code CodedOutputStream}. + * + *

This is package-private because it's a somewhat confusing interface. + * Users can call {@link Message#toByteString()} instead of calling this + * directly. + * + * @param size The target byte size of the {@code ByteString}. You must write + * exactly this many bytes before building the result. + * @return the builder + */ + static CodedBuilder newCodedBuilder(int size) { + return new CodedBuilder(size); + } + + /** See {@link ByteString#newCodedBuilder(int)}. */ + static final class CodedBuilder { + private final CodedOutputStream output; + private final byte[] buffer; + + private CodedBuilder(int size) { + buffer = new byte[size]; + output = CodedOutputStream.newInstance(buffer); + } + + public ByteString build() { + output.checkNoSpaceLeft(); + + // We can be confident that the CodedOutputStream will not modify the + // underlying bytes anymore because it already wrote all of them. So, + // no need to make a copy. + return new LiteralByteString(buffer); + } + + public CodedOutputStream getCodedOutput() { + return output; + } + } + + // ================================================================= + // Methods {@link RopeByteString} needs on instances, which aren't part of the + // public API. + + /** + * Return the depth of the tree representing this {@code ByteString}, if any, + * whose root is this node. If this is a leaf node, return 0. + * + * @return tree depth or zero + */ + protected abstract int getTreeDepth(); + + /** + * Return {@code true} if this ByteString is literal (a leaf node) or a + * flat-enough tree in the sense of {@link RopeByteString}. + * + * @return true if the tree is flat enough + */ + protected abstract boolean isBalanced(); + + /** + * Return the cached hash code if available. + * + * @return value of cached hash code or 0 if not computed yet + */ + protected abstract int peekCachedHashCode(); + + /** + * Compute the hash across the value bytes starting with the given hash, and + * return the result. This is used to compute the hash across strings + * represented as a set of pieces by allowing the hash computation to be + * continued from piece to piece. + * + * @param h starting hash value + * @param offset offset into this value to start looking at data values + * @param length number of data values to include in the hash computation + * @return ending hash value + */ + protected abstract int partialHash(int h, int offset, int length); + + @Override + public String toString() { + return String.format("", + Integer.toHexString(System.identityHashCode(this)), size()); + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/CodedInputStream.java b/retrofit/src/main/java/com/google/protobuf/CodedInputStream.java new file mode 100644 index 0000000000..a00ae86f04 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/CodedInputStream.java @@ -0,0 +1,1311 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Reads and decodes protocol message fields. + * + * This class contains two kinds of methods: methods that read specific + * protocol message constructs and field types (e.g. {@link #readTag()} and + * {@link #readInt32()}) and methods that read low-level values (e.g. + * {@link #readRawVarint32()} and {@link #readRawBytes}). If you are reading + * encoded protocol messages, you should use the former methods, but if you are + * reading some other format of your own design, use the latter. + * + * @author kenton@google.com Kenton Varda + */ +public final class CodedInputStream { + /** + * Create a new CodedInputStream wrapping the given InputStream. + */ + public static CodedInputStream newInstance(final InputStream input) { + return new CodedInputStream(input); + } + + /** + * Create a new CodedInputStream wrapping the given byte array. + */ + public static CodedInputStream newInstance(final byte[] buf) { + return newInstance(buf, 0, buf.length); + } + + /** + * Create a new CodedInputStream wrapping the given byte array slice. + */ + public static CodedInputStream newInstance(final byte[] buf, final int off, + final int len) { + CodedInputStream result = new CodedInputStream(buf, off, len); + try { + // Some uses of CodedInputStream can be more efficient if they know + // exactly how many bytes are available. By pushing the end point of the + // buffer as a limit, we allow them to get this information via + // getBytesUntilLimit(). Pushing a limit that we know is at the end of + // the stream can never hurt, since we can never past that point anyway. + result.pushLimit(len); + } catch (InvalidProtocolBufferException ex) { + // The only reason pushLimit() might throw an exception here is if len + // is negative. Normally pushLimit()'s parameter comes directly off the + // wire, so it's important to catch exceptions in case of corrupt or + // malicious data. However, in this case, we expect that len is not a + // user-supplied value, so we can assume that it being negative indicates + // a programming error. Therefore, throwing an unchecked exception is + // appropriate. + throw new IllegalArgumentException(ex); + } + return result; + } + + /** + * Create a new CodedInputStream wrapping the given ByteBuffer. The data + * starting from the ByteBuffer's current position to its limit will be read. + * The returned CodedInputStream may or may not share the underlying data + * in the ByteBuffer, therefore the ByteBuffer cannot be changed while the + * CodedInputStream is in use. + * Note that the ByteBuffer's position won't be changed by this function. + * Concurrent calls with the same ByteBuffer object are safe if no other + * thread is trying to alter the ByteBuffer's status. + */ + public static CodedInputStream newInstance(ByteBuffer buf) { + if (buf.hasArray()) { + return newInstance(buf.array(), buf.arrayOffset() + buf.position(), + buf.remaining()); + } else { + ByteBuffer temp = buf.duplicate(); + byte[] buffer = new byte[temp.remaining()]; + temp.get(buffer); + return newInstance(buffer); + } + } + + /** + * Create a new CodedInputStream wrapping a LiteralByteString. + */ + static CodedInputStream newInstance(LiteralByteString byteString) { + CodedInputStream result = new CodedInputStream(byteString); + try { + // Some uses of CodedInputStream can be more efficient if they know + // exactly how many bytes are available. By pushing the end point of the + // buffer as a limit, we allow them to get this information via + // getBytesUntilLimit(). Pushing a limit that we know is at the end of + // the stream can never hurt, since we can never past that point anyway. + result.pushLimit(byteString.size()); + } catch (InvalidProtocolBufferException ex) { + // The only reason pushLimit() might throw an exception here is if len + // is negative. Normally pushLimit()'s parameter comes directly off the + // wire, so it's important to catch exceptions in case of corrupt or + // malicious data. However, in this case, we expect that len is not a + // user-supplied value, so we can assume that it being negative indicates + // a programming error. Therefore, throwing an unchecked exception is + // appropriate. + throw new IllegalArgumentException(ex); + } + return result; + } + + // ----------------------------------------------------------------- + + /** + * Attempt to read a field tag, returning zero if we have reached EOF. + * Protocol message parsers use this to read tags, since a protocol message + * may legally end wherever a tag occurs, and zero is not a valid tag number. + */ + public int readTag() throws IOException { + if (isAtEnd()) { + lastTag = 0; + return 0; + } + + lastTag = readRawVarint32(); + if (WireFormat.getTagFieldNumber(lastTag) == 0) { + // If we actually read zero (or any tag number corresponding to field + // number zero), that's not a valid tag. + throw InvalidProtocolBufferException.invalidTag(); + } + return lastTag; + } + + /** + * Verifies that the last call to readTag() returned the given tag value. + * This is used to verify that a nested group ended with the correct + * end tag. + * + * @throws InvalidProtocolBufferException {@code value} does not match the + * last tag. + */ + public void checkLastTagWas(final int value) + throws InvalidProtocolBufferException { + if (lastTag != value) { + throw InvalidProtocolBufferException.invalidEndTag(); + } + } + + public int getLastTag() { + return lastTag; + } + + /** + * Reads and discards a single field, given its tag value. + * + * @return {@code false} if the tag is an endgroup tag, in which case + * nothing is skipped. Otherwise, returns {@code true}. + */ + public boolean skipField(final int tag) throws IOException { + switch (WireFormat.getTagWireType(tag)) { + case WireFormat.WIRETYPE_VARINT: + skipRawVarint(); + return true; + case WireFormat.WIRETYPE_FIXED64: + skipRawBytes(8); + return true; + case WireFormat.WIRETYPE_LENGTH_DELIMITED: + skipRawBytes(readRawVarint32()); + return true; + case WireFormat.WIRETYPE_START_GROUP: + skipMessage(); + checkLastTagWas( + WireFormat.makeTag(WireFormat.getTagFieldNumber(tag), + WireFormat.WIRETYPE_END_GROUP)); + return true; + case WireFormat.WIRETYPE_END_GROUP: + return false; + case WireFormat.WIRETYPE_FIXED32: + skipRawBytes(4); + return true; + default: + throw InvalidProtocolBufferException.invalidWireType(); + } + } + + /** + * Reads a single field and writes it to output in wire format, + * given its tag value. + * + * @return {@code false} if the tag is an endgroup tag, in which case + * nothing is skipped. Otherwise, returns {@code true}. + */ + public boolean skipField(final int tag, final CodedOutputStream output) + throws IOException { + switch (WireFormat.getTagWireType(tag)) { + case WireFormat.WIRETYPE_VARINT: { + long value = readInt64(); + output.writeRawVarint32(tag); + output.writeUInt64NoTag(value); + return true; + } + case WireFormat.WIRETYPE_FIXED64: { + long value = readRawLittleEndian64(); + output.writeRawVarint32(tag); + output.writeFixed64NoTag(value); + return true; + } + case WireFormat.WIRETYPE_LENGTH_DELIMITED: { + ByteString value = readBytes(); + output.writeRawVarint32(tag); + output.writeBytesNoTag(value); + return true; + } + case WireFormat.WIRETYPE_START_GROUP: { + output.writeRawVarint32(tag); + skipMessage(output); + int endtag = WireFormat.makeTag(WireFormat.getTagFieldNumber(tag), + WireFormat.WIRETYPE_END_GROUP); + checkLastTagWas(endtag); + output.writeRawVarint32(endtag); + return true; + } + case WireFormat.WIRETYPE_END_GROUP: { + return false; + } + case WireFormat.WIRETYPE_FIXED32: { + int value = readRawLittleEndian32(); + output.writeRawVarint32(tag); + output.writeFixed32NoTag(value); + return true; + } + default: + throw InvalidProtocolBufferException.invalidWireType(); + } + } + + /** + * Reads and discards an entire message. This will read either until EOF + * or until an endgroup tag, whichever comes first. + */ + public void skipMessage() throws IOException { + while (true) { + final int tag = readTag(); + if (tag == 0 || !skipField(tag)) { + return; + } + } + } + + /** + * Reads an entire message and writes it to output in wire format. + * This will read either until EOF or until an endgroup tag, + * whichever comes first. + */ + public void skipMessage(CodedOutputStream output) throws IOException { + while (true) { + final int tag = readTag(); + if (tag == 0 || !skipField(tag, output)) { + return; + } + } + } + + /** + * Collects the bytes skipped and returns the data in a ByteBuffer. + */ + private class SkippedDataSink implements RefillCallback { + private int lastPos = bufferPos; + private ByteArrayOutputStream byteArrayStream; + + @Override + public void onRefill() { + if (byteArrayStream == null) { + byteArrayStream = new ByteArrayOutputStream(); + } + byteArrayStream.write(buffer, lastPos, bufferPos - lastPos); + lastPos = 0; + } + + /** + * Gets skipped data in a ByteBuffer. This method should only be + * called once. + */ + ByteBuffer getSkippedData() { + if (byteArrayStream == null) { + return ByteBuffer.wrap(buffer, lastPos, bufferPos - lastPos); + } else { + byteArrayStream.write(buffer, lastPos, bufferPos); + return ByteBuffer.wrap(byteArrayStream.toByteArray()); + } + } + } + + + // ----------------------------------------------------------------- + + /** Read a {@code double} field value from the stream. */ + public double readDouble() throws IOException { + return Double.longBitsToDouble(readRawLittleEndian64()); + } + + /** Read a {@code float} field value from the stream. */ + public float readFloat() throws IOException { + return Float.intBitsToFloat(readRawLittleEndian32()); + } + + /** Read a {@code uint64} field value from the stream. */ + public long readUInt64() throws IOException { + return readRawVarint64(); + } + + /** Read an {@code int64} field value from the stream. */ + public long readInt64() throws IOException { + return readRawVarint64(); + } + + /** Read an {@code int32} field value from the stream. */ + public int readInt32() throws IOException { + return readRawVarint32(); + } + + /** Read a {@code fixed64} field value from the stream. */ + public long readFixed64() throws IOException { + return readRawLittleEndian64(); + } + + /** Read a {@code fixed32} field value from the stream. */ + public int readFixed32() throws IOException { + return readRawLittleEndian32(); + } + + /** Read a {@code bool} field value from the stream. */ + public boolean readBool() throws IOException { + return readRawVarint64() != 0; + } + + /** + * Read a {@code string} field value from the stream. + * If the stream contains malformed UTF-8, + * replace the offending bytes with the standard UTF-8 replacement character. + */ + public String readString() throws IOException { + final int size = readRawVarint32(); + if (size <= (bufferSize - bufferPos) && size > 0) { + // Fast path: We already have the bytes in a contiguous buffer, so + // just copy directly from it. + final String result = new String(buffer, bufferPos, size, "UTF-8"); + bufferPos += size; + return result; + } else if (size == 0) { + return ""; + } else { + // Slow path: Build a byte array first then copy it. + return new String(readRawBytesSlowPath(size), "UTF-8"); + } + } + + /** + * Read a {@code string} field value from the stream. + * If the stream contains malformed UTF-8, + * throw exception {@link InvalidProtocolBufferException}. + */ + public String readStringRequireUtf8() throws IOException { + final int size = readRawVarint32(); + final byte[] bytes; + int pos = bufferPos; + if (size <= (bufferSize - pos) && size > 0) { + // Fast path: We already have the bytes in a contiguous buffer, so + // just copy directly from it. + bytes = buffer; + bufferPos = pos + size; + } else if (size == 0) { + return ""; + } else { + // Slow path: Build a byte array first then copy it. + bytes = readRawBytesSlowPath(size); + pos = 0; + } + // TODO(martinrb): We could save a pass by validating while decoding. + if (!Utf8.isValidUtf8(bytes, pos, pos + size)) { + throw InvalidProtocolBufferException.invalidUtf8(); + } + return new String(bytes, pos, size, "UTF-8"); + } + + /** Read a {@code group} field value from the stream. */ + public void readGroup(final int fieldNumber, + final MessageLite.Builder builder, + final ExtensionRegistryLite extensionRegistry) + throws IOException { + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } + ++recursionDepth; + builder.mergeFrom(this, extensionRegistry); + checkLastTagWas( + WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); + --recursionDepth; + } + + + /** Read a {@code group} field value from the stream. */ + public T readGroup( + final int fieldNumber, + final Parser parser, + final ExtensionRegistryLite extensionRegistry) + throws IOException { + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } + ++recursionDepth; + T result = parser.parsePartialFrom(this, extensionRegistry); + checkLastTagWas( + WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); + --recursionDepth; + return result; + } + + /** + * Reads a {@code group} field value from the stream and merges it into the + * given {@link UnknownFieldSet}. + * + * @deprecated UnknownFieldSet.Builder now implements MessageLite.Builder, so + * you can just call {@link #readGroup}. + */ + @Deprecated + public void readUnknownGroup(final int fieldNumber, + final MessageLite.Builder builder) + throws IOException { + // We know that UnknownFieldSet will ignore any ExtensionRegistry so it + // is safe to pass null here. (We can't call + // ExtensionRegistry.getEmptyRegistry() because that would make this + // class depend on ExtensionRegistry, which is not part of the lite + // library.) + readGroup(fieldNumber, builder, null); + } + + /** Read an embedded message field value from the stream. */ + public void readMessage(final MessageLite.Builder builder, + final ExtensionRegistryLite extensionRegistry) + throws IOException { + final int length = readRawVarint32(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } + final int oldLimit = pushLimit(length); + ++recursionDepth; + builder.mergeFrom(this, extensionRegistry); + checkLastTagWas(0); + --recursionDepth; + popLimit(oldLimit); + } + + + /** Read an embedded message field value from the stream. */ + public T readMessage( + final Parser parser, + final ExtensionRegistryLite extensionRegistry) + throws IOException { + int length = readRawVarint32(); + if (recursionDepth >= recursionLimit) { + throw InvalidProtocolBufferException.recursionLimitExceeded(); + } + final int oldLimit = pushLimit(length); + ++recursionDepth; + T result = parser.parsePartialFrom(this, extensionRegistry); + checkLastTagWas(0); + --recursionDepth; + popLimit(oldLimit); + return result; + } + + /** Read a {@code bytes} field value from the stream. */ + public ByteString readBytes() throws IOException { + final int size = readRawVarint32(); + if (size <= (bufferSize - bufferPos) && size > 0) { + // Fast path: We already have the bytes in a contiguous buffer, so + // just copy directly from it. + final ByteString result = bufferIsImmutable && enableAliasing + ? new BoundedByteString(buffer, bufferPos, size) + : ByteString.copyFrom(buffer, bufferPos, size); + bufferPos += size; + return result; + } else if (size == 0) { + return ByteString.EMPTY; + } else { + // Slow path: Build a byte array first then copy it. + return new LiteralByteString(readRawBytesSlowPath(size)); + } + } + + /** Read a {@code bytes} field value from the stream. */ + public byte[] readByteArray() throws IOException { + final int size = readRawVarint32(); + if (size <= (bufferSize - bufferPos) && size > 0) { + // Fast path: We already have the bytes in a contiguous buffer, so + // just copy directly from it. + final byte[] result = + Arrays.copyOfRange(buffer, bufferPos, bufferPos + size); + bufferPos += size; + return result; + } else { + // Slow path: Build a byte array first then copy it. + return readRawBytesSlowPath(size); + } + } + + /** Read a {@code bytes} field value from the stream. */ + public ByteBuffer readByteBuffer() throws IOException { + final int size = readRawVarint32(); + if (size <= (bufferSize - bufferPos) && size > 0) { + // Fast path: We already have the bytes in a contiguous buffer. + // When aliasing is enabled, we can return a ByteBuffer pointing directly + // into the underlying byte array without copy if the CodedInputStream is + // constructed from a byte array. If aliasing is disabled or the input is + // from an InputStream or ByteString, we have to make a copy of the bytes. + ByteBuffer result = input == null && !bufferIsImmutable && enableAliasing + ? ByteBuffer.wrap(buffer, bufferPos, size).slice() + : ByteBuffer.wrap(Arrays.copyOfRange( + buffer, bufferPos, bufferPos + size)); + bufferPos += size; + return result; + } else if (size == 0) { + return Internal.EMPTY_BYTE_BUFFER; + } else { + // Slow path: Build a byte array first then copy it. + return ByteBuffer.wrap(readRawBytesSlowPath(size)); + } + } + + /** Read a {@code uint32} field value from the stream. */ + public int readUInt32() throws IOException { + return readRawVarint32(); + } + + /** + * Read an enum field value from the stream. Caller is responsible + * for converting the numeric value to an actual enum. + */ + public int readEnum() throws IOException { + return readRawVarint32(); + } + + /** Read an {@code sfixed32} field value from the stream. */ + public int readSFixed32() throws IOException { + return readRawLittleEndian32(); + } + + /** Read an {@code sfixed64} field value from the stream. */ + public long readSFixed64() throws IOException { + return readRawLittleEndian64(); + } + + /** Read an {@code sint32} field value from the stream. */ + public int readSInt32() throws IOException { + return decodeZigZag32(readRawVarint32()); + } + + /** Read an {@code sint64} field value from the stream. */ + public long readSInt64() throws IOException { + return decodeZigZag64(readRawVarint64()); + } + + // ================================================================= + + /** + * Read a raw Varint from the stream. If larger than 32 bits, discard the + * upper bits. + */ + public int readRawVarint32() throws IOException { + // See implementation notes for readRawVarint64 + fastpath: { + int pos = bufferPos; + + if (bufferSize == pos) { + break fastpath; + } + + final byte[] buffer = this.buffer; + int x; + if ((x = buffer[pos++]) >= 0) { + bufferPos = pos; + return x; + } else if (bufferSize - pos < 9) { + break fastpath; + } else if ((x ^= (buffer[pos++] << 7)) < 0L) { + x ^= (~0L << 7); + } else if ((x ^= (buffer[pos++] << 14)) >= 0L) { + x ^= (~0L << 7) ^ (~0L << 14); + } else if ((x ^= (buffer[pos++] << 21)) < 0L) { + x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21); + } else { + int y = buffer[pos++]; + x ^= y << 28; + x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28); + if (y < 0 && + buffer[pos++] < 0 && + buffer[pos++] < 0 && + buffer[pos++] < 0 && + buffer[pos++] < 0 && + buffer[pos++] < 0) { + break fastpath; // Will throw malformedVarint() + } + } + bufferPos = pos; + return x; + } + return (int) readRawVarint64SlowPath(); + } + + private void skipRawVarint() throws IOException { + if (bufferSize - bufferPos >= 10) { + final byte[] buffer = this.buffer; + int pos = bufferPos; + for (int i = 0; i < 10; i++) { + if (buffer[pos++] >= 0) { + bufferPos = pos; + return; + } + } + } + skipRawVarintSlowPath(); + } + + private void skipRawVarintSlowPath() throws IOException { + for (int i = 0; i < 10; i++) { + if (readRawByte() >= 0) { + return; + } + } + throw InvalidProtocolBufferException.malformedVarint(); + } + + /** + * Reads a varint from the input one byte at a time, so that it does not + * read any bytes after the end of the varint. If you simply wrapped the + * stream in a CodedInputStream and used {@link #readRawVarint32(InputStream)} + * then you would probably end up reading past the end of the varint since + * CodedInputStream buffers its input. + */ + static int readRawVarint32(final InputStream input) throws IOException { + final int firstByte = input.read(); + if (firstByte == -1) { + throw InvalidProtocolBufferException.truncatedMessage(); + } + return readRawVarint32(firstByte, input); + } + + /** + * Like {@link #readRawVarint32(InputStream)}, but expects that the caller + * has already read one byte. This allows the caller to determine if EOF + * has been reached before attempting to read. + */ + public static int readRawVarint32( + final int firstByte, final InputStream input) throws IOException { + if ((firstByte & 0x80) == 0) { + return firstByte; + } + + int result = firstByte & 0x7f; + int offset = 7; + for (; offset < 32; offset += 7) { + final int b = input.read(); + if (b == -1) { + throw InvalidProtocolBufferException.truncatedMessage(); + } + result |= (b & 0x7f) << offset; + if ((b & 0x80) == 0) { + return result; + } + } + // Keep reading up to 64 bits. + for (; offset < 64; offset += 7) { + final int b = input.read(); + if (b == -1) { + throw InvalidProtocolBufferException.truncatedMessage(); + } + if ((b & 0x80) == 0) { + return result; + } + } + throw InvalidProtocolBufferException.malformedVarint(); + } + + /** Read a raw Varint from the stream. */ + public long readRawVarint64() throws IOException { + // Implementation notes: + // + // Optimized for one-byte values, expected to be common. + // The particular code below was selected from various candidates + // empirically, by winning VarintBenchmark. + // + // Sign extension of (signed) Java bytes is usually a nuisance, but + // we exploit it here to more easily obtain the sign of bytes read. + // Instead of cleaning up the sign extension bits by masking eagerly, + // we delay until we find the final (positive) byte, when we clear all + // accumulated bits with one xor. We depend on javac to constant fold. + fastpath: { + int pos = bufferPos; + + if (bufferSize == pos) { + break fastpath; + } + + final byte[] buffer = this.buffer; + long x; + int y; + if ((y = buffer[pos++]) >= 0) { + bufferPos = pos; + return y; + } else if (bufferSize - pos < 9) { + break fastpath; + } else if ((x = y ^ (buffer[pos++] << 7)) < 0L) { + x ^= (~0L << 7); + } else if ((x ^= (buffer[pos++] << 14)) >= 0L) { + x ^= (~0L << 7) ^ (~0L << 14); + } else if ((x ^= (buffer[pos++] << 21)) < 0L) { + x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21); + } else if ((x ^= ((long) buffer[pos++] << 28)) >= 0L) { + x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28); + } else if ((x ^= ((long) buffer[pos++] << 35)) < 0L) { + x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35); + } else if ((x ^= ((long) buffer[pos++] << 42)) >= 0L) { + x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42); + } else if ((x ^= ((long) buffer[pos++] << 49)) < 0L) { + x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42) + ^ (~0L << 49); + } else { + x ^= ((long) buffer[pos++] << 56); + x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42) + ^ (~0L << 49) ^ (~0L << 56); + if (x < 0L) { + if (buffer[pos++] < 0L) { + break fastpath; // Will throw malformedVarint() + } + } + } + bufferPos = pos; + return x; + } + return readRawVarint64SlowPath(); + } + + /** Variant of readRawVarint64 for when uncomfortably close to the limit. */ + /* Visible for testing */ + long readRawVarint64SlowPath() throws IOException { + long result = 0; + for (int shift = 0; shift < 64; shift += 7) { + final byte b = readRawByte(); + result |= (long) (b & 0x7F) << shift; + if ((b & 0x80) == 0) { + return result; + } + } + throw InvalidProtocolBufferException.malformedVarint(); + } + + /** Read a 32-bit little-endian integer from the stream. */ + public int readRawLittleEndian32() throws IOException { + int pos = bufferPos; + + // hand-inlined ensureAvailable(4); + if (bufferSize - pos < 4) { + refillBuffer(4); + pos = bufferPos; + } + + final byte[] buffer = this.buffer; + bufferPos = pos + 4; + return (((buffer[pos] & 0xff)) | + ((buffer[pos + 1] & 0xff) << 8) | + ((buffer[pos + 2] & 0xff) << 16) | + ((buffer[pos + 3] & 0xff) << 24)); + } + + /** Read a 64-bit little-endian integer from the stream. */ + public long readRawLittleEndian64() throws IOException { + int pos = bufferPos; + + // hand-inlined ensureAvailable(8); + if (bufferSize - pos < 8) { + refillBuffer(8); + pos = bufferPos; + } + + final byte[] buffer = this.buffer; + bufferPos = pos + 8; + return ((((long) buffer[pos] & 0xffL)) | + (((long) buffer[pos + 1] & 0xffL) << 8) | + (((long) buffer[pos + 2] & 0xffL) << 16) | + (((long) buffer[pos + 3] & 0xffL) << 24) | + (((long) buffer[pos + 4] & 0xffL) << 32) | + (((long) buffer[pos + 5] & 0xffL) << 40) | + (((long) buffer[pos + 6] & 0xffL) << 48) | + (((long) buffer[pos + 7] & 0xffL) << 56)); + } + + /** + * Decode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers + * into values that can be efficiently encoded with varint. (Otherwise, + * negative values must be sign-extended to 64 bits to be varint encoded, + * thus always taking 10 bytes on the wire.) + * + * @param n An unsigned 32-bit integer, stored in a signed int because + * Java has no explicit unsigned support. + * @return A signed 32-bit integer. + */ + public static int decodeZigZag32(final int n) { + return (n >>> 1) ^ -(n & 1); + } + + /** + * Decode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers + * into values that can be efficiently encoded with varint. (Otherwise, + * negative values must be sign-extended to 64 bits to be varint encoded, + * thus always taking 10 bytes on the wire.) + * + * @param n An unsigned 64-bit integer, stored in a signed int because + * Java has no explicit unsigned support. + * @return A signed 64-bit integer. + */ + public static long decodeZigZag64(final long n) { + return (n >>> 1) ^ -(n & 1); + } + + // ----------------------------------------------------------------- + + private final byte[] buffer; + private final boolean bufferIsImmutable; + private int bufferSize; + private int bufferSizeAfterLimit; + private int bufferPos; + private final InputStream input; + private int lastTag; + private boolean enableAliasing = false; + + /** + * The total number of bytes read before the current buffer. The total + * bytes read up to the current position can be computed as + * {@code totalBytesRetired + bufferPos}. This value may be negative if + * reading started in the middle of the current buffer (e.g. if the + * constructor that takes a byte array and an offset was used). + */ + private int totalBytesRetired; + + /** The absolute position of the end of the current message. */ + private int currentLimit = Integer.MAX_VALUE; + + /** See setRecursionLimit() */ + private int recursionDepth; + private int recursionLimit = DEFAULT_RECURSION_LIMIT; + + /** See setSizeLimit() */ + private int sizeLimit = DEFAULT_SIZE_LIMIT; + + private static final int DEFAULT_RECURSION_LIMIT = 64; + private static final int DEFAULT_SIZE_LIMIT = 64 << 20; // 64MB + private static final int BUFFER_SIZE = 4096; + + private CodedInputStream(final byte[] buffer, final int off, final int len) { + this.buffer = buffer; + bufferSize = off + len; + bufferPos = off; + totalBytesRetired = -off; + input = null; + bufferIsImmutable = false; + } + + private CodedInputStream(final InputStream input) { + buffer = new byte[BUFFER_SIZE]; + bufferSize = 0; + bufferPos = 0; + totalBytesRetired = 0; + this.input = input; + bufferIsImmutable = false; + } + + private CodedInputStream(final LiteralByteString byteString) { + buffer = byteString.bytes; + bufferPos = byteString.getOffsetIntoBytes(); + bufferSize = bufferPos + byteString.size(); + totalBytesRetired = -bufferPos; + input = null; + bufferIsImmutable = true; + } + + public void enableAliasing(boolean enabled) { + this.enableAliasing = enabled; + } + + /** + * Set the maximum message recursion depth. In order to prevent malicious + * messages from causing stack overflows, {@code CodedInputStream} limits + * how deeply messages may be nested. The default limit is 64. + * + * @return the old limit. + */ + public int setRecursionLimit(final int limit) { + if (limit < 0) { + throw new IllegalArgumentException( + "Recursion limit cannot be negative: " + limit); + } + final int oldLimit = recursionLimit; + recursionLimit = limit; + return oldLimit; + } + + /** + * Set the maximum message size. In order to prevent malicious + * messages from exhausting memory or causing integer overflows, + * {@code CodedInputStream} limits how large a message may be. + * The default limit is 64MB. You should set this limit as small + * as you can without harming your app's functionality. Note that + * size limits only apply when reading from an {@code InputStream}, not + * when constructed around a raw byte array (nor with + * {@link ByteString#newCodedInput}). + *

+ * If you want to read several messages from a single CodedInputStream, you + * could call {@link #resetSizeCounter()} after each one to avoid hitting the + * size limit. + * + * @return the old limit. + */ + public int setSizeLimit(final int limit) { + if (limit < 0) { + throw new IllegalArgumentException( + "Size limit cannot be negative: " + limit); + } + final int oldLimit = sizeLimit; + sizeLimit = limit; + return oldLimit; + } + + /** + * Resets the current size counter to zero (see {@link #setSizeLimit(int)}). + */ + public void resetSizeCounter() { + totalBytesRetired = -bufferPos; + } + + /** + * Sets {@code currentLimit} to (current position) + {@code byteLimit}. This + * is called when descending into a length-delimited embedded message. + * + *

Note that {@code pushLimit()} does NOT affect how many bytes the + * {@code CodedInputStream} reads from an underlying {@code InputStream} when + * refreshing its buffer. If you need to prevent reading past a certain + * point in the underlying {@code InputStream} (e.g. because you expect it to + * contain more data after the end of the message which you need to handle + * differently) then you must place a wrapper around your {@code InputStream} + * which limits the amount of data that can be read from it. + * + * @return the old limit. + */ + public int pushLimit(int byteLimit) throws InvalidProtocolBufferException { + if (byteLimit < 0) { + throw InvalidProtocolBufferException.negativeSize(); + } + byteLimit += totalBytesRetired + bufferPos; + final int oldLimit = currentLimit; + if (byteLimit > oldLimit) { + throw InvalidProtocolBufferException.truncatedMessage(); + } + currentLimit = byteLimit; + + recomputeBufferSizeAfterLimit(); + + return oldLimit; + } + + private void recomputeBufferSizeAfterLimit() { + bufferSize += bufferSizeAfterLimit; + final int bufferEnd = totalBytesRetired + bufferSize; + if (bufferEnd > currentLimit) { + // Limit is in current buffer. + bufferSizeAfterLimit = bufferEnd - currentLimit; + bufferSize -= bufferSizeAfterLimit; + } else { + bufferSizeAfterLimit = 0; + } + } + + /** + * Discards the current limit, returning to the previous limit. + * + * @param oldLimit The old limit, as returned by {@code pushLimit}. + */ + public void popLimit(final int oldLimit) { + currentLimit = oldLimit; + recomputeBufferSizeAfterLimit(); + } + + /** + * Returns the number of bytes to be read before the current limit. + * If no limit is set, returns -1. + */ + public int getBytesUntilLimit() { + if (currentLimit == Integer.MAX_VALUE) { + return -1; + } + + final int currentAbsolutePosition = totalBytesRetired + bufferPos; + return currentLimit - currentAbsolutePosition; + } + + /** + * Returns true if the stream has reached the end of the input. This is the + * case if either the end of the underlying input source has been reached or + * if the stream has reached a limit created using {@link #pushLimit(int)}. + */ + public boolean isAtEnd() throws IOException { + return bufferPos == bufferSize && !tryRefillBuffer(1); + } + + /** + * The total bytes read up to the current position. Calling + * {@link #resetSizeCounter()} resets this value to zero. + */ + public int getTotalBytesRead() { + return totalBytesRetired + bufferPos; + } + + private interface RefillCallback { + void onRefill(); + } + + private RefillCallback refillCallback = null; + + /** + * Ensures that at least {@code n} bytes are available in the buffer, reading + * more bytes from the input if necessary to make it so. Caller must ensure + * that the requested space is less than BUFFER_SIZE. + * + * @throws InvalidProtocolBufferException The end of the stream or the current + * limit was reached. + */ + private void ensureAvailable(int n) throws IOException { + if (bufferSize - bufferPos < n) { + refillBuffer(n); + } + } + + /** + * Reads more bytes from the input, making at least {@code n} bytes available + * in the buffer. Caller must ensure that the requested space is not yet + * available, and that the requested space is less than BUFFER_SIZE. + * + * @throws InvalidProtocolBufferException The end of the stream or the current + * limit was reached. + */ + private void refillBuffer(int n) throws IOException { + if (!tryRefillBuffer(n)) { + throw InvalidProtocolBufferException.truncatedMessage(); + } + } + + /** + * Tries to read more bytes from the input, making at least {@code n} bytes + * available in the buffer. Caller must ensure that the requested space is + * not yet available, and that the requested space is less than BUFFER_SIZE. + * + * @return {@code true} if the bytes could be made available; {@code false} + * if the end of the stream or the current limit was reached. + */ + private boolean tryRefillBuffer(int n) throws IOException { + if (bufferPos + n <= bufferSize) { + throw new IllegalStateException( + "refillBuffer() called when " + n + + " bytes were already available in buffer"); + } + + if (totalBytesRetired + bufferPos + n > currentLimit) { + // Oops, we hit a limit. + return false; + } + + if (refillCallback != null) { + refillCallback.onRefill(); + } + + if (input != null) { + int pos = bufferPos; + if (pos > 0) { + if (bufferSize > pos) { + System.arraycopy(buffer, pos, buffer, 0, bufferSize - pos); + } + totalBytesRetired += pos; + bufferSize -= pos; + bufferPos = 0; + } + + int bytesRead = input.read(buffer, bufferSize, buffer.length - bufferSize); + if (bytesRead == 0 || bytesRead < -1 || bytesRead > buffer.length) { + throw new IllegalStateException( + "InputStream#read(byte[]) returned invalid result: " + bytesRead + + "\nThe InputStream implementation is buggy."); + } + if (bytesRead > 0) { + bufferSize += bytesRead; + // Integer-overflow-conscious check against sizeLimit + if (totalBytesRetired + n - sizeLimit > 0) { + throw InvalidProtocolBufferException.sizeLimitExceeded(); + } + recomputeBufferSizeAfterLimit(); + return (bufferSize >= n) ? true : tryRefillBuffer(n); + } + } + + return false; + } + + /** + * Read one byte from the input. + * + * @throws InvalidProtocolBufferException The end of the stream or the current + * limit was reached. + */ + public byte readRawByte() throws IOException { + if (bufferPos == bufferSize) { + refillBuffer(1); + } + return buffer[bufferPos++]; + } + + /** + * Read a fixed size of bytes from the input. + * + * @throws InvalidProtocolBufferException The end of the stream or the current + * limit was reached. + */ + public byte[] readRawBytes(final int size) throws IOException { + final int pos = bufferPos; + if (size <= (bufferSize - pos) && size > 0) { + bufferPos = pos + size; + return Arrays.copyOfRange(buffer, pos, pos + size); + } else { + return readRawBytesSlowPath(size); + } + } + + /** + * Exactly like readRawBytes, but caller must have already checked the fast + * path: (size <= (bufferSize - pos) && size > 0) + */ + private byte[] readRawBytesSlowPath(final int size) throws IOException { + if (size <= 0) { + if (size == 0) { + return Internal.EMPTY_BYTE_ARRAY; + } else { + throw InvalidProtocolBufferException.negativeSize(); + } + } + + if (totalBytesRetired + bufferPos + size > currentLimit) { + // Read to the end of the stream anyway. + skipRawBytes(currentLimit - totalBytesRetired - bufferPos); + // Then fail. + throw InvalidProtocolBufferException.truncatedMessage(); + } + + if (size < BUFFER_SIZE) { + // Reading more bytes than are in the buffer, but not an excessive number + // of bytes. We can safely allocate the resulting array ahead of time. + + // First copy what we have. + final byte[] bytes = new byte[size]; + int pos = bufferSize - bufferPos; + System.arraycopy(buffer, bufferPos, bytes, 0, pos); + bufferPos = bufferSize; + + // We want to refill the buffer and then copy from the buffer into our + // byte array rather than reading directly into our byte array because + // the input may be unbuffered. + ensureAvailable(size - pos); + System.arraycopy(buffer, 0, bytes, pos, size - pos); + bufferPos = size - pos; + + return bytes; + } else { + // The size is very large. For security reasons, we can't allocate the + // entire byte array yet. The size comes directly from the input, so a + // maliciously-crafted message could provide a bogus very large size in + // order to trick the app into allocating a lot of memory. We avoid this + // by allocating and reading only a small chunk at a time, so that the + // malicious message must actually *be* extremely large to cause + // problems. Meanwhile, we limit the allowed size of a message elsewhere. + + // Remember the buffer markers since we'll have to copy the bytes out of + // it later. + final int originalBufferPos = bufferPos; + final int originalBufferSize = bufferSize; + + // Mark the current buffer consumed. + totalBytesRetired += bufferSize; + bufferPos = 0; + bufferSize = 0; + + // Read all the rest of the bytes we need. + int sizeLeft = size - (originalBufferSize - originalBufferPos); + final List chunks = new ArrayList(); + + while (sizeLeft > 0) { + final byte[] chunk = new byte[Math.min(sizeLeft, BUFFER_SIZE)]; + int pos = 0; + while (pos < chunk.length) { + final int n = (input == null) ? -1 : + input.read(chunk, pos, chunk.length - pos); + if (n == -1) { + throw InvalidProtocolBufferException.truncatedMessage(); + } + totalBytesRetired += n; + pos += n; + } + sizeLeft -= chunk.length; + chunks.add(chunk); + } + + // OK, got everything. Now concatenate it all into one buffer. + final byte[] bytes = new byte[size]; + + // Start by copying the leftover bytes from this.buffer. + int pos = originalBufferSize - originalBufferPos; + System.arraycopy(buffer, originalBufferPos, bytes, 0, pos); + + // And now all the chunks. + for (final byte[] chunk : chunks) { + System.arraycopy(chunk, 0, bytes, pos, chunk.length); + pos += chunk.length; + } + + // Done. + return bytes; + } + } + + /** + * Reads and discards {@code size} bytes. + * + * @throws InvalidProtocolBufferException The end of the stream or the current + * limit was reached. + */ + public void skipRawBytes(final int size) throws IOException { + if (size <= (bufferSize - bufferPos) && size >= 0) { + // We have all the bytes we need already. + bufferPos += size; + } else { + skipRawBytesSlowPath(size); + } + } + + /** + * Exactly like skipRawBytes, but caller must have already checked the fast + * path: (size <= (bufferSize - pos) && size >= 0) + */ + private void skipRawBytesSlowPath(final int size) throws IOException { + if (size < 0) { + throw InvalidProtocolBufferException.negativeSize(); + } + + if (totalBytesRetired + bufferPos + size > currentLimit) { + // Read to the end of the stream anyway. + skipRawBytes(currentLimit - totalBytesRetired - bufferPos); + // Then fail. + throw InvalidProtocolBufferException.truncatedMessage(); + } + + // Skipping more bytes than are in the buffer. First skip what we have. + int pos = bufferSize - bufferPos; + bufferPos = bufferSize; + + // Keep refilling the buffer until we get to the point we wanted to skip to. + // This has the side effect of ensuring the limits are updated correctly. + refillBuffer(1); + while (size - pos > bufferSize) { + pos += bufferSize; + bufferPos = bufferSize; + refillBuffer(1); + } + + bufferPos = size - pos; + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/CodedOutputStream.java b/retrofit/src/main/java/com/google/protobuf/CodedOutputStream.java new file mode 100644 index 0000000000..fafe035689 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/CodedOutputStream.java @@ -0,0 +1,1297 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; + +/** + * Encodes and writes protocol message fields. + * + *

This class contains two kinds of methods: methods that write specific + * protocol message constructs and field types (e.g. {@link #writeTag} and + * {@link #writeInt32}) and methods that write low-level values (e.g. + * {@link #writeRawVarint32} and {@link #writeRawBytes}). If you are + * writing encoded protocol messages, you should use the former methods, but if + * you are writing some other format of your own design, use the latter. + * + *

This class is totally unsynchronized. + * + * @author kneton@google.com Kenton Varda + */ +public final class CodedOutputStream { + private final byte[] buffer; + private final int limit; + private int position; + private int totalBytesWritten = 0; + + private final OutputStream output; + + /** + * The buffer size used in {@link #newInstance(OutputStream)}. + */ + public static final int DEFAULT_BUFFER_SIZE = 4096; + + /** + * Returns the buffer size to efficiently write dataLength bytes to this + * CodedOutputStream. Used by AbstractMessageLite. + * + * @return the buffer size to efficiently write dataLength bytes to this + * CodedOutputStream. + */ + static int computePreferredBufferSize(int dataLength) { + if (dataLength > DEFAULT_BUFFER_SIZE) return DEFAULT_BUFFER_SIZE; + return dataLength; + } + + private CodedOutputStream(final byte[] buffer, final int offset, + final int length) { + output = null; + this.buffer = buffer; + position = offset; + limit = offset + length; + } + + private CodedOutputStream(final OutputStream output, final byte[] buffer) { + this.output = output; + this.buffer = buffer; + position = 0; + limit = buffer.length; + } + + /** + * Create a new {@code CodedOutputStream} wrapping the given + * {@code OutputStream}. + */ + public static CodedOutputStream newInstance(final OutputStream output) { + return newInstance(output, DEFAULT_BUFFER_SIZE); + } + + /** + * Create a new {@code CodedOutputStream} wrapping the given + * {@code OutputStream} with a given buffer size. + */ + public static CodedOutputStream newInstance(final OutputStream output, + final int bufferSize) { + return new CodedOutputStream(output, new byte[bufferSize]); + } + + /** + * Create a new {@code CodedOutputStream} that writes directly to the given + * byte array. If more bytes are written than fit in the array, + * {@link OutOfSpaceException} will be thrown. Writing directly to a flat + * array is faster than writing to an {@code OutputStream}. See also + * {@link ByteString#newCodedBuilder}. + */ + public static CodedOutputStream newInstance(final byte[] flatArray) { + return newInstance(flatArray, 0, flatArray.length); + } + + /** + * Create a new {@code CodedOutputStream} that writes directly to the given + * byte array slice. If more bytes are written than fit in the slice, + * {@link OutOfSpaceException} will be thrown. Writing directly to a flat + * array is faster than writing to an {@code OutputStream}. See also + * {@link ByteString#newCodedBuilder}. + */ + public static CodedOutputStream newInstance(final byte[] flatArray, + final int offset, + final int length) { + return new CodedOutputStream(flatArray, offset, length); + } + + /** + * Create a new {@code CodedOutputStream} that writes to the given ByteBuffer. + */ + public static CodedOutputStream newInstance(ByteBuffer byteBuffer) { + return newInstance(byteBuffer, DEFAULT_BUFFER_SIZE); + } + + /** + * Create a new {@code CodedOutputStream} that writes to the given ByteBuffer. + */ + public static CodedOutputStream newInstance(ByteBuffer byteBuffer, + int bufferSize) { + return newInstance(new ByteBufferOutputStream(byteBuffer), bufferSize); + } + + private static class ByteBufferOutputStream extends OutputStream { + private final ByteBuffer byteBuffer; + public ByteBufferOutputStream(ByteBuffer byteBuffer) { + this.byteBuffer = byteBuffer; + } + + @Override + public void write(int b) throws IOException { + byteBuffer.put((byte) b); + } + + @Override + public void write(byte[] data, int offset, int length) throws IOException { + byteBuffer.put(data, offset, length); + } + } + + // ----------------------------------------------------------------- + + /** Write a {@code double} field, including tag, to the stream. */ + public void writeDouble(final int fieldNumber, final double value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64); + writeDoubleNoTag(value); + } + + /** Write a {@code float} field, including tag, to the stream. */ + public void writeFloat(final int fieldNumber, final float value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED32); + writeFloatNoTag(value); + } + + /** Write a {@code uint64} field, including tag, to the stream. */ + public void writeUInt64(final int fieldNumber, final long value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); + writeUInt64NoTag(value); + } + + /** Write an {@code int64} field, including tag, to the stream. */ + public void writeInt64(final int fieldNumber, final long value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); + writeInt64NoTag(value); + } + + /** Write an {@code int32} field, including tag, to the stream. */ + public void writeInt32(final int fieldNumber, final int value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); + writeInt32NoTag(value); + } + + /** Write a {@code fixed64} field, including tag, to the stream. */ + public void writeFixed64(final int fieldNumber, final long value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64); + writeFixed64NoTag(value); + } + + /** Write a {@code fixed32} field, including tag, to the stream. */ + public void writeFixed32(final int fieldNumber, final int value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED32); + writeFixed32NoTag(value); + } + + /** Write a {@code bool} field, including tag, to the stream. */ + public void writeBool(final int fieldNumber, final boolean value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); + writeBoolNoTag(value); + } + + /** Write a {@code string} field, including tag, to the stream. */ + public void writeString(final int fieldNumber, final String value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); + writeStringNoTag(value); + } + + /** Write a {@code group} field, including tag, to the stream. */ + public void writeGroup(final int fieldNumber, final MessageLite value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_START_GROUP); + writeGroupNoTag(value); + writeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP); + } + + + /** + * Write a group represented by an {@link UnknownFieldSet}. + * + * @deprecated UnknownFieldSet now implements MessageLite, so you can just + * call {@link #writeGroup}. + */ + @Deprecated + public void writeUnknownGroup(final int fieldNumber, + final MessageLite value) + throws IOException { + writeGroup(fieldNumber, value); + } + + /** Write an embedded message field, including tag, to the stream. */ + public void writeMessage(final int fieldNumber, final MessageLite value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); + writeMessageNoTag(value); + } + + + /** Write a {@code bytes} field, including tag, to the stream. */ + public void writeBytes(final int fieldNumber, final ByteString value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); + writeBytesNoTag(value); + } + + /** Write a {@code bytes} field, including tag, to the stream. */ + public void writeByteArray(final int fieldNumber, final byte[] value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); + writeByteArrayNoTag(value); + } + + /** Write a {@code bytes} field, including tag, to the stream. */ + public void writeByteArray(final int fieldNumber, + final byte[] value, + final int offset, + final int length) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); + writeByteArrayNoTag(value, offset, length); + } + + /** + * Write a {@code bytes} field, including tag, to the stream. + * This method will write all content of the ByteBuffer regardless of the + * current position and limit (i.e., the number of bytes to be written is + * value.capacity(), not value.remaining()). Furthermore, this method doesn't + * alter the state of the passed-in ByteBuffer. Its position, limit, mark, + * etc. will remain unchanged. If you only want to write the remaining bytes + * of a ByteBuffer, you can call + * {@code writeByteBuffer(fieldNumber, byteBuffer.slice())}. + */ + public void writeByteBuffer(final int fieldNumber, final ByteBuffer value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); + writeByteBufferNoTag(value); + } + + /** Write a {@code uint32} field, including tag, to the stream. */ + public void writeUInt32(final int fieldNumber, final int value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); + writeUInt32NoTag(value); + } + + /** + * Write an enum field, including tag, to the stream. Caller is responsible + * for converting the enum value to its numeric value. + */ + public void writeEnum(final int fieldNumber, final int value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); + writeEnumNoTag(value); + } + + /** Write an {@code sfixed32} field, including tag, to the stream. */ + public void writeSFixed32(final int fieldNumber, final int value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED32); + writeSFixed32NoTag(value); + } + + /** Write an {@code sfixed64} field, including tag, to the stream. */ + public void writeSFixed64(final int fieldNumber, final long value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64); + writeSFixed64NoTag(value); + } + + /** Write an {@code sint32} field, including tag, to the stream. */ + public void writeSInt32(final int fieldNumber, final int value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); + writeSInt32NoTag(value); + } + + /** Write an {@code sint64} field, including tag, to the stream. */ + public void writeSInt64(final int fieldNumber, final long value) + throws IOException { + writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); + writeSInt64NoTag(value); + } + + /** + * Write a MessageSet extension field to the stream. For historical reasons, + * the wire format differs from normal fields. + */ + public void writeMessageSetExtension(final int fieldNumber, + final MessageLite value) + throws IOException { + writeTag(WireFormat.MESSAGE_SET_ITEM, WireFormat.WIRETYPE_START_GROUP); + writeUInt32(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber); + writeMessage(WireFormat.MESSAGE_SET_MESSAGE, value); + writeTag(WireFormat.MESSAGE_SET_ITEM, WireFormat.WIRETYPE_END_GROUP); + } + + /** + * Write an unparsed MessageSet extension field to the stream. For + * historical reasons, the wire format differs from normal fields. + */ + public void writeRawMessageSetExtension(final int fieldNumber, + final ByteString value) + throws IOException { + writeTag(WireFormat.MESSAGE_SET_ITEM, WireFormat.WIRETYPE_START_GROUP); + writeUInt32(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber); + writeBytes(WireFormat.MESSAGE_SET_MESSAGE, value); + writeTag(WireFormat.MESSAGE_SET_ITEM, WireFormat.WIRETYPE_END_GROUP); + } + + // ----------------------------------------------------------------- + + /** Write a {@code double} field to the stream. */ + public void writeDoubleNoTag(final double value) throws IOException { + writeRawLittleEndian64(Double.doubleToRawLongBits(value)); + } + + /** Write a {@code float} field to the stream. */ + public void writeFloatNoTag(final float value) throws IOException { + writeRawLittleEndian32(Float.floatToRawIntBits(value)); + } + + /** Write a {@code uint64} field to the stream. */ + public void writeUInt64NoTag(final long value) throws IOException { + writeRawVarint64(value); + } + + /** Write an {@code int64} field to the stream. */ + public void writeInt64NoTag(final long value) throws IOException { + writeRawVarint64(value); + } + + /** Write an {@code int32} field to the stream. */ + public void writeInt32NoTag(final int value) throws IOException { + if (value >= 0) { + writeRawVarint32(value); + } else { + // Must sign-extend. + writeRawVarint64(value); + } + } + + /** Write a {@code fixed64} field to the stream. */ + public void writeFixed64NoTag(final long value) throws IOException { + writeRawLittleEndian64(value); + } + + /** Write a {@code fixed32} field to the stream. */ + public void writeFixed32NoTag(final int value) throws IOException { + writeRawLittleEndian32(value); + } + + /** Write a {@code bool} field to the stream. */ + public void writeBoolNoTag(final boolean value) throws IOException { + writeRawByte(value ? 1 : 0); + } + + /** Write a {@code string} field to the stream. */ + public void writeStringNoTag(final String value) throws IOException { + // Unfortunately there does not appear to be any way to tell Java to encode + // UTF-8 directly into our buffer, so we have to let it create its own byte + // array and then copy. + final byte[] bytes = value.getBytes("UTF-8"); + writeRawVarint32(bytes.length); + writeRawBytes(bytes); + } + + /** Write a {@code group} field to the stream. */ + public void writeGroupNoTag(final MessageLite value) throws IOException { + value.writeTo(this); + } + + + /** + * Write a group represented by an {@link UnknownFieldSet}. + * + * @deprecated UnknownFieldSet now implements MessageLite, so you can just + * call {@link #writeGroupNoTag}. + */ + @Deprecated + public void writeUnknownGroupNoTag(final MessageLite value) + throws IOException { + writeGroupNoTag(value); + } + + /** Write an embedded message field to the stream. */ + public void writeMessageNoTag(final MessageLite value) throws IOException { + writeRawVarint32(value.getSerializedSize()); + value.writeTo(this); + } + + + /** Write a {@code bytes} field to the stream. */ + public void writeBytesNoTag(final ByteString value) throws IOException { + writeRawVarint32(value.size()); + writeRawBytes(value); + } + + /** Write a {@code bytes} field to the stream. */ + public void writeByteArrayNoTag(final byte[] value) throws IOException { + writeRawVarint32(value.length); + writeRawBytes(value); + } + + /** Write a {@code bytes} field to the stream. */ + public void writeByteArrayNoTag(final byte[] value, + final int offset, + final int length) throws IOException { + writeRawVarint32(length); + writeRawBytes(value, offset, length); + } + + /** + * Write a {@code bytes} field to the stream. This method will write all + * content of the ByteBuffer regardless of the current position and limit + * (i.e., the number of bytes to be written is value.capacity(), not + * value.remaining()). Furthermore, this method doesn't alter the state of + * the passed-in ByteBuffer. Its position, limit, mark, etc. will remain + * unchanged. If you only want to write the remaining bytes of a ByteBuffer, + * you can call {@code writeByteBufferNoTag(byteBuffer.slice())}. + */ + public void writeByteBufferNoTag(final ByteBuffer value) throws IOException { + writeRawVarint32(value.capacity()); + writeRawBytes(value); + } + + /** Write a {@code uint32} field to the stream. */ + public void writeUInt32NoTag(final int value) throws IOException { + writeRawVarint32(value); + } + + /** + * Write an enum field to the stream. Caller is responsible + * for converting the enum value to its numeric value. + */ + public void writeEnumNoTag(final int value) throws IOException { + writeInt32NoTag(value); + } + + /** Write an {@code sfixed32} field to the stream. */ + public void writeSFixed32NoTag(final int value) throws IOException { + writeRawLittleEndian32(value); + } + + /** Write an {@code sfixed64} field to the stream. */ + public void writeSFixed64NoTag(final long value) throws IOException { + writeRawLittleEndian64(value); + } + + /** Write an {@code sint32} field to the stream. */ + public void writeSInt32NoTag(final int value) throws IOException { + writeRawVarint32(encodeZigZag32(value)); + } + + /** Write an {@code sint64} field to the stream. */ + public void writeSInt64NoTag(final long value) throws IOException { + writeRawVarint64(encodeZigZag64(value)); + } + + // ================================================================= + + /** + * Compute the number of bytes that would be needed to encode a + * {@code double} field, including tag. + */ + public static int computeDoubleSize(final int fieldNumber, + final double value) { + return computeTagSize(fieldNumber) + computeDoubleSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code float} field, including tag. + */ + public static int computeFloatSize(final int fieldNumber, final float value) { + return computeTagSize(fieldNumber) + computeFloatSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code uint64} field, including tag. + */ + public static int computeUInt64Size(final int fieldNumber, final long value) { + return computeTagSize(fieldNumber) + computeUInt64SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code int64} field, including tag. + */ + public static int computeInt64Size(final int fieldNumber, final long value) { + return computeTagSize(fieldNumber) + computeInt64SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code int32} field, including tag. + */ + public static int computeInt32Size(final int fieldNumber, final int value) { + return computeTagSize(fieldNumber) + computeInt32SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code fixed64} field, including tag. + */ + public static int computeFixed64Size(final int fieldNumber, + final long value) { + return computeTagSize(fieldNumber) + computeFixed64SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code fixed32} field, including tag. + */ + public static int computeFixed32Size(final int fieldNumber, + final int value) { + return computeTagSize(fieldNumber) + computeFixed32SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code bool} field, including tag. + */ + public static int computeBoolSize(final int fieldNumber, + final boolean value) { + return computeTagSize(fieldNumber) + computeBoolSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code string} field, including tag. + */ + public static int computeStringSize(final int fieldNumber, + final String value) { + return computeTagSize(fieldNumber) + computeStringSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code group} field, including tag. + */ + public static int computeGroupSize(final int fieldNumber, + final MessageLite value) { + return computeTagSize(fieldNumber) * 2 + computeGroupSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code group} field represented by an {@code UnknownFieldSet}, including + * tag. + * + * @deprecated UnknownFieldSet now implements MessageLite, so you can just + * call {@link #computeGroupSize}. + */ + @Deprecated + public static int computeUnknownGroupSize(final int fieldNumber, + final MessageLite value) { + return computeGroupSize(fieldNumber, value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * embedded message field, including tag. + */ + public static int computeMessageSize(final int fieldNumber, + final MessageLite value) { + return computeTagSize(fieldNumber) + computeMessageSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code bytes} field, including tag. + */ + public static int computeBytesSize(final int fieldNumber, + final ByteString value) { + return computeTagSize(fieldNumber) + computeBytesSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code bytes} field, including tag. + */ + public static int computeByteArraySize(final int fieldNumber, + final byte[] value) { + return computeTagSize(fieldNumber) + computeByteArraySizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code bytes} field, including tag. + */ + public static int computeByteBufferSize(final int fieldNumber, + final ByteBuffer value) { + return computeTagSize(fieldNumber) + computeByteBufferSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * embedded message in lazy field, including tag. + */ + public static int computeLazyFieldSize(final int fieldNumber, + final LazyFieldLite value) { + return computeTagSize(fieldNumber) + computeLazyFieldSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code uint32} field, including tag. + */ + public static int computeUInt32Size(final int fieldNumber, final int value) { + return computeTagSize(fieldNumber) + computeUInt32SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * enum field, including tag. Caller is responsible for converting the + * enum value to its numeric value. + */ + public static int computeEnumSize(final int fieldNumber, final int value) { + return computeTagSize(fieldNumber) + computeEnumSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code sfixed32} field, including tag. + */ + public static int computeSFixed32Size(final int fieldNumber, + final int value) { + return computeTagSize(fieldNumber) + computeSFixed32SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code sfixed64} field, including tag. + */ + public static int computeSFixed64Size(final int fieldNumber, + final long value) { + return computeTagSize(fieldNumber) + computeSFixed64SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code sint32} field, including tag. + */ + public static int computeSInt32Size(final int fieldNumber, final int value) { + return computeTagSize(fieldNumber) + computeSInt32SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code sint64} field, including tag. + */ + public static int computeSInt64Size(final int fieldNumber, final long value) { + return computeTagSize(fieldNumber) + computeSInt64SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * MessageSet extension to the stream. For historical reasons, + * the wire format differs from normal fields. + */ + public static int computeMessageSetExtensionSize( + final int fieldNumber, final MessageLite value) { + return computeTagSize(WireFormat.MESSAGE_SET_ITEM) * 2 + + computeUInt32Size(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber) + + computeMessageSize(WireFormat.MESSAGE_SET_MESSAGE, value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * unparsed MessageSet extension field to the stream. For + * historical reasons, the wire format differs from normal fields. + */ + public static int computeRawMessageSetExtensionSize( + final int fieldNumber, final ByteString value) { + return computeTagSize(WireFormat.MESSAGE_SET_ITEM) * 2 + + computeUInt32Size(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber) + + computeBytesSize(WireFormat.MESSAGE_SET_MESSAGE, value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * lazily parsed MessageSet extension field to the stream. For + * historical reasons, the wire format differs from normal fields. + */ + public static int computeLazyFieldMessageSetExtensionSize( + final int fieldNumber, final LazyFieldLite value) { + return computeTagSize(WireFormat.MESSAGE_SET_ITEM) * 2 + + computeUInt32Size(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber) + + computeLazyFieldSize(WireFormat.MESSAGE_SET_MESSAGE, value); + } + + // ----------------------------------------------------------------- + + /** + * Compute the number of bytes that would be needed to encode a + * {@code double} field, including tag. + */ + public static int computeDoubleSizeNoTag(final double value) { + return LITTLE_ENDIAN_64_SIZE; + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code float} field, including tag. + */ + public static int computeFloatSizeNoTag(final float value) { + return LITTLE_ENDIAN_32_SIZE; + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code uint64} field, including tag. + */ + public static int computeUInt64SizeNoTag(final long value) { + return computeRawVarint64Size(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code int64} field, including tag. + */ + public static int computeInt64SizeNoTag(final long value) { + return computeRawVarint64Size(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code int32} field, including tag. + */ + public static int computeInt32SizeNoTag(final int value) { + if (value >= 0) { + return computeRawVarint32Size(value); + } else { + // Must sign-extend. + return 10; + } + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code fixed64} field. + */ + public static int computeFixed64SizeNoTag(final long value) { + return LITTLE_ENDIAN_64_SIZE; + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code fixed32} field. + */ + public static int computeFixed32SizeNoTag(final int value) { + return LITTLE_ENDIAN_32_SIZE; + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code bool} field. + */ + public static int computeBoolSizeNoTag(final boolean value) { + return 1; + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code string} field. + */ + public static int computeStringSizeNoTag(final String value) { + try { + final byte[] bytes = value.getBytes("UTF-8"); + return computeRawVarint32Size(bytes.length) + + bytes.length; + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF-8 not supported.", e); + } + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code group} field. + */ + public static int computeGroupSizeNoTag(final MessageLite value) { + return value.getSerializedSize(); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code group} field represented by an {@code UnknownFieldSet}, including + * tag. + * + * @deprecated UnknownFieldSet now implements MessageLite, so you can just + * call {@link #computeUnknownGroupSizeNoTag}. + */ + @Deprecated + public static int computeUnknownGroupSizeNoTag(final MessageLite value) { + return computeGroupSizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an embedded + * message field. + */ + public static int computeMessageSizeNoTag(final MessageLite value) { + final int size = value.getSerializedSize(); + return computeRawVarint32Size(size) + size; + } + + /** + * Compute the number of bytes that would be needed to encode an embedded + * message stored in lazy field. + */ + public static int computeLazyFieldSizeNoTag(final LazyFieldLite value) { + final int size = value.getSerializedSize(); + return computeRawVarint32Size(size) + size; + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code bytes} field. + */ + public static int computeBytesSizeNoTag(final ByteString value) { + return computeRawVarint32Size(value.size()) + + value.size(); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code bytes} field. + */ + public static int computeByteArraySizeNoTag(final byte[] value) { + return computeRawVarint32Size(value.length) + value.length; + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code bytes} field. + */ + public static int computeByteBufferSizeNoTag(final ByteBuffer value) { + return computeRawVarint32Size(value.capacity()) + value.capacity(); + } + + /** + * Compute the number of bytes that would be needed to encode a + * {@code uint32} field. + */ + public static int computeUInt32SizeNoTag(final int value) { + return computeRawVarint32Size(value); + } + + /** + * Compute the number of bytes that would be needed to encode an enum field. + * Caller is responsible for converting the enum value to its numeric value. + */ + public static int computeEnumSizeNoTag(final int value) { + return computeInt32SizeNoTag(value); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code sfixed32} field. + */ + public static int computeSFixed32SizeNoTag(final int value) { + return LITTLE_ENDIAN_32_SIZE; + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code sfixed64} field. + */ + public static int computeSFixed64SizeNoTag(final long value) { + return LITTLE_ENDIAN_64_SIZE; + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code sint32} field. + */ + public static int computeSInt32SizeNoTag(final int value) { + return computeRawVarint32Size(encodeZigZag32(value)); + } + + /** + * Compute the number of bytes that would be needed to encode an + * {@code sint64} field. + */ + public static int computeSInt64SizeNoTag(final long value) { + return computeRawVarint64Size(encodeZigZag64(value)); + } + + // ================================================================= + + /** + * Internal helper that writes the current buffer to the output. The + * buffer position is reset to its initial value when this returns. + */ + private void refreshBuffer() throws IOException { + if (output == null) { + // We're writing to a single buffer. + throw new OutOfSpaceException(); + } + + // Since we have an output stream, this is our buffer + // and buffer offset == 0 + output.write(buffer, 0, position); + position = 0; + } + + /** + * Flushes the stream and forces any buffered bytes to be written. This + * does not flush the underlying OutputStream. + */ + public void flush() throws IOException { + if (output != null) { + refreshBuffer(); + } + } + + /** + * If writing to a flat array, return the space left in the array. + * Otherwise, throws {@code UnsupportedOperationException}. + */ + public int spaceLeft() { + if (output == null) { + return limit - position; + } else { + throw new UnsupportedOperationException( + "spaceLeft() can only be called on CodedOutputStreams that are " + + "writing to a flat array."); + } + } + + /** + * Verifies that {@link #spaceLeft()} returns zero. It's common to create + * a byte array that is exactly big enough to hold a message, then write to + * it with a {@code CodedOutputStream}. Calling {@code checkNoSpaceLeft()} + * after writing verifies that the message was actually as big as expected, + * which can help catch bugs. + */ + public void checkNoSpaceLeft() { + if (spaceLeft() != 0) { + throw new IllegalStateException( + "Did not write as much data as expected."); + } + } + + /** + * If you create a CodedOutputStream around a simple flat array, you must + * not attempt to write more bytes than the array has space. Otherwise, + * this exception will be thrown. + */ + public static class OutOfSpaceException extends IOException { + private static final long serialVersionUID = -6947486886997889499L; + + OutOfSpaceException() { + super("CodedOutputStream was writing to a flat byte array and ran " + + "out of space."); + } + } + + /** + * Get the total number of bytes successfully written to this stream. The + * returned value is not guaranteed to be accurate if exceptions have been + * found in the middle of writing. + */ + public int getTotalBytesWritten() { + return totalBytesWritten; + } + + /** Write a single byte. */ + public void writeRawByte(final byte value) throws IOException { + if (position == limit) { + refreshBuffer(); + } + + buffer[position++] = value; + ++totalBytesWritten; + } + + /** Write a single byte, represented by an integer value. */ + public void writeRawByte(final int value) throws IOException { + writeRawByte((byte) value); + } + + /** Write a byte string. */ + public void writeRawBytes(final ByteString value) throws IOException { + writeRawBytes(value, 0, value.size()); + } + + /** Write an array of bytes. */ + public void writeRawBytes(final byte[] value) throws IOException { + writeRawBytes(value, 0, value.length); + } + + /** + * Write a ByteBuffer. This method will write all content of the ByteBuffer + * regardless of the current position and limit (i.e., the number of bytes + * to be written is value.capacity(), not value.remaining()). Furthermore, + * this method doesn't alter the state of the passed-in ByteBuffer. Its + * position, limit, mark, etc. will remain unchanged. If you only want to + * write the remaining bytes of a ByteBuffer, you can call + * {@code writeRawBytes(byteBuffer.slice())}. + */ + public void writeRawBytes(final ByteBuffer value) throws IOException { + if (value.hasArray()) { + writeRawBytes(value.array(), value.arrayOffset(), value.capacity()); + } else { + ByteBuffer duplicated = value.duplicate(); + duplicated.clear(); + writeRawBytesInternal(duplicated); + } + } + + /** Write a ByteBuffer that isn't backed by an array. */ + private void writeRawBytesInternal(final ByteBuffer value) + throws IOException { + int length = value.remaining(); + if (limit - position >= length) { + // We have room in the current buffer. + value.get(buffer, position, length); + position += length; + totalBytesWritten += length; + } else { + // Write extends past current buffer. Fill the rest of this buffer and + // flush. + final int bytesWritten = limit - position; + value.get(buffer, position, bytesWritten); + length -= bytesWritten; + position = limit; + totalBytesWritten += bytesWritten; + refreshBuffer(); + + // Now deal with the rest. + // Since we have an output stream, this is our buffer + // and buffer offset == 0 + while (length > limit) { + // Copy data into the buffer before writing it to OutputStream. + // TODO(xiaofeng): Introduce ZeroCopyOutputStream to avoid this copy. + value.get(buffer, 0, limit); + output.write(buffer, 0, limit); + length -= limit; + totalBytesWritten += limit; + } + value.get(buffer, 0, length); + position = length; + totalBytesWritten += length; + } + } + + /** Write part of an array of bytes. */ + public void writeRawBytes(final byte[] value, int offset, int length) + throws IOException { + if (limit - position >= length) { + // We have room in the current buffer. + System.arraycopy(value, offset, buffer, position, length); + position += length; + totalBytesWritten += length; + } else { + // Write extends past current buffer. Fill the rest of this buffer and + // flush. + final int bytesWritten = limit - position; + System.arraycopy(value, offset, buffer, position, bytesWritten); + offset += bytesWritten; + length -= bytesWritten; + position = limit; + totalBytesWritten += bytesWritten; + refreshBuffer(); + + // Now deal with the rest. + // Since we have an output stream, this is our buffer + // and buffer offset == 0 + if (length <= limit) { + // Fits in new buffer. + System.arraycopy(value, offset, buffer, 0, length); + position = length; + } else { + // Write is very big. Let's do it all at once. + output.write(value, offset, length); + } + totalBytesWritten += length; + } + } + + /** Write part of a byte string. */ + public void writeRawBytes(final ByteString value, int offset, int length) + throws IOException { + if (limit - position >= length) { + // We have room in the current buffer. + value.copyTo(buffer, offset, position, length); + position += length; + totalBytesWritten += length; + } else { + // Write extends past current buffer. Fill the rest of this buffer and + // flush. + final int bytesWritten = limit - position; + value.copyTo(buffer, offset, position, bytesWritten); + offset += bytesWritten; + length -= bytesWritten; + position = limit; + totalBytesWritten += bytesWritten; + refreshBuffer(); + + // Now deal with the rest. + // Since we have an output stream, this is our buffer + // and buffer offset == 0 + if (length <= limit) { + // Fits in new buffer. + value.copyTo(buffer, offset, 0, length); + position = length; + } else { + value.writeTo(output, offset, length); + } + totalBytesWritten += length; + } + } + + /** Encode and write a tag. */ + public void writeTag(final int fieldNumber, final int wireType) + throws IOException { + writeRawVarint32(WireFormat.makeTag(fieldNumber, wireType)); + } + + /** Compute the number of bytes that would be needed to encode a tag. */ + public static int computeTagSize(final int fieldNumber) { + return computeRawVarint32Size(WireFormat.makeTag(fieldNumber, 0)); + } + + /** + * Encode and write a varint. {@code value} is treated as + * unsigned, so it won't be sign-extended if negative. + */ + public void writeRawVarint32(int value) throws IOException { + while (true) { + if ((value & ~0x7F) == 0) { + writeRawByte(value); + return; + } else { + writeRawByte((value & 0x7F) | 0x80); + value >>>= 7; + } + } + } + + /** + * Compute the number of bytes that would be needed to encode a varint. + * {@code value} is treated as unsigned, so it won't be sign-extended if + * negative. + */ + public static int computeRawVarint32Size(final int value) { + if ((value & (0xffffffff << 7)) == 0) return 1; + if ((value & (0xffffffff << 14)) == 0) return 2; + if ((value & (0xffffffff << 21)) == 0) return 3; + if ((value & (0xffffffff << 28)) == 0) return 4; + return 5; + } + + /** Encode and write a varint. */ + public void writeRawVarint64(long value) throws IOException { + while (true) { + if ((value & ~0x7FL) == 0) { + writeRawByte((int)value); + return; + } else { + writeRawByte(((int)value & 0x7F) | 0x80); + value >>>= 7; + } + } + } + + /** Compute the number of bytes that would be needed to encode a varint. */ + public static int computeRawVarint64Size(final long value) { + if ((value & (0xffffffffffffffffL << 7)) == 0) return 1; + if ((value & (0xffffffffffffffffL << 14)) == 0) return 2; + if ((value & (0xffffffffffffffffL << 21)) == 0) return 3; + if ((value & (0xffffffffffffffffL << 28)) == 0) return 4; + if ((value & (0xffffffffffffffffL << 35)) == 0) return 5; + if ((value & (0xffffffffffffffffL << 42)) == 0) return 6; + if ((value & (0xffffffffffffffffL << 49)) == 0) return 7; + if ((value & (0xffffffffffffffffL << 56)) == 0) return 8; + if ((value & (0xffffffffffffffffL << 63)) == 0) return 9; + return 10; + } + + /** Write a little-endian 32-bit integer. */ + public void writeRawLittleEndian32(final int value) throws IOException { + writeRawByte((value ) & 0xFF); + writeRawByte((value >> 8) & 0xFF); + writeRawByte((value >> 16) & 0xFF); + writeRawByte((value >> 24) & 0xFF); + } + + public static final int LITTLE_ENDIAN_32_SIZE = 4; + + /** Write a little-endian 64-bit integer. */ + public void writeRawLittleEndian64(final long value) throws IOException { + writeRawByte((int)(value ) & 0xFF); + writeRawByte((int)(value >> 8) & 0xFF); + writeRawByte((int)(value >> 16) & 0xFF); + writeRawByte((int)(value >> 24) & 0xFF); + writeRawByte((int)(value >> 32) & 0xFF); + writeRawByte((int)(value >> 40) & 0xFF); + writeRawByte((int)(value >> 48) & 0xFF); + writeRawByte((int)(value >> 56) & 0xFF); + } + + public static final int LITTLE_ENDIAN_64_SIZE = 8; + + /** + * Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers + * into values that can be efficiently encoded with varint. (Otherwise, + * negative values must be sign-extended to 64 bits to be varint encoded, + * thus always taking 10 bytes on the wire.) + * + * @param n A signed 32-bit integer. + * @return An unsigned 32-bit integer, stored in a signed int because + * Java has no explicit unsigned support. + */ + public static int encodeZigZag32(final int n) { + // Note: the right-shift must be arithmetic + return (n << 1) ^ (n >> 31); + } + + /** + * Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers + * into values that can be efficiently encoded with varint. (Otherwise, + * negative values must be sign-extended to 64 bits to be varint encoded, + * thus always taking 10 bytes on the wire.) + * + * @param n A signed 64-bit integer. + * @return An unsigned 64-bit integer, stored in a signed int because + * Java has no explicit unsigned support. + */ + public static long encodeZigZag64(final long n) { + // Note: the right-shift must be arithmetic + return (n << 1) ^ (n >> 63); + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/ExtensionRegistryLite.java b/retrofit/src/main/java/com/google/protobuf/ExtensionRegistryLite.java new file mode 100644 index 0000000000..a941fc4bb5 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/ExtensionRegistryLite.java @@ -0,0 +1,186 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * Equivalent to {@link ExtensionRegistry} but supports only "lite" types. + *

+ * If all of your types are lite types, then you only need to use + * {@code ExtensionRegistryLite}. Similarly, if all your types are regular + * types, then you only need {@link ExtensionRegistry}. Typically it does not + * make sense to mix the two, since if you have any regular types in your + * program, you then require the full runtime and lose all the benefits of + * the lite runtime, so you might as well make all your types be regular types. + * However, in some cases (e.g. when depending on multiple third-party libraries + * where one uses lite types and one uses regular), you may find yourself + * wanting to mix the two. In this case things get more complicated. + *

+ * There are three factors to consider: Whether the type being extended is + * lite, whether the embedded type (in the case of a message-typed extension) + * is lite, and whether the extension itself is lite. Since all three are + * declared in different files, they could all be different. Here are all + * the combinations and which type of registry to use: + *

+ *   Extended type     Inner type    Extension         Use registry
+ *   =======================================================================
+ *   lite              lite          lite              ExtensionRegistryLite
+ *   lite              regular       lite              ExtensionRegistry
+ *   regular           regular       regular           ExtensionRegistry
+ *   all other combinations                            not supported
+ * 
+ *

+ * Note that just as regular types are not allowed to contain lite-type fields, + * they are also not allowed to contain lite-type extensions. This is because + * regular types must be fully accessible via reflection, which in turn means + * that all the inner messages must also support reflection. On the other hand, + * since regular types implement the entire lite interface, there is no problem + * with embedding regular types inside lite types. + * + * @author kenton@google.com Kenton Varda + */ +public class ExtensionRegistryLite { + + // Set true to enable lazy parsing feature for MessageSet. + // + // TODO(xiangl): Now we use a global flag to control whether enable lazy + // parsing feature for MessageSet, which may be too crude for some + // applications. Need to support this feature on smaller granularity. + private static volatile boolean eagerlyParseMessageSets = false; + + public static boolean isEagerlyParseMessageSets() { + return eagerlyParseMessageSets; + } + + public static void setEagerlyParseMessageSets(boolean isEagerlyParse) { + eagerlyParseMessageSets = isEagerlyParse; + } + + /** Construct a new, empty instance. */ + public static ExtensionRegistryLite newInstance() { + return new ExtensionRegistryLite(); + } + + /** Get the unmodifiable singleton empty instance. */ + public static ExtensionRegistryLite getEmptyRegistry() { + return EMPTY; + } + + /** Returns an unmodifiable view of the registry. */ + public ExtensionRegistryLite getUnmodifiable() { + return new ExtensionRegistryLite(this); + } + + /** + * Find an extension by containing type and field number. + * + * @return Information about the extension if found, or {@code null} + * otherwise. + */ + @SuppressWarnings("unchecked") + public + GeneratedMessageLite.GeneratedExtension + findLiteExtensionByNumber( + final ContainingType containingTypeDefaultInstance, + final int fieldNumber) { + return (GeneratedMessageLite.GeneratedExtension) + extensionsByNumber.get( + new ObjectIntPair(containingTypeDefaultInstance, fieldNumber)); + } + + /** Add an extension from a lite generated file to the registry. */ + public final void add( + final GeneratedMessageLite.GeneratedExtension extension) { + extensionsByNumber.put( + new ObjectIntPair(extension.getContainingTypeDefaultInstance(), + extension.getNumber()), + extension); + } + + // ================================================================= + // Private stuff. + + // Constructors are package-private so that ExtensionRegistry can subclass + // this. + + ExtensionRegistryLite() { + this.extensionsByNumber = + new HashMap>(); + } + + ExtensionRegistryLite(ExtensionRegistryLite other) { + if (other == EMPTY) { + this.extensionsByNumber = Collections.emptyMap(); + } else { + this.extensionsByNumber = + Collections.unmodifiableMap(other.extensionsByNumber); + } + } + + private final Map> + extensionsByNumber; + + @SuppressWarnings("UnusedVariable") + private ExtensionRegistryLite(boolean empty) { + this.extensionsByNumber = Collections.emptyMap(); + } + private static final ExtensionRegistryLite EMPTY = + new ExtensionRegistryLite(true); + + /** A (Object, int) pair, used as a map key. */ + private static final class ObjectIntPair { + private final Object object; + private final int number; + + ObjectIntPair(final Object object, final int number) { + this.object = object; + this.number = number; + } + + @Override + public int hashCode() { + return System.identityHashCode(object) * ((1 << 16) - 1) + number; + } + @Override + public boolean equals(final Object obj) { + if (!(obj instanceof ObjectIntPair)) { + return false; + } + final ObjectIntPair other = (ObjectIntPair)obj; + return object == other.object && number == other.number; + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/FieldSet.java b/retrofit/src/main/java/com/google/protobuf/FieldSet.java new file mode 100644 index 0000000000..392f4efc20 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/FieldSet.java @@ -0,0 +1,907 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import com.google.protobuf.LazyField.LazyIterator; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * A class which represents an arbitrary set of fields of some message type. + * This is used to implement {@link DynamicMessage}, and also to represent + * extensions in {@link GeneratedMessage}. This class is package-private, + * since outside users should probably be using {@link DynamicMessage}. + * + * @author kenton@google.com Kenton Varda + */ +final class FieldSet> { + /** + * Interface for a FieldDescriptor or lite extension descriptor. This + * prevents FieldSet from depending on {@link Descriptors.FieldDescriptor}. + */ + public interface FieldDescriptorLite> + extends Comparable { + int getNumber(); + WireFormat.FieldType getLiteType(); + WireFormat.JavaType getLiteJavaType(); + boolean isRepeated(); + boolean isPacked(); + Internal.EnumLiteMap getEnumType(); + + // If getLiteJavaType() == MESSAGE, this merges a message object of the + // type into a builder of the type. Returns {@code to}. + MessageLite.Builder internalMergeFrom( + MessageLite.Builder to, MessageLite from); + } + + private final SmallSortedMap fields; + private boolean isImmutable; + private boolean hasLazyField = false; + + /** Construct a new FieldSet. */ + private FieldSet() { + this.fields = SmallSortedMap.newFieldMap(16); + } + + /** + * Construct an empty FieldSet. This is only used to initialize + * DEFAULT_INSTANCE. + */ + private FieldSet(final boolean dummy) { + this.fields = SmallSortedMap.newFieldMap(0); + makeImmutable(); + } + + /** Construct a new FieldSet. */ + public static > + FieldSet newFieldSet() { + return new FieldSet(); + } + + /** Get an immutable empty FieldSet. */ + @SuppressWarnings("unchecked") + public static > + FieldSet emptySet() { + return DEFAULT_INSTANCE; + } + @SuppressWarnings("rawtypes") + private static final FieldSet DEFAULT_INSTANCE = new FieldSet(true); + + /** Make this FieldSet immutable from this point forward. */ + @SuppressWarnings("unchecked") + public void makeImmutable() { + if (isImmutable) { + return; + } + fields.makeImmutable(); + isImmutable = true; + } + + /** + * Returns whether the FieldSet is immutable. This is true if it is the + * {@link #emptySet} or if {@link #makeImmutable} were called. + * + * @return whether the FieldSet is immutable. + */ + public boolean isImmutable() { + return isImmutable; + } + + /** + * Clones the FieldSet. The returned FieldSet will be mutable even if the + * original FieldSet was immutable. + * + * @return the newly cloned FieldSet + */ + @Override + public FieldSet clone() { + // We can't just call fields.clone because List objects in the map + // should not be shared. + FieldSet clone = FieldSet.newFieldSet(); + for (int i = 0; i < fields.getNumArrayEntries(); i++) { + Map.Entry entry = fields.getArrayEntryAt(i); + FieldDescriptorType descriptor = entry.getKey(); + clone.setField(descriptor, entry.getValue()); + } + for (Map.Entry entry : + fields.getOverflowEntries()) { + FieldDescriptorType descriptor = entry.getKey(); + clone.setField(descriptor, entry.getValue()); + } + clone.hasLazyField = hasLazyField; + return clone; + } + + + // ================================================================= + + /** See {@link Message.Builder#clear()}. */ + public void clear() { + fields.clear(); + hasLazyField = false; + } + + /** + * Get a simple map containing all the fields. + */ + public Map getAllFields() { + if (hasLazyField) { + SmallSortedMap result = + SmallSortedMap.newFieldMap(16); + for (int i = 0; i < fields.getNumArrayEntries(); i++) { + cloneFieldEntry(result, fields.getArrayEntryAt(i)); + } + for (Map.Entry entry : + fields.getOverflowEntries()) { + cloneFieldEntry(result, entry); + } + if (fields.isImmutable()) { + result.makeImmutable(); + } + return result; + } + return fields.isImmutable() ? fields : Collections.unmodifiableMap(fields); + } + + private void cloneFieldEntry(Map map, + Map.Entry entry) { + FieldDescriptorType key = entry.getKey(); + Object value = entry.getValue(); + if (value instanceof LazyField) { + map.put(key, ((LazyField) value).getValue()); + } else { + map.put(key, value); + } + } + + /** + * Get an iterator to the field map. This iterator should not be leaked out + * of the protobuf library as it is not protected from mutation when fields + * is not immutable. + */ + public Iterator> iterator() { + if (hasLazyField) { + return new LazyIterator( + fields.entrySet().iterator()); + } + return fields.entrySet().iterator(); + } + + /** + * Useful for implementing + * {@link Message#hasField(Descriptors.FieldDescriptor)}. + */ + public boolean hasField(final FieldDescriptorType descriptor) { + if (descriptor.isRepeated()) { + throw new IllegalArgumentException( + "hasField() can only be called on non-repeated fields."); + } + + return fields.get(descriptor) != null; + } + + /** + * Useful for implementing + * {@link Message#getField(Descriptors.FieldDescriptor)}. This method + * returns {@code null} if the field is not set; in this case it is up + * to the caller to fetch the field's default value. + */ + public Object getField(final FieldDescriptorType descriptor) { + Object o = fields.get(descriptor); + if (o instanceof LazyField) { + return ((LazyField) o).getValue(); + } + return o; + } + + /** + * Useful for implementing + * {@link Message.Builder#setField(Descriptors.FieldDescriptor,Object)}. + */ + @SuppressWarnings({"unchecked", "rawtypes"}) + public void setField(final FieldDescriptorType descriptor, + Object value) { + if (descriptor.isRepeated()) { + if (!(value instanceof List)) { + throw new IllegalArgumentException( + "Wrong object type used with protocol message reflection."); + } + + // Wrap the contents in a new list so that the caller cannot change + // the list's contents after setting it. + final List newList = new ArrayList(); + newList.addAll((List) value); + for (final Object element : newList) { + verifyType(descriptor.getLiteType(), element); + } + value = newList; + } else { + verifyType(descriptor.getLiteType(), value); + } + + if (value instanceof LazyField) { + hasLazyField = true; + } + fields.put(descriptor, value); + } + + /** + * Useful for implementing + * {@link Message.Builder#clearField(Descriptors.FieldDescriptor)}. + */ + public void clearField(final FieldDescriptorType descriptor) { + fields.remove(descriptor); + if (fields.isEmpty()) { + hasLazyField = false; + } + } + + /** + * Useful for implementing + * {@link Message#getRepeatedFieldCount(Descriptors.FieldDescriptor)}. + */ + public int getRepeatedFieldCount(final FieldDescriptorType descriptor) { + if (!descriptor.isRepeated()) { + throw new IllegalArgumentException( + "getRepeatedField() can only be called on repeated fields."); + } + + final Object value = getField(descriptor); + if (value == null) { + return 0; + } else { + return ((List) value).size(); + } + } + + /** + * Useful for implementing + * {@link Message#getRepeatedField(Descriptors.FieldDescriptor,int)}. + */ + public Object getRepeatedField(final FieldDescriptorType descriptor, + final int index) { + if (!descriptor.isRepeated()) { + throw new IllegalArgumentException( + "getRepeatedField() can only be called on repeated fields."); + } + + final Object value = getField(descriptor); + + if (value == null) { + throw new IndexOutOfBoundsException(); + } else { + return ((List) value).get(index); + } + } + + /** + * Useful for implementing + * {@link Message.Builder#setRepeatedField(Descriptors.FieldDescriptor,int,Object)}. + */ + @SuppressWarnings("unchecked") + public void setRepeatedField(final FieldDescriptorType descriptor, + final int index, + final Object value) { + if (!descriptor.isRepeated()) { + throw new IllegalArgumentException( + "getRepeatedField() can only be called on repeated fields."); + } + + final Object list = getField(descriptor); + if (list == null) { + throw new IndexOutOfBoundsException(); + } + + verifyType(descriptor.getLiteType(), value); + ((List) list).set(index, value); + } + + /** + * Useful for implementing + * {@link Message.Builder#addRepeatedField(Descriptors.FieldDescriptor,Object)}. + */ + @SuppressWarnings("unchecked") + public void addRepeatedField(final FieldDescriptorType descriptor, + final Object value) { + if (!descriptor.isRepeated()) { + throw new IllegalArgumentException( + "addRepeatedField() can only be called on repeated fields."); + } + + verifyType(descriptor.getLiteType(), value); + + final Object existingValue = getField(descriptor); + List list; + if (existingValue == null) { + list = new ArrayList(); + fields.put(descriptor, list); + } else { + list = (List) existingValue; + } + + list.add(value); + } + + /** + * Verifies that the given object is of the correct type to be a valid + * value for the given field. (For repeated fields, this checks if the + * object is the right type to be one element of the field.) + * + * @throws IllegalArgumentException The value is not of the right type. + */ + private static void verifyType(final WireFormat.FieldType type, + final Object value) { + if (value == null) { + throw new NullPointerException(); + } + + boolean isValid = false; + switch (type.getJavaType()) { + case INT: isValid = value instanceof Integer ; break; + case LONG: isValid = value instanceof Long ; break; + case FLOAT: isValid = value instanceof Float ; break; + case DOUBLE: isValid = value instanceof Double ; break; + case BOOLEAN: isValid = value instanceof Boolean ; break; + case STRING: isValid = value instanceof String ; break; + case BYTE_STRING: + isValid = value instanceof ByteString || value instanceof byte[]; + break; + case ENUM: + // TODO(kenton): Caller must do type checking here, I guess. + isValid = + (value instanceof Integer || value instanceof Internal.EnumLite); + break; + case MESSAGE: + // TODO(kenton): Caller must do type checking here, I guess. + isValid = + (value instanceof MessageLite) || (value instanceof LazyField); + break; + } + + if (!isValid) { + // TODO(kenton): When chaining calls to setField(), it can be hard to + // tell from the stack trace which exact call failed, since the whole + // chain is considered one line of code. It would be nice to print + // more information here, e.g. naming the field. We used to do that. + // But we can't now that FieldSet doesn't use descriptors. Maybe this + // isn't a big deal, though, since it would only really apply when using + // reflection and generally people don't chain reflection setters. + throw new IllegalArgumentException( + "Wrong object type used with protocol message reflection."); + } + } + + // ================================================================= + // Parsing and serialization + + /** + * See {@link Message#isInitialized()}. Note: Since {@code FieldSet} + * itself does not have any way of knowing about required fields that + * aren't actually present in the set, it is up to the caller to check + * that all required fields are present. + */ + public boolean isInitialized() { + for (int i = 0; i < fields.getNumArrayEntries(); i++) { + if (!isInitialized(fields.getArrayEntryAt(i))) { + return false; + } + } + for (final Map.Entry entry : + fields.getOverflowEntries()) { + if (!isInitialized(entry)) { + return false; + } + } + return true; + } + + @SuppressWarnings("unchecked") + private boolean isInitialized( + final Map.Entry entry) { + final FieldDescriptorType descriptor = entry.getKey(); + if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE) { + if (descriptor.isRepeated()) { + for (final MessageLite element: + (List) entry.getValue()) { + if (!element.isInitialized()) { + return false; + } + } + } else { + Object value = entry.getValue(); + if (value instanceof MessageLite) { + if (!((MessageLite) value).isInitialized()) { + return false; + } + } else if (value instanceof LazyField) { + return true; + } else { + throw new IllegalArgumentException( + "Wrong object type used with protocol message reflection."); + } + } + } + return true; + } + + /** + * Given a field type, return the wire type. + * + * @returns One of the {@code WIRETYPE_} constants defined in + * {@link WireFormat}. + */ + static int getWireFormatForFieldType(final WireFormat.FieldType type, + boolean isPacked) { + if (isPacked) { + return WireFormat.WIRETYPE_LENGTH_DELIMITED; + } else { + return type.getWireType(); + } + } + + /** + * Like {@link Message.Builder#mergeFrom(Message)}, but merges from another + * {@link FieldSet}. + */ + public void mergeFrom(final FieldSet other) { + for (int i = 0; i < other.fields.getNumArrayEntries(); i++) { + mergeFromField(other.fields.getArrayEntryAt(i)); + } + for (final Map.Entry entry : + other.fields.getOverflowEntries()) { + mergeFromField(entry); + } + } + + private Object cloneIfMutable(Object value) { + if (value instanceof byte[]) { + byte[] bytes = (byte[]) value; + byte[] copy = new byte[bytes.length]; + System.arraycopy(bytes, 0, copy, 0, bytes.length); + return copy; + } else { + return value; + } + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + private void mergeFromField( + final Map.Entry entry) { + final FieldDescriptorType descriptor = entry.getKey(); + Object otherValue = entry.getValue(); + if (otherValue instanceof LazyField) { + otherValue = ((LazyField) otherValue).getValue(); + } + + if (descriptor.isRepeated()) { + Object value = getField(descriptor); + if (value == null) { + value = new ArrayList(); + } + for (Object element : (List) otherValue) { + ((List) value).add(cloneIfMutable(element)); + } + fields.put(descriptor, value); + } else if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE) { + Object value = getField(descriptor); + if (value == null) { + fields.put(descriptor, cloneIfMutable(otherValue)); + } else { + // Merge the messages. + value = descriptor.internalMergeFrom( + ((MessageLite) value).toBuilder(), (MessageLite) otherValue) + .build(); + + fields.put(descriptor, value); + } + } else { + fields.put(descriptor, cloneIfMutable(otherValue)); + } + } + + // TODO(kenton): Move static parsing and serialization methods into some + // other class. Probably WireFormat. + + /** + * Read a field of any primitive type for immutable messages from a + * CodedInputStream. Enums, groups, and embedded messages are not handled by + * this method. + * + * @param input The stream from which to read. + * @param type Declared type of the field. + * @param checkUtf8 When true, check that the input is valid utf8. + * @return An object representing the field's value, of the exact + * type which would be returned by + * {@link Message#getField(Descriptors.FieldDescriptor)} for + * this field. + */ + public static Object readPrimitiveField( + CodedInputStream input, + final WireFormat.FieldType type, + boolean checkUtf8) throws IOException { + switch (type) { + case DOUBLE : return input.readDouble (); + case FLOAT : return input.readFloat (); + case INT64 : return input.readInt64 (); + case UINT64 : return input.readUInt64 (); + case INT32 : return input.readInt32 (); + case FIXED64 : return input.readFixed64 (); + case FIXED32 : return input.readFixed32 (); + case BOOL : return input.readBool (); + case STRING : if (checkUtf8) { + return input.readStringRequireUtf8(); + } else { + return input.readString(); + } + case BYTES : return input.readBytes (); + case UINT32 : return input.readUInt32 (); + case SFIXED32: return input.readSFixed32(); + case SFIXED64: return input.readSFixed64(); + case SINT32 : return input.readSInt32 (); + case SINT64 : return input.readSInt64 (); + + case GROUP: + throw new IllegalArgumentException( + "readPrimitiveField() cannot handle nested groups."); + case MESSAGE: + throw new IllegalArgumentException( + "readPrimitiveField() cannot handle embedded messages."); + case ENUM: + // We don't handle enums because we don't know what to do if the + // value is not recognized. + throw new IllegalArgumentException( + "readPrimitiveField() cannot handle enums."); + } + + throw new RuntimeException( + "There is no way to get here, but the compiler thinks otherwise."); + } + + + /** See {@link Message#writeTo(CodedOutputStream)}. */ + public void writeTo(final CodedOutputStream output) + throws IOException { + for (int i = 0; i < fields.getNumArrayEntries(); i++) { + final Map.Entry entry = + fields.getArrayEntryAt(i); + writeField(entry.getKey(), entry.getValue(), output); + } + for (final Map.Entry entry : + fields.getOverflowEntries()) { + writeField(entry.getKey(), entry.getValue(), output); + } + } + + /** + * Like {@link #writeTo} but uses MessageSet wire format. + */ + public void writeMessageSetTo(final CodedOutputStream output) + throws IOException { + for (int i = 0; i < fields.getNumArrayEntries(); i++) { + writeMessageSetTo(fields.getArrayEntryAt(i), output); + } + for (final Map.Entry entry : + fields.getOverflowEntries()) { + writeMessageSetTo(entry, output); + } + } + + private void writeMessageSetTo( + final Map.Entry entry, + final CodedOutputStream output) throws IOException { + final FieldDescriptorType descriptor = entry.getKey(); + if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE && + !descriptor.isRepeated() && !descriptor.isPacked()) { + Object value = entry.getValue(); + if (value instanceof LazyField) { + value = ((LazyField) value).getValue(); + } + output.writeMessageSetExtension(entry.getKey().getNumber(), + (MessageLite) value); + } else { + writeField(descriptor, entry.getValue(), output); + } + } + + /** + * Write a single tag-value pair to the stream. + * + * @param output The output stream. + * @param type The field's type. + * @param number The field's number. + * @param value Object representing the field's value. Must be of the exact + * type which would be returned by + * {@link Message#getField(Descriptors.FieldDescriptor)} for + * this field. + */ + private static void writeElement(final CodedOutputStream output, + final WireFormat.FieldType type, + final int number, + final Object value) throws IOException { + // Special case for groups, which need a start and end tag; other fields + // can just use writeTag() and writeFieldNoTag(). + if (type == WireFormat.FieldType.GROUP) { + output.writeGroup(number, (MessageLite) value); + } else { + output.writeTag(number, getWireFormatForFieldType(type, false)); + writeElementNoTag(output, type, value); + } + } + + /** + * Write a field of arbitrary type, without its tag, to the stream. + * + * @param output The output stream. + * @param type The field's type. + * @param value Object representing the field's value. Must be of the exact + * type which would be returned by + * {@link Message#getField(Descriptors.FieldDescriptor)} for + * this field. + */ + private static void writeElementNoTag( + final CodedOutputStream output, + final WireFormat.FieldType type, + final Object value) throws IOException { + switch (type) { + case DOUBLE : output.writeDoubleNoTag ((Double ) value); break; + case FLOAT : output.writeFloatNoTag ((Float ) value); break; + case INT64 : output.writeInt64NoTag ((Long ) value); break; + case UINT64 : output.writeUInt64NoTag ((Long ) value); break; + case INT32 : output.writeInt32NoTag ((Integer ) value); break; + case FIXED64 : output.writeFixed64NoTag ((Long ) value); break; + case FIXED32 : output.writeFixed32NoTag ((Integer ) value); break; + case BOOL : output.writeBoolNoTag ((Boolean ) value); break; + case STRING : output.writeStringNoTag ((String ) value); break; + case GROUP : output.writeGroupNoTag ((MessageLite) value); break; + case MESSAGE : output.writeMessageNoTag ((MessageLite) value); break; + case BYTES: + if (value instanceof ByteString) { + output.writeBytesNoTag((ByteString) value); + } else { + output.writeByteArrayNoTag((byte[]) value); + } + break; + case UINT32 : output.writeUInt32NoTag ((Integer ) value); break; + case SFIXED32: output.writeSFixed32NoTag((Integer ) value); break; + case SFIXED64: output.writeSFixed64NoTag((Long ) value); break; + case SINT32 : output.writeSInt32NoTag ((Integer ) value); break; + case SINT64 : output.writeSInt64NoTag ((Long ) value); break; + + case ENUM: + if (value instanceof Internal.EnumLite) { + output.writeEnumNoTag(((Internal.EnumLite) value).getNumber()); + } else { + output.writeEnumNoTag(((Integer) value).intValue()); + } + break; + } + } + + /** Write a single field. */ + public static void writeField(final FieldDescriptorLite descriptor, + final Object value, + final CodedOutputStream output) + throws IOException { + WireFormat.FieldType type = descriptor.getLiteType(); + int number = descriptor.getNumber(); + if (descriptor.isRepeated()) { + final List valueList = (List)value; + if (descriptor.isPacked()) { + output.writeTag(number, WireFormat.WIRETYPE_LENGTH_DELIMITED); + // Compute the total data size so the length can be written. + int dataSize = 0; + for (final Object element : valueList) { + dataSize += computeElementSizeNoTag(type, element); + } + output.writeRawVarint32(dataSize); + // Write the data itself, without any tags. + for (final Object element : valueList) { + writeElementNoTag(output, type, element); + } + } else { + for (final Object element : valueList) { + writeElement(output, type, number, element); + } + } + } else { + if (value instanceof LazyField) { + writeElement(output, type, number, ((LazyField) value).getValue()); + } else { + writeElement(output, type, number, value); + } + } + } + + /** + * See {@link Message#getSerializedSize()}. It's up to the caller to cache + * the resulting size if desired. + */ + public int getSerializedSize() { + int size = 0; + for (int i = 0; i < fields.getNumArrayEntries(); i++) { + final Map.Entry entry = + fields.getArrayEntryAt(i); + size += computeFieldSize(entry.getKey(), entry.getValue()); + } + for (final Map.Entry entry : + fields.getOverflowEntries()) { + size += computeFieldSize(entry.getKey(), entry.getValue()); + } + return size; + } + + /** + * Like {@link #getSerializedSize} but uses MessageSet wire format. + */ + public int getMessageSetSerializedSize() { + int size = 0; + for (int i = 0; i < fields.getNumArrayEntries(); i++) { + size += getMessageSetSerializedSize(fields.getArrayEntryAt(i)); + } + for (final Map.Entry entry : + fields.getOverflowEntries()) { + size += getMessageSetSerializedSize(entry); + } + return size; + } + + private int getMessageSetSerializedSize( + final Map.Entry entry) { + final FieldDescriptorType descriptor = entry.getKey(); + Object value = entry.getValue(); + if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE + && !descriptor.isRepeated() && !descriptor.isPacked()) { + if (value instanceof LazyField) { + return CodedOutputStream.computeLazyFieldMessageSetExtensionSize( + entry.getKey().getNumber(), (LazyField) value); + } else { + return CodedOutputStream.computeMessageSetExtensionSize( + entry.getKey().getNumber(), (MessageLite) value); + } + } else { + return computeFieldSize(descriptor, value); + } + } + + /** + * Compute the number of bytes that would be needed to encode a + * single tag/value pair of arbitrary type. + * + * @param type The field's type. + * @param number The field's number. + * @param value Object representing the field's value. Must be of the exact + * type which would be returned by + * {@link Message#getField(Descriptors.FieldDescriptor)} for + * this field. + */ + private static int computeElementSize( + final WireFormat.FieldType type, + final int number, final Object value) { + int tagSize = CodedOutputStream.computeTagSize(number); + if (type == WireFormat.FieldType.GROUP) { + // Only count the end group tag for proto2 messages as for proto1 the end + // group tag will be counted as a part of getSerializedSize(). + tagSize *= 2; + } + return tagSize + computeElementSizeNoTag(type, value); + } + + /** + * Compute the number of bytes that would be needed to encode a + * particular value of arbitrary type, excluding tag. + * + * @param type The field's type. + * @param value Object representing the field's value. Must be of the exact + * type which would be returned by + * {@link Message#getField(Descriptors.FieldDescriptor)} for + * this field. + */ + private static int computeElementSizeNoTag( + final WireFormat.FieldType type, final Object value) { + switch (type) { + // Note: Minor violation of 80-char limit rule here because this would + // actually be harder to read if we wrapped the lines. + case DOUBLE : return CodedOutputStream.computeDoubleSizeNoTag ((Double )value); + case FLOAT : return CodedOutputStream.computeFloatSizeNoTag ((Float )value); + case INT64 : return CodedOutputStream.computeInt64SizeNoTag ((Long )value); + case UINT64 : return CodedOutputStream.computeUInt64SizeNoTag ((Long )value); + case INT32 : return CodedOutputStream.computeInt32SizeNoTag ((Integer )value); + case FIXED64 : return CodedOutputStream.computeFixed64SizeNoTag ((Long )value); + case FIXED32 : return CodedOutputStream.computeFixed32SizeNoTag ((Integer )value); + case BOOL : return CodedOutputStream.computeBoolSizeNoTag ((Boolean )value); + case STRING : return CodedOutputStream.computeStringSizeNoTag ((String )value); + case GROUP : return CodedOutputStream.computeGroupSizeNoTag ((MessageLite)value); + case BYTES : + if (value instanceof ByteString) { + return CodedOutputStream.computeBytesSizeNoTag((ByteString) value); + } else { + return CodedOutputStream.computeByteArraySizeNoTag((byte[]) value); + } + case UINT32 : return CodedOutputStream.computeUInt32SizeNoTag ((Integer )value); + case SFIXED32: return CodedOutputStream.computeSFixed32SizeNoTag((Integer )value); + case SFIXED64: return CodedOutputStream.computeSFixed64SizeNoTag((Long )value); + case SINT32 : return CodedOutputStream.computeSInt32SizeNoTag ((Integer )value); + case SINT64 : return CodedOutputStream.computeSInt64SizeNoTag ((Long )value); + + case MESSAGE: + if (value instanceof LazyField) { + return CodedOutputStream.computeLazyFieldSizeNoTag((LazyField) value); + } else { + return CodedOutputStream.computeMessageSizeNoTag((MessageLite) value); + } + + case ENUM: + if (value instanceof Internal.EnumLite) { + return CodedOutputStream.computeEnumSizeNoTag( + ((Internal.EnumLite) value).getNumber()); + } else { + return CodedOutputStream.computeEnumSizeNoTag((Integer) value); + } + } + + throw new RuntimeException( + "There is no way to get here, but the compiler thinks otherwise."); + } + + /** + * Compute the number of bytes needed to encode a particular field. + */ + public static int computeFieldSize(final FieldDescriptorLite descriptor, + final Object value) { + WireFormat.FieldType type = descriptor.getLiteType(); + int number = descriptor.getNumber(); + if (descriptor.isRepeated()) { + if (descriptor.isPacked()) { + int dataSize = 0; + for (final Object element : (List)value) { + dataSize += computeElementSizeNoTag(type, element); + } + return dataSize + + CodedOutputStream.computeTagSize(number) + + CodedOutputStream.computeRawVarint32Size(dataSize); + } else { + int size = 0; + for (final Object element : (List)value) { + size += computeElementSize(type, number, element); + } + return size; + } + } else { + return computeElementSize(type, number, value); + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/GeneratedMessageLite.java b/retrofit/src/main/java/com/google/protobuf/GeneratedMessageLite.java new file mode 100644 index 0000000000..e64b2f7ee1 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/GeneratedMessageLite.java @@ -0,0 +1,960 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.IOException; +import java.io.ObjectStreamException; +import java.io.Serializable; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Lite version of {@link GeneratedMessage}. + * + * @author kenton@google.com Kenton Varda + */ +public abstract class GeneratedMessageLite extends AbstractMessageLite + implements Serializable { + private static final long serialVersionUID = 1L; + + protected GeneratedMessageLite() { + } + + protected GeneratedMessageLite(Builder builder) { + } + + @Override public Parser getParserForType() { + throw new UnsupportedOperationException( + "This is supposed to be overridden by subclasses."); + } + + /** + * Called by subclasses to parse an unknown field. + * @return {@code true} unless the tag is an end-group tag. + */ + protected boolean parseUnknownField( + CodedInputStream input, + CodedOutputStream unknownFieldsCodedOutput, + ExtensionRegistryLite extensionRegistry, + int tag) throws IOException { + return input.skipField(tag, unknownFieldsCodedOutput); + } + + /** + * Used by parsing constructors in generated classes. + */ + protected void makeExtensionsImmutable() { + // Noop for messages without extensions. + } + + @SuppressWarnings("unchecked") + public abstract static class Builder + extends AbstractMessageLite.Builder { + protected Builder() {} + + //@Override (Java 1.6 override semantics, but we must support 1.5) + @Override public BuilderType clear() { + unknownFields = ByteString.EMPTY; + return (BuilderType) this; + } + + // This is implemented here only to work around an apparent bug in the + // Java compiler and/or build system. See bug #1898463. The mere presence + // of this dummy clone() implementation makes it go away. + @Override public BuilderType clone() { + throw new UnsupportedOperationException( + "This is supposed to be overridden by subclasses."); + } + + /** All subclasses implement this. */ + public abstract BuilderType mergeFrom(MessageType message); + + // Defined here for return type covariance. + @Override public abstract MessageType getDefaultInstanceForType(); + + /** + * Called by subclasses to parse an unknown field. + * @return {@code true} unless the tag is an end-group tag. + */ + protected boolean parseUnknownField( + CodedInputStream input, + CodedOutputStream unknownFieldsCodedOutput, + ExtensionRegistryLite extensionRegistry, + int tag) throws IOException { + return input.skipField(tag, unknownFieldsCodedOutput); + } + + public final ByteString getUnknownFields() { + return unknownFields; + } + + public final BuilderType setUnknownFields(final ByteString unknownFields) { + this.unknownFields = unknownFields; + return (BuilderType) this; + } + + private ByteString unknownFields = ByteString.EMPTY; + } + + + // ================================================================= + // Extensions-related stuff + + /** + * Lite equivalent of {@link com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder}. + */ + public interface ExtendableMessageOrBuilder< + MessageType extends ExtendableMessage> extends MessageLiteOrBuilder { + + /** Check if a singular extension is present. */ + boolean hasExtension( + GeneratedExtension extension); + + /** Get the number of elements in a repeated extension. */ + int getExtensionCount( + GeneratedExtension> extension); + + /** Get the value of an extension. */ + Type getExtension(GeneratedExtension extension); + + /** Get one element of a repeated extension. */ + Type getExtension( + GeneratedExtension> extension, + int index); + } + + /** + * Lite equivalent of {@link GeneratedMessage.ExtendableMessage}. + */ + public abstract static class ExtendableMessage< + MessageType extends ExtendableMessage> + extends GeneratedMessageLite + implements ExtendableMessageOrBuilder { + + private final FieldSet extensions; + + protected ExtendableMessage() { + this.extensions = FieldSet.newFieldSet(); + } + + protected ExtendableMessage(ExtendableBuilder builder) { + this.extensions = builder.buildExtensions(); + } + + private void verifyExtensionContainingType( + final GeneratedExtension extension) { + if (extension.getContainingTypeDefaultInstance() != + getDefaultInstanceForType()) { + // This can only happen if someone uses unchecked operations. + throw new IllegalArgumentException( + "This extension is for a different message type. Please make " + + "sure that you are not suppressing any generics type warnings."); + } + } + + /** Check if a singular extension is present. */ + //@Override (Java 1.6 override semantics, but we must support 1.5) + @Override public final boolean hasExtension( + final GeneratedExtension extension) { + verifyExtensionContainingType(extension); + return extensions.hasField(extension.descriptor); + } + + /** Get the number of elements in a repeated extension. */ + //@Override (Java 1.6 override semantics, but we must support 1.5) + @Override public final int getExtensionCount( + final GeneratedExtension> extension) { + verifyExtensionContainingType(extension); + return extensions.getRepeatedFieldCount(extension.descriptor); + } + + /** Get the value of an extension. */ + //@Override (Java 1.6 override semantics, but we must support 1.5) + @SuppressWarnings("unchecked") + @Override public final Type getExtension( + final GeneratedExtension extension) { + verifyExtensionContainingType(extension); + final Object value = extensions.getField(extension.descriptor); + if (value == null) { + return extension.defaultValue; + } else { + return (Type) extension.fromFieldSetType(value); + } + } + + /** Get one element of a repeated extension. */ + //@Override (Java 1.6 override semantics, but we must support 1.5) + @SuppressWarnings("unchecked") + @Override public final Type getExtension( + final GeneratedExtension> extension, + final int index) { + verifyExtensionContainingType(extension); + return (Type) extension.singularFromFieldSetType( + extensions.getRepeatedField(extension.descriptor, index)); + } + + /** Called by subclasses to check if all extensions are initialized. */ + protected boolean extensionsAreInitialized() { + return extensions.isInitialized(); + } + + /** + * Called by subclasses to parse an unknown field or an extension. + * @return {@code true} unless the tag is an end-group tag. + */ + @Override + protected boolean parseUnknownField( + CodedInputStream input, + CodedOutputStream unknownFieldsCodedOutput, + ExtensionRegistryLite extensionRegistry, + int tag) throws IOException { + return GeneratedMessageLite.parseUnknownField( + extensions, + getDefaultInstanceForType(), + input, + unknownFieldsCodedOutput, + extensionRegistry, + tag); + } + + + /** + * Used by parsing constructors in generated classes. + */ + @Override + protected void makeExtensionsImmutable() { + extensions.makeImmutable(); + } + + /** + * Used by subclasses to serialize extensions. Extension ranges may be + * interleaved with field numbers, but we must write them in canonical + * (sorted by field number) order. ExtensionWriter helps us write + * individual ranges of extensions at once. + */ + protected class ExtensionWriter { + // Imagine how much simpler this code would be if Java iterators had + // a way to get the next element without advancing the iterator. + + private final Iterator> iter = + extensions.iterator(); + private Map.Entry next; + private final boolean messageSetWireFormat; + + private ExtensionWriter(boolean messageSetWireFormat) { + if (iter.hasNext()) { + next = iter.next(); + } + this.messageSetWireFormat = messageSetWireFormat; + } + + public void writeUntil(final int end, final CodedOutputStream output) + throws IOException { + while (next != null && next.getKey().getNumber() < end) { + ExtensionDescriptor extension = next.getKey(); + if (messageSetWireFormat && extension.getLiteJavaType() == + WireFormat.JavaType.MESSAGE && + !extension.isRepeated()) { + output.writeMessageSetExtension(extension.getNumber(), + (MessageLite) next.getValue()); + } else { + FieldSet.writeField(extension, next.getValue(), output); + } + if (iter.hasNext()) { + next = iter.next(); + } else { + next = null; + } + } + } + } + + protected ExtensionWriter newExtensionWriter() { + return new ExtensionWriter(false); + } + protected ExtensionWriter newMessageSetExtensionWriter() { + return new ExtensionWriter(true); + } + + /** Called by subclasses to compute the size of extensions. */ + protected int extensionsSerializedSize() { + return extensions.getSerializedSize(); + } + protected int extensionsSerializedSizeAsMessageSet() { + return extensions.getMessageSetSerializedSize(); + } + } + + /** + * Lite equivalent of {@link GeneratedMessage.ExtendableBuilder}. + */ + @SuppressWarnings("unchecked") + public abstract static class ExtendableBuilder< + MessageType extends ExtendableMessage, + BuilderType extends ExtendableBuilder> + extends Builder + implements ExtendableMessageOrBuilder { + protected ExtendableBuilder() {} + + private FieldSet extensions = FieldSet.emptySet(); + private boolean extensionsIsMutable; + + // For immutable message conversion. + void internalSetExtensionSet(FieldSet extensions) { + this.extensions = extensions; + } + + @Override + public BuilderType clear() { + extensions.clear(); + extensionsIsMutable = false; + return super.clear(); + } + + private void ensureExtensionsIsMutable() { + if (!extensionsIsMutable) { + extensions = extensions.clone(); + extensionsIsMutable = true; + } + } + + /** + * Called by the build code path to create a copy of the extensions for + * building the message. + */ + private FieldSet buildExtensions() { + extensions.makeImmutable(); + extensionsIsMutable = false; + return extensions; + } + + private void verifyExtensionContainingType( + final GeneratedExtension extension) { + if (extension.getContainingTypeDefaultInstance() != + getDefaultInstanceForType()) { + // This can only happen if someone uses unchecked operations. + throw new IllegalArgumentException( + "This extension is for a different message type. Please make " + + "sure that you are not suppressing any generics type warnings."); + } + } + + /** Check if a singular extension is present. */ + //@Override (Java 1.6 override semantics, but we must support 1.5) + @Override + public final boolean hasExtension( + final GeneratedExtension extension) { + verifyExtensionContainingType(extension); + return extensions.hasField(extension.descriptor); + } + + /** Get the number of elements in a repeated extension. */ + //@Override (Java 1.6 override semantics, but we must support 1.5) + @Override + public final int getExtensionCount( + final GeneratedExtension> extension) { + verifyExtensionContainingType(extension); + return extensions.getRepeatedFieldCount(extension.descriptor); + } + + /** Get the value of an extension. */ + //@Override (Java 1.6 override semantics, but we must support 1.5) + @SuppressWarnings("unchecked") + @Override + public final Type getExtension( + final GeneratedExtension extension) { + verifyExtensionContainingType(extension); + final Object value = extensions.getField(extension.descriptor); + if (value == null) { + return extension.defaultValue; + } else { + return (Type) extension.fromFieldSetType(value); + } + } + + /** Get one element of a repeated extension. */ + @SuppressWarnings("unchecked") + //@Override (Java 1.6 override semantics, but we must support 1.5) + @Override + public final Type getExtension( + final GeneratedExtension> extension, + final int index) { + verifyExtensionContainingType(extension); + return (Type) extension.singularFromFieldSetType( + extensions.getRepeatedField(extension.descriptor, index)); + } + + // This is implemented here only to work around an apparent bug in the + // Java compiler and/or build system. See bug #1898463. The mere presence + // of this dummy clone() implementation makes it go away. + @Override + public BuilderType clone() { + throw new UnsupportedOperationException( + "This is supposed to be overridden by subclasses."); + } + + /** Set the value of an extension. */ + public final BuilderType setExtension( + final GeneratedExtension extension, + final Type value) { + verifyExtensionContainingType(extension); + ensureExtensionsIsMutable(); + extensions.setField(extension.descriptor, + extension.toFieldSetType(value)); + return (BuilderType) this; + } + + /** Set the value of one element of a repeated extension. */ + public final BuilderType setExtension( + final GeneratedExtension> extension, + final int index, final Type value) { + verifyExtensionContainingType(extension); + ensureExtensionsIsMutable(); + extensions.setRepeatedField(extension.descriptor, index, + extension.singularToFieldSetType(value)); + return (BuilderType) this; + } + + /** Append a value to a repeated extension. */ + public final BuilderType addExtension( + final GeneratedExtension> extension, + final Type value) { + verifyExtensionContainingType(extension); + ensureExtensionsIsMutable(); + extensions.addRepeatedField(extension.descriptor, + extension.singularToFieldSetType(value)); + return (BuilderType) this; + } + + /** Clear an extension. */ + public final BuilderType clearExtension( + final GeneratedExtension extension) { + verifyExtensionContainingType(extension); + ensureExtensionsIsMutable(); + extensions.clearField(extension.descriptor); + return (BuilderType) this; + } + + /** Called by subclasses to check if all extensions are initialized. */ + protected boolean extensionsAreInitialized() { + return extensions.isInitialized(); + } + + /** + * Called by subclasses to parse an unknown field or an extension. + * @return {@code true} unless the tag is an end-group tag. + */ + @Override + protected boolean parseUnknownField( + CodedInputStream input, + CodedOutputStream unknownFieldsCodedOutput, + ExtensionRegistryLite extensionRegistry, + int tag) throws IOException { + ensureExtensionsIsMutable(); + return GeneratedMessageLite.parseUnknownField( + extensions, + getDefaultInstanceForType(), + input, + unknownFieldsCodedOutput, + extensionRegistry, + tag); + } + + protected final void mergeExtensionFields(final MessageType other) { + ensureExtensionsIsMutable(); + extensions.mergeFrom(((ExtendableMessage) other).extensions); + } + } + + // ----------------------------------------------------------------- + + /** + * Parse an unknown field or an extension. + * @return {@code true} unless the tag is an end-group tag. + */ + private static + boolean parseUnknownField( + FieldSet extensions, + MessageType defaultInstance, + CodedInputStream input, + CodedOutputStream unknownFieldsCodedOutput, + ExtensionRegistryLite extensionRegistry, + int tag) throws IOException { + int wireType = WireFormat.getTagWireType(tag); + int fieldNumber = WireFormat.getTagFieldNumber(tag); + + GeneratedExtension extension = + extensionRegistry.findLiteExtensionByNumber( + defaultInstance, fieldNumber); + + boolean unknown = false; + boolean packed = false; + if (extension == null) { + unknown = true; // Unknown field. + } else if (wireType == FieldSet.getWireFormatForFieldType( + extension.descriptor.getLiteType(), + false /* isPacked */)) { + packed = false; // Normal, unpacked value. + } else if (extension.descriptor.isRepeated && + extension.descriptor.type.isPackable() && + wireType == FieldSet.getWireFormatForFieldType( + extension.descriptor.getLiteType(), + true /* isPacked */)) { + packed = true; // Packed value. + } else { + unknown = true; // Wrong wire type. + } + + if (unknown) { // Unknown field or wrong wire type. Skip. + return input.skipField(tag, unknownFieldsCodedOutput); + } + + if (packed) { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (extension.descriptor.getLiteType() == WireFormat.FieldType.ENUM) { + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + Object value = + extension.descriptor.getEnumType().findValueByNumber(rawValue); + if (value == null) { + // If the number isn't recognized as a valid value for this + // enum, drop it (don't even add it to unknownFields). + return true; + } + extensions.addRepeatedField(extension.descriptor, + extension.singularToFieldSetType(value)); + } + } else { + while (input.getBytesUntilLimit() > 0) { + Object value = + FieldSet.readPrimitiveField(input, + extension.descriptor.getLiteType(), + /*checkUtf8=*/ false); + extensions.addRepeatedField(extension.descriptor, value); + } + } + input.popLimit(limit); + } else { + Object value; + switch (extension.descriptor.getLiteJavaType()) { + case MESSAGE: { + MessageLite.Builder subBuilder = null; + if (!extension.descriptor.isRepeated()) { + MessageLite existingValue = + (MessageLite) extensions.getField(extension.descriptor); + if (existingValue != null) { + subBuilder = existingValue.toBuilder(); + } + } + if (subBuilder == null) { + subBuilder = extension.getMessageDefaultInstance() + .newBuilderForType(); + } + if (extension.descriptor.getLiteType() == + WireFormat.FieldType.GROUP) { + input.readGroup(extension.getNumber(), + subBuilder, extensionRegistry); + } else { + input.readMessage(subBuilder, extensionRegistry); + } + value = subBuilder.build(); + break; + } + case ENUM: + int rawValue = input.readEnum(); + value = extension.descriptor.getEnumType() + .findValueByNumber(rawValue); + // If the number isn't recognized as a valid value for this enum, + // write it to unknown fields object. + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeUInt32NoTag(rawValue); + return true; + } + break; + default: + value = FieldSet.readPrimitiveField(input, + extension.descriptor.getLiteType(), + /*checkUtf8=*/ false); + break; + } + + if (extension.descriptor.isRepeated()) { + extensions.addRepeatedField(extension.descriptor, + extension.singularToFieldSetType(value)); + } else { + extensions.setField(extension.descriptor, + extension.singularToFieldSetType(value)); + } + } + + return true; + } + + // ----------------------------------------------------------------- + + /** For use by generated code only. */ + public static + GeneratedExtension + newSingularGeneratedExtension( + final ContainingType containingTypeDefaultInstance, + final Type defaultValue, + final MessageLite messageDefaultInstance, + final Internal.EnumLiteMap enumTypeMap, + final int number, + final WireFormat.FieldType type, + final Class singularType) { + return new GeneratedExtension( + containingTypeDefaultInstance, + defaultValue, + messageDefaultInstance, + new ExtensionDescriptor(enumTypeMap, number, type, + false /* isRepeated */, + false /* isPacked */), + singularType); + } + + /** For use by generated code only. */ + public static + GeneratedExtension + newRepeatedGeneratedExtension( + final ContainingType containingTypeDefaultInstance, + final MessageLite messageDefaultInstance, + final Internal.EnumLiteMap enumTypeMap, + final int number, + final WireFormat.FieldType type, + final boolean isPacked, + final Class singularType) { + @SuppressWarnings("unchecked") // Subclasses ensure Type is a List + Type emptyList = (Type) Collections.emptyList(); + return new GeneratedExtension( + containingTypeDefaultInstance, + emptyList, + messageDefaultInstance, + new ExtensionDescriptor( + enumTypeMap, number, type, true /* isRepeated */, isPacked), + singularType); + } + + static final class ExtensionDescriptor + implements FieldSet.FieldDescriptorLite< + ExtensionDescriptor> { + ExtensionDescriptor( + final Internal.EnumLiteMap enumTypeMap, + final int number, + final WireFormat.FieldType type, + final boolean isRepeated, + final boolean isPacked) { + this.enumTypeMap = enumTypeMap; + this.number = number; + this.type = type; + this.isRepeated = isRepeated; + this.isPacked = isPacked; + } + + final Internal.EnumLiteMap enumTypeMap; + final int number; + final WireFormat.FieldType type; + final boolean isRepeated; + final boolean isPacked; + + @Override + public int getNumber() { + return number; + } + + @Override + public WireFormat.FieldType getLiteType() { + return type; + } + + @Override + public WireFormat.JavaType getLiteJavaType() { + return type.getJavaType(); + } + + @Override + public boolean isRepeated() { + return isRepeated; + } + + @Override + public boolean isPacked() { + return isPacked; + } + + @Override + public Internal.EnumLiteMap getEnumType() { + return enumTypeMap; + } + + @SuppressWarnings("unchecked") + @Override + public MessageLite.Builder internalMergeFrom( + MessageLite.Builder to, MessageLite from) { + return ((Builder) to).mergeFrom((GeneratedMessageLite) from); + } + + + @Override + public int compareTo(ExtensionDescriptor other) { + return number - other.number; + } + } + + // ================================================================= + + /** Calls Class.getMethod and throws a RuntimeException if it fails. */ + @SuppressWarnings("unchecked") + static Method getMethodOrDie(Class clazz, String name, Class... params) { + try { + return clazz.getMethod(name, params); + } catch (NoSuchMethodException e) { + throw new RuntimeException( + "Generated message class \"" + clazz.getName() + + "\" missing method \"" + name + "\".", e); + } + } + + /** Calls invoke and throws a RuntimeException if it fails. */ + static Object invokeOrDie(Method method, Object object, Object... params) { + try { + return method.invoke(object, params); + } catch (IllegalAccessException e) { + throw new RuntimeException( + "Couldn't use Java reflection to implement protocol message " + + "reflection.", e); + } catch (InvocationTargetException e) { + final Throwable cause = e.getCause(); + if (cause instanceof RuntimeException) { + throw (RuntimeException) cause; + } else if (cause instanceof Error) { + throw (Error) cause; + } else { + throw new RuntimeException( + "Unexpected exception thrown by generated accessor method.", cause); + } + } + } + + /** + * Lite equivalent to {@link GeneratedMessage.GeneratedExtension}. + * + * Users should ignore the contents of this class and only use objects of + * this type as parameters to extension accessors and ExtensionRegistry.add(). + */ + public static class GeneratedExtension< + ContainingType extends MessageLite, Type> { + + /** + * Create a new isntance with the given parameters. + * + * The last parameter {@code singularType} is only needed for enum types. + * We store integer values for enum types in a {@link ExtendableMessage} + * and use Java reflection to convert an integer value back into a concrete + * enum object. + */ + GeneratedExtension( + final ContainingType containingTypeDefaultInstance, + final Type defaultValue, + final MessageLite messageDefaultInstance, + final ExtensionDescriptor descriptor, + Class singularType) { + // Defensive checks to verify the correct initialization order of + // GeneratedExtensions and their related GeneratedMessages. + if (containingTypeDefaultInstance == null) { + throw new IllegalArgumentException( + "Null containingTypeDefaultInstance"); + } + if (descriptor.getLiteType() == WireFormat.FieldType.MESSAGE && + messageDefaultInstance == null) { + throw new IllegalArgumentException( + "Null messageDefaultInstance"); + } + this.containingTypeDefaultInstance = containingTypeDefaultInstance; + this.defaultValue = defaultValue; + this.messageDefaultInstance = messageDefaultInstance; + this.descriptor = descriptor; + + // Use Java reflection to invoke the static method {@code valueOf} of + // enum types in order to convert integers to concrete enum objects. + this.singularType = singularType; + if (Internal.EnumLite.class.isAssignableFrom(singularType)) { + this.enumValueOf = getMethodOrDie( + singularType, "valueOf", int.class); + } else { + this.enumValueOf = null; + } + } + + final ContainingType containingTypeDefaultInstance; + final Type defaultValue; + final MessageLite messageDefaultInstance; + final ExtensionDescriptor descriptor; + final Class singularType; + final Method enumValueOf; + + /** + * Default instance of the type being extended, used to identify that type. + */ + public ContainingType getContainingTypeDefaultInstance() { + return containingTypeDefaultInstance; + } + + /** Get the field number. */ + public int getNumber() { + return descriptor.getNumber(); + } + + + /** + * If the extension is an embedded message or group, returns the default + * instance of the message. + */ + public MessageLite getMessageDefaultInstance() { + return messageDefaultInstance; + } + + @SuppressWarnings("unchecked") + Object fromFieldSetType(final Object value) { + if (descriptor.isRepeated()) { + if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { + final List result = new ArrayList(); + for (final Object element : (List) value) { + result.add(singularFromFieldSetType(element)); + } + return result; + } else { + return value; + } + } else { + return singularFromFieldSetType(value); + } + } + + Object singularFromFieldSetType(final Object value) { + if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { + return invokeOrDie(enumValueOf, null, (Integer) value); + } else { + return value; + } + } + + @SuppressWarnings("unchecked") + Object toFieldSetType(final Object value) { + if (descriptor.isRepeated()) { + if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { + final List result = new ArrayList(); + for (final Object element : (List) value) { + result.add(singularToFieldSetType(element)); + } + return result; + } else { + return value; + } + } else { + return singularToFieldSetType(value); + } + } + + Object singularToFieldSetType(final Object value) { + if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { + return ((Internal.EnumLite) value).getNumber(); + } else { + return value; + } + } + } + + /** + * A serialized (serializable) form of the generated message. Stores the + * message as a class name and a byte array. + */ + static final class SerializedForm implements Serializable { + private static final long serialVersionUID = 0L; + + private String messageClassName; + private byte[] asBytes; + + /** + * Creates the serialized form by calling {@link com.google.protobuf.MessageLite#toByteArray}. + * @param regularForm the message to serialize + */ + SerializedForm(MessageLite regularForm) { + messageClassName = regularForm.getClass().getName(); + asBytes = regularForm.toByteArray(); + } + + /** + * When read from an ObjectInputStream, this method converts this object + * back to the regular form. Part of Java's serialization magic. + * @return a GeneratedMessage of the type that was serialized + */ + @SuppressWarnings("unchecked") + protected Object readResolve() throws ObjectStreamException { + try { + Class messageClass = Class.forName(messageClassName); + Method newBuilder = messageClass.getMethod("newBuilder"); + MessageLite.Builder builder = + (MessageLite.Builder) newBuilder.invoke(null); + builder.mergeFrom(asBytes); + return builder.buildPartial(); + } catch (ClassNotFoundException e) { + throw new RuntimeException("Unable to find proto buffer class", e); + } catch (NoSuchMethodException e) { + throw new RuntimeException("Unable to find newBuilder method", e); + } catch (IllegalAccessException e) { + throw new RuntimeException("Unable to call newBuilder method", e); + } catch (InvocationTargetException e) { + throw new RuntimeException("Error calling newBuilder", e.getCause()); + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException("Unable to understand proto buffer", e); + } + } + } + + /** + * Replaces this object in the output stream with a serialized form. + * Part of Java's serialization magic. Generated sub-classes must override + * this method by calling {@code return super.writeReplace();} + * @return a SerializedForm of this message + */ + protected Object writeReplace() throws ObjectStreamException { + return new SerializedForm(this); + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/Internal.java b/retrofit/src/main/java/com/google/protobuf/Internal.java new file mode 100644 index 0000000000..48d29e69f3 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/Internal.java @@ -0,0 +1,391 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.List; + +/** + * The classes contained within are used internally by the Protocol Buffer + * library and generated message implementations. They are public only because + * those generated messages do not reside in the {@code protobuf} package. + * Others should not use this class directly. + * + * @author kenton@google.com (Kenton Varda) + */ +public class Internal { + /** + * Helper called by generated code to construct default values for string + * fields. + *

+ * The protocol compiler does not actually contain a UTF-8 decoder -- it + * just pushes UTF-8-encoded text around without touching it. The one place + * where this presents a problem is when generating Java string literals. + * Unicode characters in the string literal would normally need to be encoded + * using a Unicode escape sequence, which would require decoding them. + * To get around this, protoc instead embeds the UTF-8 bytes into the + * generated code and leaves it to the runtime library to decode them. + *

+ * It gets worse, though. If protoc just generated a byte array, like: + * new byte[] {0x12, 0x34, 0x56, 0x78} + * Java actually generates *code* which allocates an array and then fills + * in each value. This is much less efficient than just embedding the bytes + * directly into the bytecode. To get around this, we need another + * work-around. String literals are embedded directly, so protoc actually + * generates a string literal corresponding to the bytes. The easiest way + * to do this is to use the ISO-8859-1 character set, which corresponds to + * the first 256 characters of the Unicode range. Protoc can then use + * good old CEscape to generate the string. + *

+ * So we have a string literal which represents a set of bytes which + * represents another string. This function -- stringDefaultValue -- + * converts from the generated string to the string we actually want. The + * generated code calls this automatically. + */ + public static String stringDefaultValue(String bytes) { + try { + return new String(bytes.getBytes("ISO-8859-1"), "UTF-8"); + } catch (UnsupportedEncodingException e) { + // This should never happen since all JVMs are required to implement + // both of the above character sets. + throw new IllegalStateException( + "Java VM does not support a standard character set.", e); + } + } + + /** + * Helper called by generated code to construct default values for bytes + * fields. + *

+ * This is a lot like {@link #stringDefaultValue}, but for bytes fields. + * In this case we only need the second of the two hacks -- allowing us to + * embed raw bytes as a string literal with ISO-8859-1 encoding. + */ + public static ByteString bytesDefaultValue(String bytes) { + try { + return ByteString.copyFrom(bytes.getBytes("ISO-8859-1")); + } catch (UnsupportedEncodingException e) { + // This should never happen since all JVMs are required to implement + // ISO-8859-1. + throw new IllegalStateException( + "Java VM does not support a standard character set.", e); + } + } + /** + * Helper called by generated code to construct default values for bytes + * fields. + *

+ * This is like {@link #bytesDefaultValue}, but returns a byte array. + */ + public static byte[] byteArrayDefaultValue(String bytes) { + try { + return bytes.getBytes("ISO-8859-1"); + } catch (UnsupportedEncodingException e) { + // This should never happen since all JVMs are required to implement + // ISO-8859-1. + throw new IllegalStateException( + "Java VM does not support a standard character set.", e); + } + } + + /** + * Helper called by generated code to construct default values for bytes + * fields. + *

+ * This is like {@link #bytesDefaultValue}, but returns a ByteBuffer. + */ + public static ByteBuffer byteBufferDefaultValue(String bytes) { + return ByteBuffer.wrap(byteArrayDefaultValue(bytes)); + } + + /** + * Create a new ByteBuffer and copy all the content of {@code source} + * ByteBuffer to the new ByteBuffer. The new ByteBuffer's limit and + * capacity will be source.capacity(), and its position will be 0. + * Note that the state of {@code source} ByteBuffer won't be changed. + */ + public static ByteBuffer copyByteBuffer(ByteBuffer source) { + // Make a duplicate of the source ByteBuffer and read data from the + // duplicate. This is to avoid affecting the source ByteBuffer's state. + ByteBuffer temp = source.duplicate(); + // We want to copy all the data in the source ByteBuffer, not just the + // remaining bytes. + temp.clear(); + ByteBuffer result = ByteBuffer.allocate(temp.capacity()); + result.put(temp); + result.clear(); + return result; + } + + /** + * Helper called by generated code to determine if a byte array is a valid + * UTF-8 encoded string such that the original bytes can be converted to + * a String object and then back to a byte array round tripping the bytes + * without loss. More precisely, returns {@code true} whenever: + *

   {@code
+   * Arrays.equals(byteString.toByteArray(),
+   *     new String(byteString.toByteArray(), "UTF-8").getBytes("UTF-8"))
+   * }
+ * + *

This method rejects "overlong" byte sequences, as well as + * 3-byte sequences that would map to a surrogate character, in + * accordance with the restricted definition of UTF-8 introduced in + * Unicode 3.1. Note that the UTF-8 decoder included in Oracle's + * JDK has been modified to also reject "overlong" byte sequences, + * but currently (2011) still accepts 3-byte surrogate character + * byte sequences. + * + *

See the Unicode Standard,
+ * Table 3-6. UTF-8 Bit Distribution,
+ * Table 3-7. Well Formed UTF-8 Byte Sequences. + * + *

As of 2011-02, this method simply returns the result of {@link + * ByteString#isValidUtf8()}. Calling that method directly is preferred. + * + * @param byteString the string to check + * @return whether the byte array is round trippable + */ + public static boolean isValidUtf8(ByteString byteString) { + return byteString.isValidUtf8(); + } + + /** + * Like {@link #isValidUtf8(ByteString)} but for byte arrays. + */ + public static boolean isValidUtf8(byte[] byteArray) { + return Utf8.isValidUtf8(byteArray); + } + + /** + * Helper method to get the UTF-8 bytes of a string. + */ + public static byte[] toByteArray(String value) { + try { + return value.getBytes("UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF-8 not supported?", e); + } + } + + /** + * Helper method to convert a byte array to a string using UTF-8 encoding. + */ + public static String toStringUtf8(byte[] bytes) { + try { + return new String(bytes, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF-8 not supported?", e); + } + } + + /** + * Interface for an enum value or value descriptor, to be used in FieldSet. + * The lite library stores enum values directly in FieldSets but the full + * library stores EnumValueDescriptors in order to better support reflection. + */ + public interface EnumLite { + int getNumber(); + } + + /** + * Interface for an object which maps integers to {@link EnumLite}s. + * {@link Descriptors.EnumDescriptor} implements this interface by mapping + * numbers to {@link Descriptors.EnumValueDescriptor}s. Additionally, + * every generated enum type has a static method internalGetValueMap() which + * returns an implementation of this type that maps numbers to enum values. + */ + public interface EnumLiteMap { + T findValueByNumber(int number); + } + + /** + * Helper method for implementing {@link MessageLite#hashCode()} for longs. + * @see Long#hashCode() + */ + public static int hashLong(long n) { + return (int) (n ^ (n >>> 32)); + } + + /** + * Helper method for implementing {@link MessageLite#hashCode()} for + * booleans. + * @see Boolean#hashCode() + */ + public static int hashBoolean(boolean b) { + return b ? 1231 : 1237; + } + + /** + * Helper method for implementing {@link MessageLite#hashCode()} for enums. + *

+ * This is needed because {@link java.lang.Enum#hashCode()} is final, but we + * need to use the field number as the hash code to ensure compatibility + * between statically and dynamically generated enum objects. + */ + public static int hashEnum(EnumLite e) { + return e.getNumber(); + } + + /** + * Helper method for implementing {@link MessageLite#hashCode()} for + * enum lists. + */ + public static int hashEnumList(List list) { + int hash = 1; + for (EnumLite e : list) { + hash = 31 * hash + hashEnum(e); + } + return hash; + } + + /** + * Helper method for implementing {@link MessageLite#equals()} for bytes field. + */ + public static boolean equals(List a, List b) { + if (a.size() != b.size()) return false; + for (int i = 0; i < a.size(); ++i) { + if (!Arrays.equals(a.get(i), b.get(i))) { + return false; + } + } + return true; + } + + /** + * Helper method for implementing {@link MessageLite#hashCode()} for bytes field. + */ + public static int hashCode(List list) { + int hash = 1; + for (byte[] bytes : list) { + hash = 31 * hash + hashCode(bytes); + } + return hash; + } + + /** + * Helper method for implementing {@link MessageLite#hashCode()} for bytes field. + */ + public static int hashCode(byte[] bytes) { + // The hash code for a byte array should be the same as the hash code for a + // ByteString with the same content. This is to ensure that the generated + // hashCode() method will return the same value as the pure reflection + // based hashCode() method. + return LiteralByteString.hashCode(bytes); + } + + /** + * Helper method for implementing {@link MessageLite#equals()} for bytes + * field. + */ + public static boolean equalsByteBuffer(ByteBuffer a, ByteBuffer b) { + if (a.capacity() != b.capacity()) { + return false; + } + // ByteBuffer.equals() will only compare the remaining bytes, but we want to + // compare all the content. + return a.duplicate().clear().equals(b.duplicate().clear()); + } + + /** + * Helper method for implementing {@link MessageLite#equals()} for bytes + * field. + */ + public static boolean equalsByteBuffer( + List a, List b) { + if (a.size() != b.size()) { + return false; + } + for (int i = 0; i < a.size(); ++i) { + if (!equalsByteBuffer(a.get(i), b.get(i))) { + return false; + } + } + return true; + } + + /** + * Helper method for implementing {@link MessageLite#hashCode()} for bytes + * field. + */ + public static int hashCodeByteBuffer(List list) { + int hash = 1; + for (ByteBuffer bytes : list) { + hash = 31 * hash + hashCodeByteBuffer(bytes); + } + return hash; + } + + private static final int DEFAULT_BUFFER_SIZE = 4096; + + /** + * Helper method for implementing {@link MessageLite#hashCode()} for bytes + * field. + */ + public static int hashCodeByteBuffer(ByteBuffer bytes) { + if (bytes.hasArray()) { + // Fast path. + int h = LiteralByteString.hashCode(bytes.capacity(), bytes.array(), + bytes.arrayOffset(), bytes.capacity()); + return h == 0 ? 1 : h; + } else { + // Read the data into a temporary byte array before calculating the + // hash value. + final int bufferSize = bytes.capacity() > DEFAULT_BUFFER_SIZE + ? DEFAULT_BUFFER_SIZE : bytes.capacity(); + final byte[] buffer = new byte[bufferSize]; + final ByteBuffer duplicated = bytes.duplicate(); + duplicated.clear(); + int h = bytes.capacity(); + while (duplicated.remaining() > 0) { + final int length = duplicated.remaining() <= bufferSize ? + duplicated.remaining() : bufferSize; + duplicated.get(buffer, 0, length); + h = LiteralByteString.hashCode(h, buffer, 0, length); + } + return h == 0 ? 1 : h; + } + } + + /** + * An empty byte array constant used in generated code. + */ + public static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; + + /** + * An empty byte array constant used in generated code. + */ + public static final ByteBuffer EMPTY_BYTE_BUFFER = + ByteBuffer.wrap(EMPTY_BYTE_ARRAY); + +} diff --git a/retrofit/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java b/retrofit/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java new file mode 100644 index 0000000000..367fa23ba3 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java @@ -0,0 +1,122 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.IOException; + +/** + * Thrown when a protocol message being parsed is invalid in some way, + * e.g. it contains a malformed varint or a negative byte length. + * + * @author kenton@google.com Kenton Varda + */ +public class InvalidProtocolBufferException extends IOException { + private static final long serialVersionUID = -1616151763072450476L; + private MessageLite unfinishedMessage = null; + + public InvalidProtocolBufferException(final String description) { + super(description); + } + + /** + * Attaches an unfinished message to the exception to support best-effort + * parsing in {@code Parser} interface. + * + * @return this + */ + public InvalidProtocolBufferException setUnfinishedMessage( + MessageLite unfinishedMessage) { + this.unfinishedMessage = unfinishedMessage; + return this; + } + + /** + * Returns the unfinished message attached to the exception, or null if + * no message is attached. + */ + public MessageLite getUnfinishedMessage() { + return unfinishedMessage; + } + + static InvalidProtocolBufferException truncatedMessage() { + return new InvalidProtocolBufferException( + "While parsing a protocol message, the input ended unexpectedly " + + "in the middle of a field. This could mean either than the " + + "input has been truncated or that an embedded message " + + "misreported its own length."); + } + + static InvalidProtocolBufferException negativeSize() { + return new InvalidProtocolBufferException( + "CodedInputStream encountered an embedded string or message " + + "which claimed to have negative size."); + } + + static InvalidProtocolBufferException malformedVarint() { + return new InvalidProtocolBufferException( + "CodedInputStream encountered a malformed varint."); + } + + static InvalidProtocolBufferException invalidTag() { + return new InvalidProtocolBufferException( + "Protocol message contained an invalid tag (zero)."); + } + + static InvalidProtocolBufferException invalidEndTag() { + return new InvalidProtocolBufferException( + "Protocol message end-group tag did not match expected tag."); + } + + static InvalidProtocolBufferException invalidWireType() { + return new InvalidProtocolBufferException( + "Protocol message tag had invalid wire type."); + } + + static InvalidProtocolBufferException recursionLimitExceeded() { + return new InvalidProtocolBufferException( + "Protocol message had too many levels of nesting. May be malicious. " + + "Use CodedInputStream.setRecursionLimit() to increase the depth limit."); + } + + static InvalidProtocolBufferException sizeLimitExceeded() { + return new InvalidProtocolBufferException( + "Protocol message was too large. May be malicious. " + + "Use CodedInputStream.setSizeLimit() to increase the size limit."); + } + + static InvalidProtocolBufferException parseFailure() { + return new InvalidProtocolBufferException("Failed to parse the message."); + } + + static InvalidProtocolBufferException invalidUtf8() { + return new InvalidProtocolBufferException("Protocol message had invalid UTF-8."); + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/LazyField.java b/retrofit/src/main/java/com/google/protobuf/LazyField.java new file mode 100644 index 0000000000..3da8b900e4 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/LazyField.java @@ -0,0 +1,154 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.Iterator; +import java.util.Map.Entry; + +/** + * LazyField encapsulates the logic of lazily parsing message fields. It stores + * the message in a ByteString initially and then parse it on-demand. + * + * Most of key methods are implemented in {@link LazyFieldLite} but this class + * can contain default instance of the message to provide {@code hashCode()}, + * {@code euqals()} and {@code toString()}. + * + * @author xiangl@google.com (Xiang Li) + */ +public class LazyField extends LazyFieldLite { + + /** + * Carry a message's default instance which is used by {@code hashCode()}, {@code euqals()} and + * {@code toString()}. + */ + private final MessageLite defaultInstance; + + public LazyField(MessageLite defaultInstance, + ExtensionRegistryLite extensionRegistry, ByteString bytes) { + super(extensionRegistry, bytes); + + this.defaultInstance = defaultInstance; + } + + @Override + public boolean containsDefaultInstance() { + return super.containsDefaultInstance() || value == defaultInstance; + } + + public MessageLite getValue() { + return getValue(defaultInstance); + } + + @Override + public int hashCode() { + return getValue().hashCode(); + } + + @Override + public boolean equals(Object obj) { + return getValue().equals(obj); + } + + @Override + public String toString() { + return getValue().toString(); + } + + // ==================================================== + + /** + * LazyEntry and LazyIterator are used to encapsulate the LazyField, when + * users iterate all fields from FieldSet. + */ + static class LazyEntry implements Entry { + private Entry entry; + + private LazyEntry(Entry entry) { + this.entry = entry; + } + + // @Override + public K getKey() { + return entry.getKey(); + } + + // @Override + public Object getValue() { + LazyField field = entry.getValue(); + if (field == null) { + return null; + } + return field.getValue(); + } + + public LazyField getField() { + return entry.getValue(); + } + + // @Override + public Object setValue(Object value) { + if (!(value instanceof MessageLite)) { + throw new IllegalArgumentException( + "LazyField now only used for MessageSet, " + + "and the value of MessageSet must be an instance of MessageLite"); + } + return entry.getValue().setValue((MessageLite) value); + } + } + + static class LazyIterator implements Iterator> { + private Iterator> iterator; + + public LazyIterator(Iterator> iterator) { + this.iterator = iterator; + } + + // @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @SuppressWarnings("unchecked") + // @Override + public Entry next() { + Entry entry = iterator.next(); + if (entry.getValue() instanceof LazyField) { + return new LazyEntry((Entry) entry); + } + return (Entry) entry; + } + + // @Override + public void remove() { + iterator.remove(); + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/LazyFieldLite.java b/retrofit/src/main/java/com/google/protobuf/LazyFieldLite.java new file mode 100644 index 0000000000..1fc80e8759 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/LazyFieldLite.java @@ -0,0 +1,176 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.IOException; + +/** + * LazyFieldLite encapsulates the logic of lazily parsing message fields. It stores + * the message in a ByteString initially and then parse it on-demand. + * + * LazyField is thread-compatible e.g. concurrent read are safe, however, + * synchronizations are needed under read/write situations. + * + * This class is internal implementation detail, so you don't need to use it directly. + * + * @author xiangl@google.com (Xiang Li) + */ +public class LazyFieldLite { + private ByteString bytes; + private ExtensionRegistryLite extensionRegistry; + private volatile boolean isDirty = false; + + protected volatile MessageLite value; + + public LazyFieldLite(ExtensionRegistryLite extensionRegistry, ByteString bytes) { + this.extensionRegistry = extensionRegistry; + this.bytes = bytes; + } + + public LazyFieldLite() { + } + + public static LazyFieldLite fromValue(MessageLite value) { + LazyFieldLite lf = new LazyFieldLite(); + lf.setValue(value); + return lf; + } + + public boolean containsDefaultInstance() { + return value == null && bytes == null; + } + + public void clear() { + bytes = null; + value = null; + extensionRegistry = null; + isDirty = true; + } + + /** + * Returns message instance. At first time, serialized data is parsed by + * {@code defaultInstance.getParserForType()}. + * + * @param defaultInstance its message's default instance. It's also used to get parser for the + * message type. + */ + public MessageLite getValue(MessageLite defaultInstance) { + ensureInitialized(defaultInstance); + return value; + } + + /** + * LazyField is not thread-safe for write access. Synchronizations are needed + * under read/write situations. + */ + public MessageLite setValue(MessageLite value) { + MessageLite originalValue = this.value; + this.value = value; + bytes = null; + isDirty = true; + return originalValue; + } + + public void merge(LazyFieldLite value) { + if (value.containsDefaultInstance()) { + return; + } + + if (bytes == null) { + this.bytes = value.bytes; + } else { + this.bytes.concat(value.toByteString()); + } + isDirty = false; + } + + public void setByteString(ByteString bytes, ExtensionRegistryLite extensionRegistry) { + this.bytes = bytes; + this.extensionRegistry = extensionRegistry; + isDirty = false; + } + + public ExtensionRegistryLite getExtensionRegistry() { + return extensionRegistry; + } + + /** + * Due to the optional field can be duplicated at the end of serialized + * bytes, which will make the serialized size changed after LazyField + * parsed. Be careful when using this method. + */ + public int getSerializedSize() { + if (isDirty) { + return value.getSerializedSize(); + } + return bytes.size(); + } + + public ByteString toByteString() { + if (!isDirty) { + return bytes; + } + synchronized (this) { + if (!isDirty) { + return bytes; + } + if (value == null) { + bytes = ByteString.EMPTY; + } else { + bytes = value.toByteString(); + } + isDirty = false; + return bytes; + } + } + + protected void ensureInitialized(MessageLite defaultInstance) { + if (value != null) { + return; + } + synchronized (this) { + if (value != null) { + return; + } + try { + if (bytes != null) { + value = defaultInstance.getParserForType() + .parseFrom(bytes, extensionRegistry); + } else { + value = defaultInstance; + } + } catch (IOException e) { + // TODO(xiangl): Refactory the API to support the exception thrown from + // lazily load messages. + } + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/LazyStringArrayList.java b/retrofit/src/main/java/com/google/protobuf/LazyStringArrayList.java new file mode 100644 index 0000000000..61c7e1ea5f --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/LazyStringArrayList.java @@ -0,0 +1,367 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.RandomAccess; + +/** + * An implementation of {@link LazyStringList} that wraps an ArrayList. Each + * element is one of String, ByteString, or byte[]. It caches the last one + * requested which is most likely the one needed next. This minimizes memory + * usage while satisfying the most common use cases. + *

+ * Note that this implementation is not synchronized. + * If multiple threads access an ArrayList instance concurrently, + * and at least one of the threads modifies the list structurally, it + * must be synchronized externally. (A structural modification is + * any operation that adds or deletes one or more elements, or explicitly + * resizes the backing array; merely setting the value of an element is not + * a structural modification.) This is typically accomplished by + * synchronizing on some object that naturally encapsulates the list. + *

+ * If the implementation is accessed via concurrent reads, this is thread safe. + * Conversions are done in a thread safe manner. It's possible that the + * conversion may happen more than once if two threads attempt to access the + * same element and the modifications were not visible to each other, but this + * will not result in any corruption of the list or change in behavior other + * than performance. + * + * @author jonp@google.com (Jon Perlow) + */ +public class LazyStringArrayList extends AbstractList + implements LazyStringList, RandomAccess { + + public static final LazyStringList EMPTY = + new LazyStringArrayList().getUnmodifiableView(); + + private final List list; + + public LazyStringArrayList() { + list = new ArrayList(); + } + + public LazyStringArrayList(LazyStringList from) { + list = new ArrayList(from.size()); + addAll(from); + } + + public LazyStringArrayList(List from) { + list = new ArrayList(from); + } + + @Override + public String get(int index) { + Object o = list.get(index); + if (o instanceof String) { + return (String) o; + } else if (o instanceof ByteString) { + ByteString bs = (ByteString) o; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + list.set(index, s); + } + return s; + } else { + byte[] ba = (byte[]) o; + String s = Internal.toStringUtf8(ba); + if (Internal.isValidUtf8(ba)) { + list.set(index, s); + } + return s; + } + } + + @Override + public int size() { + return list.size(); + } + + @Override + public String set(int index, String s) { + Object o = list.set(index, s); + return asString(o); + } + + @Override + public void add(int index, String element) { + list.add(index, element); + modCount++; + } + + @Override + public boolean addAll(Collection c) { + // The default implementation of AbstractCollection.addAll(Collection) + // delegates to add(Object). This implementation instead delegates to + // addAll(int, Collection), which makes a special case for Collections + // which are instances of LazyStringList. + return addAll(size(), c); + } + + @Override + public boolean addAll(int index, Collection c) { + // When copying from another LazyStringList, directly copy the underlying + // elements rather than forcing each element to be decoded to a String. + Collection collection = c instanceof LazyStringList + ? ((LazyStringList) c).getUnderlyingElements() : c; + boolean ret = list.addAll(index, collection); + modCount++; + return ret; + } + + // @Override + public boolean addAllByteString(Collection values) { + boolean ret = list.addAll(values); + modCount++; + return ret; + } + + // @Override + public boolean addAllByteArray(Collection c) { + boolean ret = list.addAll(c); + modCount++; + return ret; + } + + @Override + public String remove(int index) { + Object o = list.remove(index); + modCount++; + return asString(o); + } + + @Override + public void clear() { + list.clear(); + modCount++; + } + + // @Override + public void add(ByteString element) { + list.add(element); + modCount++; + } + + // @Override + public void add(byte[] element) { + list.add(element); + modCount++; + } + + // @Override + public ByteString getByteString(int index) { + Object o = list.get(index); + ByteString b = asByteString(o); + if (b != o) { + list.set(index, b); + } + return b; + } + + // @Override + public byte[] getByteArray(int index) { + Object o = list.get(index); + byte[] b = asByteArray(o); + if (b != o) { + list.set(index, b); + } + return b; + } + + // @Override + public void set(int index, ByteString s) { + list.set(index, s); + } + + // @Override + public void set(int index, byte[] s) { + list.set(index, s); + } + + + private static String asString(Object o) { + if (o instanceof String) { + return (String) o; + } else if (o instanceof ByteString) { + return ((ByteString) o).toStringUtf8(); + } else { + return Internal.toStringUtf8((byte[]) o); + } + } + + private static ByteString asByteString(Object o) { + if (o instanceof ByteString) { + return (ByteString) o; + } else if (o instanceof String) { + return ByteString.copyFromUtf8((String) o); + } else { + return ByteString.copyFrom((byte[]) o); + } + } + + private static byte[] asByteArray(Object o) { + if (o instanceof byte[]) { + return (byte[]) o; + } else if (o instanceof String) { + return Internal.toByteArray((String) o); + } else { + return ((ByteString) o).toByteArray(); + } + } + + // @Override + public List getUnderlyingElements() { + return Collections.unmodifiableList(list); + } + + // @Override + public void mergeFrom(LazyStringList other) { + for (Object o : other.getUnderlyingElements()) { + if (o instanceof byte[]) { + byte[] b = (byte[]) o; + // Byte array's content is mutable so they should be copied rather than + // shared when merging from one message to another. + list.add(Arrays.copyOf(b, b.length)); + } else { + list.add(o); + } + } + } + + private static class ByteArrayListView extends AbstractList + implements RandomAccess { + private final List list; + + ByteArrayListView(List list) { + this.list = list; + } + + @Override + public byte[] get(int index) { + Object o = list.get(index); + byte[] b = asByteArray(o); + if (b != o) { + list.set(index, b); + } + return b; + } + + @Override + public int size() { + return list.size(); + } + + @Override + public byte[] set(int index, byte[] s) { + Object o = list.set(index, s); + modCount++; + return asByteArray(o); + } + + @Override + public void add(int index, byte[] s) { + list.add(index, s); + modCount++; + } + + @Override + public byte[] remove(int index) { + Object o = list.remove(index); + modCount++; + return asByteArray(o); + } + } + + // @Override + public List asByteArrayList() { + return new ByteArrayListView(list); + } + + private static class ByteStringListView extends AbstractList + implements RandomAccess { + private final List list; + + ByteStringListView(List list) { + this.list = list; + } + + @Override + public ByteString get(int index) { + Object o = list.get(index); + ByteString b = asByteString(o); + if (b != o) { + list.set(index, b); + } + return b; + } + + @Override + public int size() { + return list.size(); + } + + @Override + public ByteString set(int index, ByteString s) { + Object o = list.set(index, s); + modCount++; + return asByteString(o); + } + + @Override + public void add(int index, ByteString s) { + list.add(index, s); + modCount++; + } + + @Override + public ByteString remove(int index) { + Object o = list.remove(index); + modCount++; + return asByteString(o); + } + } + + // @Override + public List asByteStringList() { + return new ByteStringListView(list); + } + + // @Override + public LazyStringList getUnmodifiableView() { + return new UnmodifiableLazyStringList(this); + } + +} diff --git a/retrofit/src/main/java/com/google/protobuf/LazyStringList.java b/retrofit/src/main/java/com/google/protobuf/LazyStringList.java new file mode 100644 index 0000000000..235126b685 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/LazyStringList.java @@ -0,0 +1,163 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.Collection; +import java.util.List; + +/** + * An interface extending {@code List} that also provides access to the + * items of the list as UTF8-encoded ByteString or byte[] objects. This is + * used by the protocol buffer implementation to support lazily converting bytes + * parsed over the wire to String objects until needed and also increases the + * efficiency of serialization if the String was never requested as the + * ByteString or byte[] is already cached. The ByteString methods are used in + * immutable API only and byte[] methods used in mutable API only for they use + * different representations for string/bytes fields. + * + * @author jonp@google.com (Jon Perlow) + */ +public interface LazyStringList extends ProtocolStringList { + + /** + * Returns the element at the specified position in this list as a ByteString. + * + * @param index index of the element to return + * @return the element at the specified position in this list + * @throws IndexOutOfBoundsException if the index is out of range + * ({@code index < 0 || index >= size()}) + */ + ByteString getByteString(int index); + + /** + * Returns the element at the specified position in this list as byte[]. + * + * @param index index of the element to return + * @return the element at the specified position in this list + * @throws IndexOutOfBoundsException if the index is out of range + * ({@code index < 0 || index >= size()}) + */ + byte[] getByteArray(int index); + + /** + * Appends the specified element to the end of this list (optional + * operation). + * + * @param element element to be appended to this list + * @throws UnsupportedOperationException if the add operation + * is not supported by this list + */ + void add(ByteString element); + + /** + * Appends the specified element to the end of this list (optional + * operation). + * + * @param element element to be appended to this list + * @throws UnsupportedOperationException if the add operation + * is not supported by this list + */ + void add(byte[] element); + + /** + * Replaces the element at the specified position in this list with the + * specified element (optional operation). + * + * @param index index of the element to replace + * @param element the element to be stored at the specified position + * @throws UnsupportedOperationException if the set operation + * is not supported by this list + * IndexOutOfBoundsException if the index is out of range + * ({@code index < 0 || index >= size()}) + */ + void set(int index, ByteString element); + + /** + * Replaces the element at the specified position in this list with the + * specified element (optional operation). + * + * @param index index of the element to replace + * @param element the element to be stored at the specified position + * @throws UnsupportedOperationException if the set operation + * is not supported by this list + * IndexOutOfBoundsException if the index is out of range + * ({@code index < 0 || index >= size()}) + */ + void set(int index, byte[] element); + + /** + * Appends all elements in the specified ByteString collection to the end of + * this list. + * + * @param c collection whose elements are to be added to this list + * @return true if this list changed as a result of the call + * @throws UnsupportedOperationException if the addAllByteString + * operation is not supported by this list + */ + boolean addAllByteString(Collection c); + + /** + * Appends all elements in the specified byte[] collection to the end of + * this list. + * + * @param c collection whose elements are to be added to this list + * @return true if this list changed as a result of the call + * @throws UnsupportedOperationException if the addAllByteArray + * operation is not supported by this list + */ + boolean addAllByteArray(Collection c); + + /** + * Returns an unmodifiable List of the underlying elements, each of which is + * either a {@code String} or its equivalent UTF-8 encoded {@code ByteString} + * or byte[]. It is an error for the caller to modify the returned + * List, and attempting to do so will result in an + * {@link UnsupportedOperationException}. + */ + List getUnderlyingElements(); + + /** + * Merges all elements from another LazyStringList into this one. This method + * differs from {@link #addAll(Collection)} on that underlying byte arrays are + * copied instead of reference shared. Immutable API doesn't need to use this + * method as byte[] is not used there at all. + */ + void mergeFrom(LazyStringList other); + + /** + * Returns a mutable view of this list. Changes to the view will be made into + * the original list. This method is used in mutable API only. + */ + List asByteArrayList(); + + /** Returns an unmodifiable view of the list. */ + LazyStringList getUnmodifiableView(); +} diff --git a/retrofit/src/main/java/com/google/protobuf/LiteralByteString.java b/retrofit/src/main/java/com/google/protobuf/LiteralByteString.java new file mode 100644 index 0000000000..83e71e9333 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/LiteralByteString.java @@ -0,0 +1,362 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * This class implements a {@link com.google.protobuf.ByteString} backed by a + * single array of bytes, contiguous in memory. It supports substring by + * pointing to only a sub-range of the underlying byte array, meaning that a + * substring will reference the full byte-array of the string it's made from, + * exactly as with {@link String}. + * + * @author carlanton@google.com (Carl Haverl) + */ +class LiteralByteString extends ByteString { + + protected final byte[] bytes; + + /** + * Creates a {@code LiteralByteString} backed by the given array, without + * copying. + * + * @param bytes array to wrap + */ + LiteralByteString(byte[] bytes) { + this.bytes = bytes; + } + + @Override + public byte byteAt(int index) { + // Unlike most methods in this class, this one is a direct implementation + // ignoring the potential offset because we need to do range-checking in the + // substring case anyway. + return bytes[index]; + } + + @Override + public int size() { + return bytes.length; + } + + // ================================================================= + // ByteString -> substring + + @Override + public ByteString substring(int beginIndex, int endIndex) { + if (beginIndex < 0) { + throw new IndexOutOfBoundsException( + "Beginning index: " + beginIndex + " < 0"); + } + if (endIndex > size()) { + throw new IndexOutOfBoundsException("End index: " + endIndex + " > " + + size()); + } + int substringLength = endIndex - beginIndex; + if (substringLength < 0) { + throw new IndexOutOfBoundsException( + "Beginning index larger than ending index: " + beginIndex + ", " + + endIndex); + } + + ByteString result; + if (substringLength == 0) { + result = ByteString.EMPTY; + } else { + result = new BoundedByteString(bytes, getOffsetIntoBytes() + beginIndex, + substringLength); + } + return result; + } + + // ================================================================= + // ByteString -> byte[] + + @Override + protected void copyToInternal(byte[] target, int sourceOffset, + int targetOffset, int numberToCopy) { + // Optimized form, not for subclasses, since we don't call + // getOffsetIntoBytes() or check the 'numberToCopy' parameter. + System.arraycopy(bytes, sourceOffset, target, targetOffset, numberToCopy); + } + + @Override + public void copyTo(ByteBuffer target) { + target.put(bytes, getOffsetIntoBytes(), size()); // Copies bytes + } + + @Override + public ByteBuffer asReadOnlyByteBuffer() { + ByteBuffer byteBuffer = + ByteBuffer.wrap(bytes, getOffsetIntoBytes(), size()); + return byteBuffer.asReadOnlyBuffer(); + } + + @Override + public List asReadOnlyByteBufferList() { + // Return the ByteBuffer generated by asReadOnlyByteBuffer() as a singleton + List result = new ArrayList(1); + result.add(asReadOnlyByteBuffer()); + return result; + } + + @Override + public void writeTo(OutputStream outputStream) throws IOException { + outputStream.write(toByteArray()); + } + + @Override + void writeToInternal(OutputStream outputStream, int sourceOffset, + int numberToWrite) throws IOException { + outputStream.write(bytes, getOffsetIntoBytes() + sourceOffset, + numberToWrite); + } + + @Override + public String toString(String charsetName) + throws UnsupportedEncodingException { + return new String(bytes, getOffsetIntoBytes(), size(), charsetName); + } + + // ================================================================= + // UTF-8 decoding + + @Override + public boolean isValidUtf8() { + int offset = getOffsetIntoBytes(); + return Utf8.isValidUtf8(bytes, offset, offset + size()); + } + + @Override + protected int partialIsValidUtf8(int state, int offset, int length) { + int index = getOffsetIntoBytes() + offset; + return Utf8.partialIsValidUtf8(state, bytes, index, index + length); + } + + // ================================================================= + // equals() and hashCode() + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if (!(other instanceof ByteString)) { + return false; + } + + if (size() != ((ByteString) other).size()) { + return false; + } + if (size() == 0) { + return true; + } + + if (other instanceof LiteralByteString) { + return equalsRange((LiteralByteString) other, 0, size()); + } else if (other instanceof RopeByteString) { + return other.equals(this); + } else { + throw new IllegalArgumentException( + "Has a new type of ByteString been created? Found " + + other.getClass()); + } + } + + /** + * Check equality of the substring of given length of this object starting at + * zero with another {@code LiteralByteString} substring starting at offset. + * + * @param other what to compare a substring in + * @param offset offset into other + * @param length number of bytes to compare + * @return true for equality of substrings, else false. + */ + boolean equalsRange(LiteralByteString other, int offset, int length) { + if (length > other.size()) { + throw new IllegalArgumentException( + "Length too large: " + length + size()); + } + if (offset + length > other.size()) { + throw new IllegalArgumentException( + "Ran off end of other: " + offset + ", " + length + ", " + + other.size()); + } + + byte[] thisBytes = bytes; + byte[] otherBytes = other.bytes; + int thisLimit = getOffsetIntoBytes() + length; + for (int thisIndex = getOffsetIntoBytes(), otherIndex = + other.getOffsetIntoBytes() + offset; + (thisIndex < thisLimit); ++thisIndex, ++otherIndex) { + if (thisBytes[thisIndex] != otherBytes[otherIndex]) { + return false; + } + } + return true; + } + + /** + * Cached hash value. Intentionally accessed via a data race, which + * is safe because of the Java Memory Model's "no out-of-thin-air values" + * guarantees for ints. + */ + private int hash = 0; + + /** + * Compute the hashCode using the traditional algorithm from {@link + * ByteString}. + * + * @return hashCode value + */ + @Override + public int hashCode() { + int h = hash; + + if (h == 0) { + int size = size(); + h = partialHash(size, 0, size); + if (h == 0) { + h = 1; + } + hash = h; + } + return h; + } + + @Override + protected int peekCachedHashCode() { + return hash; + } + + @Override + protected int partialHash(int h, int offset, int length) { + return hashCode(h, bytes, getOffsetIntoBytes() + offset, length); + } + + static int hashCode(int h, byte[] bytes, int offset, int length) { + for (int i = offset; i < offset + length; i++) { + h = h * 31 + bytes[i]; + } + return h; + } + + static int hashCode(byte[] bytes) { + int h = hashCode(bytes.length, bytes, 0, bytes.length); + return h == 0 ? 1 : h; + } + + // ================================================================= + // Input stream + + @Override + public InputStream newInput() { + return new ByteArrayInputStream(bytes, getOffsetIntoBytes(), + size()); // No copy + } + + @Override + public CodedInputStream newCodedInput() { + // We trust CodedInputStream not to modify the bytes, or to give anyone + // else access to them. + return CodedInputStream.newInstance(this); + } + + // ================================================================= + // ByteIterator + + @Override + public ByteIterator iterator() { + return new LiteralByteIterator(); + } + + private class LiteralByteIterator implements ByteIterator { + private int position; + private final int limit; + + private LiteralByteIterator() { + position = 0; + limit = size(); + } + + public boolean hasNext() { + return (position < limit); + } + + public Byte next() { + // Boxing calls Byte.valueOf(byte), which does not instantiate. + return nextByte(); + } + + public byte nextByte() { + try { + return bytes[position++]; + } catch (ArrayIndexOutOfBoundsException e) { + throw new NoSuchElementException(e.getMessage()); + } + } + + public void remove() { + throw new UnsupportedOperationException(); + } + } + + // ================================================================= + // Internal methods + + @Override + protected int getTreeDepth() { + return 0; + } + + @Override + protected boolean isBalanced() { + return true; + } + + /** + * Offset into {@code bytes[]} to use, non-zero for substrings. + * + * @return always 0 for this class + */ + protected int getOffsetIntoBytes() { + return 0; + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/MessageLite.java b/retrofit/src/main/java/com/google/protobuf/MessageLite.java new file mode 100644 index 0000000000..798b79439c --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/MessageLite.java @@ -0,0 +1,320 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// TODO(kenton): Use generics? E.g. Builder, then +// mergeFrom*() could return BuilderType for better type-safety. + +package com.google.protobuf; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * Abstract interface implemented by Protocol Message objects. + * + *

This interface is implemented by all protocol message objects. Non-lite + * messages additionally implement the Message interface, which is a subclass + * of MessageLite. Use MessageLite instead when you only need the subset of + * features which it supports -- namely, nothing that uses descriptors or + * reflection. You can instruct the protocol compiler to generate classes + * which implement only MessageLite, not the full Message interface, by adding + * the follow line to the .proto file: + *

+ *   option optimize_for = LITE_RUNTIME;
+ * 
+ * + *

This is particularly useful on resource-constrained systems where the + * full protocol buffers runtime library is too big. + * + *

Note that on non-constrained systems (e.g. servers) when you need to link + * in lots of protocol definitions, a better way to reduce total code footprint + * is to use {@code optimize_for = CODE_SIZE}. This will make the generated + * code smaller while still supporting all the same features (at the expense of + * speed). {@code optimize_for = LITE_RUNTIME} is best when you only have a + * small number of message types linked into your binary, in which case the + * size of the protocol buffers runtime itself is the biggest problem. + * + * @author kenton@google.com Kenton Varda + */ +public interface MessageLite extends MessageLiteOrBuilder { + + + /** + * Serializes the message and writes it to {@code output}. This does not + * flush or close the stream. + */ + void writeTo(CodedOutputStream output) throws IOException; + + /** + * Get the number of bytes required to encode this message. The result + * is only computed on the first call and memoized after that. + */ + int getSerializedSize(); + + + /** + * Gets the parser for a message of the same type as this message. + */ + Parser getParserForType(); + + // ----------------------------------------------------------------- + // Convenience methods. + + /** + * Serializes the message to a {@code ByteString} and returns it. This is + * just a trivial wrapper around + * {@link #writeTo(CodedOutputStream)}. + */ + ByteString toByteString(); + + /** + * Serializes the message to a {@code byte} array and returns it. This is + * just a trivial wrapper around + * {@link #writeTo(CodedOutputStream)}. + */ + byte[] toByteArray(); + + /** + * Serializes the message and writes it to {@code output}. This is just a + * trivial wrapper around {@link #writeTo(CodedOutputStream)}. This does + * not flush or close the stream. + *

+ * NOTE: Protocol Buffers are not self-delimiting. Therefore, if you write + * any more data to the stream after the message, you must somehow ensure + * that the parser on the receiving end does not interpret this as being + * part of the protocol message. This can be done e.g. by writing the size + * of the message before the data, then making sure to limit the input to + * that size on the receiving end (e.g. by wrapping the InputStream in one + * which limits the input). Alternatively, just use + * {@link #writeDelimitedTo(OutputStream)}. + */ + void writeTo(OutputStream output) throws IOException; + + /** + * Like {@link #writeTo(OutputStream)}, but writes the size of the message + * as a varint before writing the data. This allows more data to be written + * to the stream after the message without the need to delimit the message + * data yourself. Use {@link Builder#mergeDelimitedFrom(InputStream)} (or + * the static method {@code YourMessageType.parseDelimitedFrom(InputStream)}) + * to parse messages written by this method. + */ + void writeDelimitedTo(OutputStream output) throws IOException; + + + // ================================================================= + // Builders + + /** + * Constructs a new builder for a message of the same type as this message. + */ + Builder newBuilderForType(); + + /** + * Constructs a builder initialized with the current message. Use this to + * derive a new message from the current one. + */ + Builder toBuilder(); + + /** + * Abstract interface implemented by Protocol Message builders. + */ + interface Builder extends MessageLiteOrBuilder, Cloneable { + /** Resets all fields to their default values. */ + Builder clear(); + + /** + * Constructs the message based on the state of the Builder. Subsequent + * changes to the Builder will not affect the returned message. + * @throws UninitializedMessageException The message is missing one or more + * required fields (i.e. {@link #isInitialized()} returns false). + * Use {@link #buildPartial()} to bypass this check. + */ + MessageLite build(); + + /** + * Like {@link #build()}, but does not throw an exception if the message + * is missing required fields. Instead, a partial message is returned. + * Subsequent changes to the Builder will not affect the returned message. + */ + MessageLite buildPartial(); + + /** + * Clones the Builder. + * @see Object#clone() + */ + Builder clone(); + + /** + * Parses a message of this type from the input and merges it with this + * message. + * + *

Warning: This does not verify that all required fields are present in + * the input message. If you call {@link #build()} without setting all + * required fields, it will throw an {@link UninitializedMessageException}, + * which is a {@code RuntimeException} and thus might not be caught. There + * are a few good ways to deal with this: + *

    + *
  • Call {@link #isInitialized()} to verify that all required fields + * are set before building. + *
  • Use {@code buildPartial()} to build, which ignores missing + * required fields. + *
+ * + *

Note: The caller should call + * {@link CodedInputStream#checkLastTagWas(int)} after calling this to + * verify that the last tag seen was the appropriate end-group tag, + * or zero for EOF. + */ + Builder mergeFrom(CodedInputStream input) throws IOException; + + /** + * Like {@link Builder#mergeFrom(CodedInputStream)}, but also + * parses extensions. The extensions that you want to be able to parse + * must be registered in {@code extensionRegistry}. Extensions not in + * the registry will be treated as unknown fields. + */ + Builder mergeFrom(CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws IOException; + + // --------------------------------------------------------------- + // Convenience methods. + + /** + * Parse {@code data} as a message of this type and merge it with the + * message being built. This is just a small wrapper around + * {@link #mergeFrom(CodedInputStream)}. + * + * @return this + */ + Builder mergeFrom(ByteString data) throws InvalidProtocolBufferException; + + /** + * Parse {@code data} as a message of this type and merge it with the + * message being built. This is just a small wrapper around + * {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. + * + * @return this + */ + Builder mergeFrom(ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Parse {@code data} as a message of this type and merge it with the + * message being built. This is just a small wrapper around + * {@link #mergeFrom(CodedInputStream)}. + * + * @return this + */ + Builder mergeFrom(byte[] data) throws InvalidProtocolBufferException; + + /** + * Parse {@code data} as a message of this type and merge it with the + * message being built. This is just a small wrapper around + * {@link #mergeFrom(CodedInputStream)}. + * + * @return this + */ + Builder mergeFrom(byte[] data, int off, int len) + throws InvalidProtocolBufferException; + + /** + * Parse {@code data} as a message of this type and merge it with the + * message being built. This is just a small wrapper around + * {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. + * + * @return this + */ + Builder mergeFrom(byte[] data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Parse {@code data} as a message of this type and merge it with the + * message being built. This is just a small wrapper around + * {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. + * + * @return this + */ + Builder mergeFrom(byte[] data, int off, int len, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Parse a message of this type from {@code input} and merge it with the + * message being built. This is just a small wrapper around + * {@link #mergeFrom(CodedInputStream)}. Note that this method always + * reads the entire input (unless it throws an exception). If you + * want it to stop earlier, you will need to wrap your input in some + * wrapper stream that limits reading. Or, use + * {@link MessageLite#writeDelimitedTo(OutputStream)} to write your message + * and {@link #mergeDelimitedFrom(InputStream)} to read it. + *

+ * Despite usually reading the entire input, this does not close the stream. + * + * @return this + */ + Builder mergeFrom(InputStream input) throws IOException; + + /** + * Parse a message of this type from {@code input} and merge it with the + * message being built. This is just a small wrapper around + * {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. + * + * @return this + */ + Builder mergeFrom(InputStream input, + ExtensionRegistryLite extensionRegistry) + throws IOException; + + /** + * Like {@link #mergeFrom(InputStream)}, but does not read until EOF. + * Instead, the size of the message (encoded as a varint) is read first, + * then the message data. Use + * {@link MessageLite#writeDelimitedTo(OutputStream)} to write messages in + * this format. + * + * @return True if successful, or false if the stream is at EOF when the + * method starts. Any other error (including reaching EOF during + * parsing) will cause an exception to be thrown. + */ + boolean mergeDelimitedFrom(InputStream input) + throws IOException; + + /** + * Like {@link #mergeDelimitedFrom(InputStream)} but supporting extensions. + */ + boolean mergeDelimitedFrom(InputStream input, + ExtensionRegistryLite extensionRegistry) + throws IOException; + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java b/retrofit/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java new file mode 100644 index 0000000000..818386ce58 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java @@ -0,0 +1,60 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +/** + * Base interface for methods common to {@link MessageLite} + * and {@link MessageLite.Builder} to provide type equivalency. + * + * @author jonp@google.com (Jon Perlow) + */ +public interface MessageLiteOrBuilder { + /** + * Get an instance of the type with no fields set. Because no fields are set, + * all getters for singular fields will return default values and repeated + * fields will appear empty. + * This may or may not be a singleton. This differs from the + * {@code getDefaultInstance()} method of generated message classes in that + * this method is an abstract method of the {@code MessageLite} interface + * whereas {@code getDefaultInstance()} is a static method of a specific + * class. They return the same thing. + */ + MessageLite getDefaultInstanceForType(); + + /** + * Returns true if all required fields in the message and all embedded + * messages are set, false otherwise. + * + *

See also: {@link MessageOrBuilder#getInitializationErrorString()} + */ + boolean isInitialized(); + +} diff --git a/retrofit/src/main/java/com/google/protobuf/Parser.java b/retrofit/src/main/java/com/google/protobuf/Parser.java new file mode 100644 index 0000000000..f636014b5a --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/Parser.java @@ -0,0 +1,261 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.InputStream; + +/** + * Abstract interface for parsing Protocol Messages. + * + * The implementation should be stateless and thread-safe. + * + * @author liujisi@google.com (Pherl Liu) + */ +public interface Parser { + /** + * Parses a message of {@code MessageType} from the input. + * + *

Note: The caller should call + * {@link CodedInputStream#checkLastTagWas(int)} after calling this to + * verify that the last tag seen was the appropriate end-group tag, + * or zero for EOF. + */ + public MessageType parseFrom(CodedInputStream input) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(CodedInputStream)}, but also parses extensions. + * The extensions that you want to be able to parse must be registered in + * {@code extensionRegistry}. Extensions not in the registry will be treated + * as unknown fields. + */ + public MessageType parseFrom(CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(CodedInputStream)}, but does not throw an + * exception if the message is missing required fields. Instead, a partial + * message is returned. + */ + public MessageType parsePartialFrom(CodedInputStream input) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(CodedInputStream input, ExtensionRegistryLite)}, + * but does not throw an exception if the message is missing required fields. + * Instead, a partial message is returned. + */ + public MessageType parsePartialFrom(CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + // --------------------------------------------------------------- + // Convenience methods. + + /** + * Parses {@code data} as a message of {@code MessageType}. + * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. + */ + public MessageType parseFrom(ByteString data) + throws InvalidProtocolBufferException; + + /** + * Parses {@code data} as a message of {@code MessageType}. + * This is just a small wrapper around + * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}. + */ + public MessageType parseFrom(ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(ByteString)}, but does not throw an + * exception if the message is missing required fields. Instead, a partial + * message is returned. + */ + public MessageType parsePartialFrom(ByteString data) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(ByteString, ExtensionRegistryLite)}, + * but does not throw an exception if the message is missing required fields. + * Instead, a partial message is returned. + */ + public MessageType parsePartialFrom(ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Parses {@code data} as a message of {@code MessageType}. + * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. + */ + public MessageType parseFrom(byte[] data, int off, int len) + throws InvalidProtocolBufferException; + + /** + * Parses {@code data} as a message of {@code MessageType}. + * This is just a small wrapper around + * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}. + */ + public MessageType parseFrom(byte[] data, int off, int len, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Parses {@code data} as a message of {@code MessageType}. + * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. + */ + public MessageType parseFrom(byte[] data) + throws InvalidProtocolBufferException; + + /** + * Parses {@code data} as a message of {@code MessageType}. + * This is just a small wrapper around + * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}. + */ + public MessageType parseFrom(byte[] data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(byte[], int, int)}, but does not throw an + * exception if the message is missing required fields. Instead, a partial + * message is returned. + */ + public MessageType parsePartialFrom(byte[] data, int off, int len) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(ByteString, ExtensionRegistryLite)}, + * but does not throw an exception if the message is missing required fields. + * Instead, a partial message is returned. + */ + public MessageType parsePartialFrom(byte[] data, int off, int len, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(byte[])}, but does not throw an + * exception if the message is missing required fields. Instead, a partial + * message is returned. + */ + public MessageType parsePartialFrom(byte[] data) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(byte[], ExtensionRegistryLite)}, + * but does not throw an exception if the message is missing required fields. + * Instead, a partial message is returned. + */ + public MessageType parsePartialFrom(byte[] data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Parse a message of {@code MessageType} from {@code input}. + * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. + * Note that this method always reads the entire input (unless it + * throws an exception). If you want it to stop earlier, you will need to + * wrap your input in some wrapper stream that limits reading. Or, use + * {@link MessageLite#writeDelimitedTo(java.io.OutputStream)} to write your + * message and {@link #parseDelimitedFrom(InputStream)} to read it. + *

+ * Despite usually reading the entire input, this does not close the stream. + */ + public MessageType parseFrom(InputStream input) + throws InvalidProtocolBufferException; + + /** + * Parses a message of {@code MessageType} from {@code input}. + * This is just a small wrapper around + * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}. + */ + public MessageType parseFrom(InputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(InputStream)}, but does not throw an + * exception if the message is missing required fields. Instead, a partial + * message is returned. + */ + public MessageType parsePartialFrom(InputStream input) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(InputStream, ExtensionRegistryLite)}, + * but does not throw an exception if the message is missing required fields. + * Instead, a partial message is returned. + */ + public MessageType parsePartialFrom(InputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseFrom(InputStream)}, but does not read util EOF. + * Instead, the size of message (encoded as a varint) is read first, + * then the message data. Use + * {@link MessageLite#writeDelimitedTo(java.io.OutputStream)} to write + * messages in this format. + * + * @return True if successful, or false if the stream is at EOF when the + * method starts. Any other error (including reaching EOF during + * parsing) will cause an exception to be thrown. + */ + public MessageType parseDelimitedFrom(InputStream input) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseDelimitedFrom(InputStream)} but supporting extensions. + */ + public MessageType parseDelimitedFrom(InputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseDelimitedFrom(InputStream)}, but does not throw an + * exception if the message is missing required fields. Instead, a partial + * message is returned. + */ + public MessageType parsePartialDelimitedFrom(InputStream input) + throws InvalidProtocolBufferException; + + /** + * Like {@link #parseDelimitedFrom(InputStream, ExtensionRegistryLite)}, + * but does not throw an exception if the message is missing required fields. + * Instead, a partial message is returned. + */ + public MessageType parsePartialDelimitedFrom( + InputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException; +} diff --git a/retrofit/src/main/java/com/google/protobuf/ProtocolStringList.java b/retrofit/src/main/java/com/google/protobuf/ProtocolStringList.java new file mode 100644 index 0000000000..d553b41e52 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/ProtocolStringList.java @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.List; + +/** + * An interface extending {@code List} used for repeated string fields + * to provide optional access to the data as a list of ByteStrings. The + * underlying implementation stores values as either ByteStrings or Strings + * (see {@link LazyStringArrayList}) depending on how the value was initialized + * or last read, and it is often more efficient to deal with lists of + * ByteStrings when handling protos that have been deserialized from bytes. + */ +public interface ProtocolStringList extends List { + + /** Returns a view of the data as a list of ByteStrings. */ + List asByteStringList(); + +} diff --git a/retrofit/src/main/java/com/google/protobuf/RopeByteString.java b/retrofit/src/main/java/com/google/protobuf/RopeByteString.java new file mode 100644 index 0000000000..d1655b80a9 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/RopeByteString.java @@ -0,0 +1,957 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.io.ByteArrayInputStream; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Stack; + +/** + * Class to represent {@code ByteStrings} formed by concatenation of other + * ByteStrings, without copying the data in the pieces. The concatenation is + * represented as a tree whose leaf nodes are each a {@link LiteralByteString}. + * + *

Most of the operation here is inspired by the now-famous paper + * BAP95 Ropes: an Alternative to Strings hans-j. boehm, russ atkinson and + * michael plass + * + *

The algorithms described in the paper have been implemented for character + * strings in {@link com.google.common.string.Rope} and in the c++ class {@code + * cord.cc}. + * + *

Fundamentally the Rope algorithm represents the collection of pieces as a + * binary tree. BAP95 uses a Fibonacci bound relating depth to a minimum + * sequence length, sequences that are too short relative to their depth cause a + * tree rebalance. More precisely, a tree of depth d is "balanced" in the + * terminology of BAP95 if its length is at least F(d+2), where F(n) is the + * n-the Fibonacci number. Thus for depths 0, 1, 2, 3, 4, 5,... we have minimum + * lengths 1, 2, 3, 5, 8, 13,... + * + * @author carlanton@google.com (Carl Haverl) + */ +class RopeByteString extends ByteString { + + /** + * BAP95. Let Fn be the nth Fibonacci number. A {@link RopeByteString} of + * depth n is "balanced", i.e flat enough, if its length is at least Fn+2, + * e.g. a "balanced" {@link RopeByteString} of depth 1 must have length at + * least 2, of depth 4 must have length >= 8, etc. + * + *

There's nothing special about using the Fibonacci numbers for this, but + * they are a reasonable sequence for encapsulating the idea that we are OK + * with longer strings being encoded in deeper binary trees. + * + *

For 32-bit integers, this array has length 46. + */ + private static final int[] minLengthByDepth; + + static { + // Dynamically generate the list of Fibonacci numbers the first time this + // class is accessed. + List numbers = new ArrayList(); + + // we skip the first Fibonacci number (1). So instead of: 1 1 2 3 5 8 ... + // we have: 1 2 3 5 8 ... + int f1 = 1; + int f2 = 1; + + // get all the values until we roll over. + while (f2 > 0) { + numbers.add(f2); + int temp = f1 + f2; + f1 = f2; + f2 = temp; + } + + // we include this here so that we can index this array to [x + 1] in the + // loops below. + numbers.add(Integer.MAX_VALUE); + minLengthByDepth = new int[numbers.size()]; + for (int i = 0; i < minLengthByDepth.length; i++) { + // unbox all the values + minLengthByDepth[i] = numbers.get(i); + } + } + + private final int totalLength; + private final ByteString left; + private final ByteString right; + private final int leftLength; + private final int treeDepth; + + /** + * Create a new RopeByteString, which can be thought of as a new tree node, by + * recording references to the two given strings. + * + * @param left string on the left of this node, should have {@code size() > + * 0} + * @param right string on the right of this node, should have {@code size() > + * 0} + */ + private RopeByteString(ByteString left, ByteString right) { + this.left = left; + this.right = right; + leftLength = left.size(); + totalLength = leftLength + right.size(); + treeDepth = Math.max(left.getTreeDepth(), right.getTreeDepth()) + 1; + } + + /** + * Concatenate the given strings while performing various optimizations to + * slow the growth rate of tree depth and tree node count. The result is + * either a {@link LiteralByteString} or a {@link RopeByteString} + * depending on which optimizations, if any, were applied. + * + *

Small pieces of length less than {@link + * ByteString#CONCATENATE_BY_COPY_SIZE} may be copied by value here, as in + * BAP95. Large pieces are referenced without copy. + * + * @param left string on the left + * @param right string on the right + * @return concatenation representing the same sequence as the given strings + */ + static ByteString concatenate(ByteString left, ByteString right) { + ByteString result; + RopeByteString leftRope = + (left instanceof RopeByteString) ? (RopeByteString) left : null; + if (right.size() == 0) { + result = left; + } else if (left.size() == 0) { + result = right; + } else { + int newLength = left.size() + right.size(); + if (newLength < ByteString.CONCATENATE_BY_COPY_SIZE) { + // Optimization from BAP95: For short (leaves in paper, but just short + // here) total length, do a copy of data to a new leaf. + result = concatenateBytes(left, right); + } else if (leftRope != null + && leftRope.right.size() + right.size() < CONCATENATE_BY_COPY_SIZE) { + // Optimization from BAP95: As an optimization of the case where the + // ByteString is constructed by repeated concatenate, recognize the case + // where a short string is concatenated to a left-hand node whose + // right-hand branch is short. In the paper this applies to leaves, but + // we just look at the length here. This has the advantage of shedding + // references to unneeded data when substrings have been taken. + // + // When we recognize this case, we do a copy of the data and create a + // new parent node so that the depth of the result is the same as the + // given left tree. + ByteString newRight = concatenateBytes(leftRope.right, right); + result = new RopeByteString(leftRope.left, newRight); + } else if (leftRope != null + && leftRope.left.getTreeDepth() > leftRope.right.getTreeDepth() + && leftRope.getTreeDepth() > right.getTreeDepth()) { + // Typically for concatenate-built strings the left-side is deeper than + // the right. This is our final attempt to concatenate without + // increasing the tree depth. We'll redo the the node on the RHS. This + // is yet another optimization for building the string by repeatedly + // concatenating on the right. + ByteString newRight = new RopeByteString(leftRope.right, right); + result = new RopeByteString(leftRope.left, newRight); + } else { + // Fine, we'll add a node and increase the tree depth--unless we + // rebalance ;^) + int newDepth = Math.max(left.getTreeDepth(), right.getTreeDepth()) + 1; + if (newLength >= minLengthByDepth[newDepth]) { + // The tree is shallow enough, so don't rebalance + result = new RopeByteString(left, right); + } else { + result = new Balancer().balance(left, right); + } + } + } + return result; + } + + /** + * Concatenates two strings by copying data values. This is called in a few + * cases in order to reduce the growth of the number of tree nodes. + * + * @param left string on the left + * @param right string on the right + * @return string formed by copying data bytes + */ + private static LiteralByteString concatenateBytes(ByteString left, + ByteString right) { + int leftSize = left.size(); + int rightSize = right.size(); + byte[] bytes = new byte[leftSize + rightSize]; + left.copyTo(bytes, 0, 0, leftSize); + right.copyTo(bytes, 0, leftSize, rightSize); + return new LiteralByteString(bytes); // Constructor wraps bytes + } + + /** + * Create a new RopeByteString for testing only while bypassing all the + * defenses of {@link #concatenate(ByteString, ByteString)}. This allows + * testing trees of specific structure. We are also able to insert empty + * leaves, though these are dis-allowed, so that we can make sure the + * implementation can withstand their presence. + * + * @param left string on the left of this node + * @param right string on the right of this node + * @return an unsafe instance for testing only + */ + static RopeByteString newInstanceForTest(ByteString left, ByteString right) { + return new RopeByteString(left, right); + } + + /** + * Gets the byte at the given index. + * Throws {@link ArrayIndexOutOfBoundsException} for backwards-compatibility + * reasons although it would more properly be {@link + * IndexOutOfBoundsException}. + * + * @param index index of byte + * @return the value + * @throws ArrayIndexOutOfBoundsException {@code index} is < 0 or >= size + */ + @Override + public byte byteAt(int index) { + if (index < 0) { + throw new ArrayIndexOutOfBoundsException("Index < 0: " + index); + } + if (index > totalLength) { + throw new ArrayIndexOutOfBoundsException( + "Index > length: " + index + ", " + totalLength); + } + + byte result; + // Find the relevant piece by recursive descent + if (index < leftLength) { + result = left.byteAt(index); + } else { + result = right.byteAt(index - leftLength); + } + return result; + } + + @Override + public int size() { + return totalLength; + } + + // ================================================================= + // Pieces + + @Override + protected int getTreeDepth() { + return treeDepth; + } + + /** + * Determines if the tree is balanced according to BAP95, which means the tree + * is flat-enough with respect to the bounds. Note that this definition of + * balanced is one where sub-trees of balanced trees are not necessarily + * balanced. + * + * @return true if the tree is balanced + */ + @Override + protected boolean isBalanced() { + return totalLength >= minLengthByDepth[treeDepth]; + } + + /** + * Takes a substring of this one. This involves recursive descent along the + * left and right edges of the substring, and referencing any wholly contained + * segments in between. Any leaf nodes entirely uninvolved in the substring + * will not be referenced by the substring. + * + *

Substrings of {@code length < 2} should result in at most a single + * recursive call chain, terminating at a leaf node. Thus the result will be a + * {@link LiteralByteString}. {@link #RopeByteString(ByteString, + * ByteString)}. + * + * @param beginIndex start at this index + * @param endIndex the last character is the one before this index + * @return substring leaf node or tree + */ + @Override + public ByteString substring(int beginIndex, int endIndex) { + if (beginIndex < 0) { + throw new IndexOutOfBoundsException( + "Beginning index: " + beginIndex + " < 0"); + } + if (endIndex > totalLength) { + throw new IndexOutOfBoundsException( + "End index: " + endIndex + " > " + totalLength); + } + int substringLength = endIndex - beginIndex; + if (substringLength < 0) { + throw new IndexOutOfBoundsException( + "Beginning index larger than ending index: " + beginIndex + ", " + + endIndex); + } + + ByteString result; + if (substringLength == 0) { + // Empty substring + result = ByteString.EMPTY; + } else if (substringLength == totalLength) { + // The whole string + result = this; + } else { + // Proper substring + if (endIndex <= leftLength) { + // Substring on the left + result = left.substring(beginIndex, endIndex); + } else if (beginIndex >= leftLength) { + // Substring on the right + result = right + .substring(beginIndex - leftLength, endIndex - leftLength); + } else { + // Split substring + ByteString leftSub = left.substring(beginIndex); + ByteString rightSub = right.substring(0, endIndex - leftLength); + // Intentionally not rebalancing, since in many cases these two + // substrings will already be less deep than the top-level + // RopeByteString we're taking a substring of. + result = new RopeByteString(leftSub, rightSub); + } + } + return result; + } + + // ================================================================= + // ByteString -> byte[] + + @Override + protected void copyToInternal(byte[] target, int sourceOffset, + int targetOffset, int numberToCopy) { + if (sourceOffset + numberToCopy <= leftLength) { + left.copyToInternal(target, sourceOffset, targetOffset, numberToCopy); + } else if (sourceOffset >= leftLength) { + right.copyToInternal(target, sourceOffset - leftLength, targetOffset, + numberToCopy); + } else { + int leftLength = this.leftLength - sourceOffset; + left.copyToInternal(target, sourceOffset, targetOffset, leftLength); + right.copyToInternal(target, 0, targetOffset + leftLength, + numberToCopy - leftLength); + } + } + + @Override + public void copyTo(ByteBuffer target) { + left.copyTo(target); + right.copyTo(target); + } + + @Override + public ByteBuffer asReadOnlyByteBuffer() { + ByteBuffer byteBuffer = ByteBuffer.wrap(toByteArray()); + return byteBuffer.asReadOnlyBuffer(); + } + + @Override + public List asReadOnlyByteBufferList() { + // Walk through the list of LiteralByteString's that make up this + // rope, and add each one as a read-only ByteBuffer. + List result = new ArrayList(); + PieceIterator pieces = new PieceIterator(this); + while (pieces.hasNext()) { + LiteralByteString byteString = pieces.next(); + result.add(byteString.asReadOnlyByteBuffer()); + } + return result; + } + + @Override + public void writeTo(OutputStream outputStream) throws IOException { + left.writeTo(outputStream); + right.writeTo(outputStream); + } + + @Override + void writeToInternal(OutputStream out, int sourceOffset, + int numberToWrite) throws IOException { + if (sourceOffset + numberToWrite <= leftLength) { + left.writeToInternal(out, sourceOffset, numberToWrite); + } else if (sourceOffset >= leftLength) { + right.writeToInternal(out, sourceOffset - leftLength, numberToWrite); + } else { + int numberToWriteInLeft = leftLength - sourceOffset; + left.writeToInternal(out, sourceOffset, numberToWriteInLeft); + right.writeToInternal(out, 0, numberToWrite - numberToWriteInLeft); + } + } + + @Override + public String toString(String charsetName) + throws UnsupportedEncodingException { + return new String(toByteArray(), charsetName); + } + + // ================================================================= + // UTF-8 decoding + + @Override + public boolean isValidUtf8() { + int leftPartial = left.partialIsValidUtf8(Utf8.COMPLETE, 0, leftLength); + int state = right.partialIsValidUtf8(leftPartial, 0, right.size()); + return state == Utf8.COMPLETE; + } + + @Override + protected int partialIsValidUtf8(int state, int offset, int length) { + int toIndex = offset + length; + if (toIndex <= leftLength) { + return left.partialIsValidUtf8(state, offset, length); + } else if (offset >= leftLength) { + return right.partialIsValidUtf8(state, offset - leftLength, length); + } else { + int leftLength = this.leftLength - offset; + int leftPartial = left.partialIsValidUtf8(state, offset, leftLength); + return right.partialIsValidUtf8(leftPartial, 0, length - leftLength); + } + } + + // ================================================================= + // equals() and hashCode() + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if (!(other instanceof ByteString)) { + return false; + } + + ByteString otherByteString = (ByteString) other; + if (totalLength != otherByteString.size()) { + return false; + } + if (totalLength == 0) { + return true; + } + + // You don't really want to be calling equals on long strings, but since + // we cache the hashCode, we effectively cache inequality. We use the cached + // hashCode if it's already computed. It's arguable we should compute the + // hashCode here, and if we're going to be testing a bunch of byteStrings, + // it might even make sense. + if (hash != 0) { + int cachedOtherHash = otherByteString.peekCachedHashCode(); + if (cachedOtherHash != 0 && hash != cachedOtherHash) { + return false; + } + } + + return equalsFragments(otherByteString); + } + + /** + * Determines if this string is equal to another of the same length by + * iterating over the leaf nodes. On each step of the iteration, the + * overlapping segments of the leaves are compared. + * + * @param other string of the same length as this one + * @return true if the values of this string equals the value of the given + * one + */ + private boolean equalsFragments(ByteString other) { + int thisOffset = 0; + Iterator thisIter = new PieceIterator(this); + LiteralByteString thisString = thisIter.next(); + + int thatOffset = 0; + Iterator thatIter = new PieceIterator(other); + LiteralByteString thatString = thatIter.next(); + + int pos = 0; + while (true) { + int thisRemaining = thisString.size() - thisOffset; + int thatRemaining = thatString.size() - thatOffset; + int bytesToCompare = Math.min(thisRemaining, thatRemaining); + + // At least one of the offsets will be zero + boolean stillEqual = (thisOffset == 0) + ? thisString.equalsRange(thatString, thatOffset, bytesToCompare) + : thatString.equalsRange(thisString, thisOffset, bytesToCompare); + if (!stillEqual) { + return false; + } + + pos += bytesToCompare; + if (pos >= totalLength) { + if (pos == totalLength) { + return true; + } + throw new IllegalStateException(); + } + // We always get to the end of at least one of the pieces + if (bytesToCompare == thisRemaining) { // If reached end of this + thisOffset = 0; + thisString = thisIter.next(); + } else { + thisOffset += bytesToCompare; + } + if (bytesToCompare == thatRemaining) { // If reached end of that + thatOffset = 0; + thatString = thatIter.next(); + } else { + thatOffset += bytesToCompare; + } + } + } + + /** + * Cached hash value. Intentionally accessed via a data race, which is safe + * because of the Java Memory Model's "no out-of-thin-air values" guarantees + * for ints. + */ + private int hash = 0; + + @Override + public int hashCode() { + int h = hash; + + if (h == 0) { + h = totalLength; + h = partialHash(h, 0, totalLength); + if (h == 0) { + h = 1; + } + hash = h; + } + return h; + } + + @Override + protected int peekCachedHashCode() { + return hash; + } + + @Override + protected int partialHash(int h, int offset, int length) { + int toIndex = offset + length; + if (toIndex <= leftLength) { + return left.partialHash(h, offset, length); + } else if (offset >= leftLength) { + return right.partialHash(h, offset - leftLength, length); + } else { + int leftLength = this.leftLength - offset; + int leftPartial = left.partialHash(h, offset, leftLength); + return right.partialHash(leftPartial, 0, length - leftLength); + } + } + + // ================================================================= + // Input stream + + @Override + public CodedInputStream newCodedInput() { + return CodedInputStream.newInstance(new RopeInputStream()); + } + + @Override + public InputStream newInput() { + return new RopeInputStream(); + } + + /** + * This class implements the balancing algorithm of BAP95. In the paper the + * authors use an array to keep track of pieces, while here we use a stack. + * The tree is balanced by traversing subtrees in left to right order, and the + * stack always contains the part of the string we've traversed so far. + * + *

One surprising aspect of the algorithm is the result of balancing is not + * necessarily balanced, though it is nearly balanced. For details, see + * BAP95. + */ + private static class Balancer { + // Stack containing the part of the string, starting from the left, that + // we've already traversed. The final string should be the equivalent of + // concatenating the strings on the stack from bottom to top. + private final Stack prefixesStack = new Stack(); + + private ByteString balance(ByteString left, ByteString right) { + doBalance(left); + doBalance(right); + + // Sweep stack to gather the result + ByteString partialString = prefixesStack.pop(); + while (!prefixesStack.isEmpty()) { + ByteString newLeft = prefixesStack.pop(); + partialString = new RopeByteString(newLeft, partialString); + } + // We should end up with a RopeByteString since at a minimum we will + // create one from concatenating left and right + return partialString; + } + + private void doBalance(ByteString root) { + // BAP95: Insert balanced subtrees whole. This means the result might not + // be balanced, leading to repeated rebalancings on concatenate. However, + // these rebalancings are shallow due to ignoring balanced subtrees, and + // relatively few calls to insert() result. + if (root.isBalanced()) { + insert(root); + } else if (root instanceof RopeByteString) { + RopeByteString rbs = (RopeByteString) root; + doBalance(rbs.left); + doBalance(rbs.right); + } else { + throw new IllegalArgumentException( + "Has a new type of ByteString been created? Found " + + root.getClass()); + } + } + + /** + * Push a string on the balance stack (BAP95). BAP95 uses an array and + * calls the elements in the array 'bins'. We instead use a stack, so the + * 'bins' of lengths are represented by differences between the elements of + * minLengthByDepth. + * + *

If the length bin for our string, and all shorter length bins, are + * empty, we just push it on the stack. Otherwise, we need to start + * concatenating, putting the given string in the "middle" and continuing + * until we land in an empty length bin that matches the length of our + * concatenation. + * + * @param byteString string to place on the balance stack + */ + private void insert(ByteString byteString) { + int depthBin = getDepthBinForLength(byteString.size()); + int binEnd = minLengthByDepth[depthBin + 1]; + + // BAP95: Concatenate all trees occupying bins representing the length of + // our new piece or of shorter pieces, to the extent that is possible. + // The goal is to clear the bin which our piece belongs in, but that may + // not be entirely possible if there aren't enough longer bins occupied. + if (prefixesStack.isEmpty() || prefixesStack.peek().size() >= binEnd) { + prefixesStack.push(byteString); + } else { + int binStart = minLengthByDepth[depthBin]; + + // Concatenate the subtrees of shorter length + ByteString newTree = prefixesStack.pop(); + while (!prefixesStack.isEmpty() + && prefixesStack.peek().size() < binStart) { + ByteString left = prefixesStack.pop(); + newTree = new RopeByteString(left, newTree); + } + + // Concatenate the given string + newTree = new RopeByteString(newTree, byteString); + + // Continue concatenating until we land in an empty bin + while (!prefixesStack.isEmpty()) { + depthBin = getDepthBinForLength(newTree.size()); + binEnd = minLengthByDepth[depthBin + 1]; + if (prefixesStack.peek().size() < binEnd) { + ByteString left = prefixesStack.pop(); + newTree = new RopeByteString(left, newTree); + } else { + break; + } + } + prefixesStack.push(newTree); + } + } + + private int getDepthBinForLength(int length) { + int depth = Arrays.binarySearch(minLengthByDepth, length); + if (depth < 0) { + // It wasn't an exact match, so convert to the index of the containing + // fragment, which is one less even than the insertion point. + int insertionPoint = -(depth + 1); + depth = insertionPoint - 1; + } + + return depth; + } + } + + /** + * This class is a continuable tree traversal, which keeps the state + * information which would exist on the stack in a recursive traversal instead + * on a stack of "Bread Crumbs". The maximum depth of the stack in this + * iterator is the same as the depth of the tree being traversed. + * + *

This iterator is used to implement + * {@link RopeByteString#equalsFragments(ByteString)}. + */ + private static class PieceIterator implements Iterator { + + private final Stack breadCrumbs = + new Stack(); + private LiteralByteString next; + + private PieceIterator(ByteString root) { + next = getLeafByLeft(root); + } + + private LiteralByteString getLeafByLeft(ByteString root) { + ByteString pos = root; + while (pos instanceof RopeByteString) { + RopeByteString rbs = (RopeByteString) pos; + breadCrumbs.push(rbs); + pos = rbs.left; + } + return (LiteralByteString) pos; + } + + private LiteralByteString getNextNonEmptyLeaf() { + while (true) { + // Almost always, we go through this loop exactly once. However, if + // we discover an empty string in the rope, we toss it and try again. + if (breadCrumbs.isEmpty()) { + return null; + } else { + LiteralByteString result = getLeafByLeft(breadCrumbs.pop().right); + if (!result.isEmpty()) { + return result; + } + } + } + } + + public boolean hasNext() { + return next != null; + } + + /** + * Returns the next item and advances one {@code LiteralByteString}. + * + * @return next non-empty LiteralByteString or {@code null} + */ + public LiteralByteString next() { + if (next == null) { + throw new NoSuchElementException(); + } + LiteralByteString result = next; + next = getNextNonEmptyLeaf(); + return result; + } + + public void remove() { + throw new UnsupportedOperationException(); + } + } + + // ================================================================= + // ByteIterator + + @Override + public ByteIterator iterator() { + return new RopeByteIterator(); + } + + private class RopeByteIterator implements ByteString.ByteIterator { + + private final PieceIterator pieces; + private ByteIterator bytes; + int bytesRemaining; + + private RopeByteIterator() { + pieces = new PieceIterator(RopeByteString.this); + bytes = pieces.next().iterator(); + bytesRemaining = size(); + } + + public boolean hasNext() { + return (bytesRemaining > 0); + } + + public Byte next() { + return nextByte(); // Does not instantiate a Byte + } + + public byte nextByte() { + if (!bytes.hasNext()) { + bytes = pieces.next().iterator(); + } + --bytesRemaining; + return bytes.nextByte(); + } + + public void remove() { + throw new UnsupportedOperationException(); + } + } + + /** + * This class is the {@link RopeByteString} equivalent for + * {@link ByteArrayInputStream}. + */ + private class RopeInputStream extends InputStream { + // Iterates through the pieces of the rope + private PieceIterator pieceIterator; + // The current piece + private LiteralByteString currentPiece; + // The size of the current piece + private int currentPieceSize; + // The index of the next byte to read in the current piece + private int currentPieceIndex; + // The offset of the start of the current piece in the rope byte string + private int currentPieceOffsetInRope; + // Offset in the buffer at which user called mark(); + private int mark; + + public RopeInputStream() { + initialize(); + } + + @Override + public int read(byte b[], int offset, int length) { + if (b == null) { + throw new NullPointerException(); + } else if (offset < 0 || length < 0 || length > b.length - offset) { + throw new IndexOutOfBoundsException(); + } + return readSkipInternal(b, offset, length); + } + + @Override + public long skip(long length) { + if (length < 0) { + throw new IndexOutOfBoundsException(); + } else if (length > Integer.MAX_VALUE) { + length = Integer.MAX_VALUE; + } + return readSkipInternal(null, 0, (int) length); + } + + /** + * Internal implementation of read and skip. If b != null, then read the + * next {@code length} bytes into the buffer {@code b} at + * offset {@code offset}. If b == null, then skip the next {@code length) + * bytes. + *

+ * This method assumes that all error checking has already happened. + *

+ * Returns the actual number of bytes read or skipped. + */ + private int readSkipInternal(byte b[], int offset, int length) { + int bytesRemaining = length; + while (bytesRemaining > 0) { + advanceIfCurrentPieceFullyRead(); + if (currentPiece == null) { + if (bytesRemaining == length) { + // We didn't manage to read anything + return -1; + } + break; + } else { + // Copy the bytes from this piece. + int currentPieceRemaining = currentPieceSize - currentPieceIndex; + int count = Math.min(currentPieceRemaining, bytesRemaining); + if (b != null) { + currentPiece.copyTo(b, currentPieceIndex, offset, count); + offset += count; + } + currentPieceIndex += count; + bytesRemaining -= count; + } + } + // Return the number of bytes read. + return length - bytesRemaining; + } + + @Override + public int read() throws IOException { + advanceIfCurrentPieceFullyRead(); + if (currentPiece == null) { + return -1; + } else { + return currentPiece.byteAt(currentPieceIndex++) & 0xFF; + } + } + + @Override + public int available() throws IOException { + int bytesRead = currentPieceOffsetInRope + currentPieceIndex; + return RopeByteString.this.size() - bytesRead; + } + + @Override + public boolean markSupported() { + return true; + } + + @Override + public void mark(int readAheadLimit) { + // Set the mark to our position in the byte string + mark = currentPieceOffsetInRope + currentPieceIndex; + } + + @Override + public synchronized void reset() { + // Just reinitialize and skip the specified number of bytes. + initialize(); + readSkipInternal(null, 0, mark); + } + + /** Common initialization code used by both the constructor and reset() */ + private void initialize() { + pieceIterator = new PieceIterator(RopeByteString.this); + currentPiece = pieceIterator.next(); + currentPieceSize = currentPiece.size(); + currentPieceIndex = 0; + currentPieceOffsetInRope = 0; + } + + /** + * Skips to the next piece if we have read all the data in the current + * piece. Sets currentPiece to null if we have reached the end of the + * input. + */ + private void advanceIfCurrentPieceFullyRead() { + if (currentPiece != null && currentPieceIndex == currentPieceSize) { + // Generally, we can only go through this loop at most once, since + // empty strings can't end up in a rope. But better to test. + currentPieceOffsetInRope += currentPieceSize; + currentPieceIndex = 0; + if (pieceIterator.hasNext()) { + currentPiece = pieceIterator.next(); + currentPieceSize = currentPiece.size(); + } else { + currentPiece = null; + currentPieceSize = 0; + } + } + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/SmallSortedMap.java b/retrofit/src/main/java/com/google/protobuf/SmallSortedMap.java new file mode 100644 index 0000000000..0674d2e28e --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/SmallSortedMap.java @@ -0,0 +1,618 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.AbstractMap; +import java.util.AbstractSet; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.TreeMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.SortedMap; + +/** + * A custom map implementation from FieldDescriptor to Object optimized to + * minimize the number of memory allocations for instances with a small number + * of mappings. The implementation stores the first {@code k} mappings in an + * array for a configurable value of {@code k}, allowing direct access to the + * corresponding {@code Entry}s without the need to create an Iterator. The + * remaining entries are stored in an overflow map. Iteration over the entries + * in the map should be done as follows: + * + *

   {@code
+ * for (int i = 0; i < fieldMap.getNumArrayEntries(); i++) {
+ *   process(fieldMap.getArrayEntryAt(i));
+ * }
+ * for (Map.Entry entry : fieldMap.getOverflowEntries()) {
+ *   process(entry);
+ * }
+ * }
+ * + * The resulting iteration is in order of ascending field tag number. The + * object returned by {@link #entrySet()} adheres to the same contract but is + * less efficient as it necessarily involves creating an object for iteration. + *

+ * The tradeoff for this memory efficiency is that the worst case running time + * of the {@code put()} operation is {@code O(k + lg n)}, which happens when + * entries are added in descending order. {@code k} should be chosen such that + * it covers enough common cases without adversely affecting larger maps. In + * practice, the worst case scenario does not happen for extensions because + * extension fields are serialized and deserialized in order of ascending tag + * number, but the worst case scenario can happen for DynamicMessages. + *

+ * The running time for all other operations is similar to that of + * {@code TreeMap}. + *

+ * Instances are not thread-safe until {@link #makeImmutable()} is called, + * after which any modifying operation will result in an + * {@link UnsupportedOperationException}. + * + * @author darick@google.com Darick Tong + */ +// This class is final for all intents and purposes because the constructor is +// private. However, the FieldDescriptor-specific logic is encapsulated in +// a subclass to aid testability of the core logic. +class SmallSortedMap, V> extends AbstractMap { + + /** + * Creates a new instance for mapping FieldDescriptors to their values. + * The {@link #makeImmutable()} implementation will convert the List values + * of any repeated fields to unmodifiable lists. + * + * @param arraySize The size of the entry array containing the + * lexicographically smallest mappings. + */ + static > + SmallSortedMap newFieldMap(int arraySize) { + return new SmallSortedMap(arraySize) { + @Override + @SuppressWarnings("unchecked") + public void makeImmutable() { + if (!isImmutable()) { + for (int i = 0; i < getNumArrayEntries(); i++) { + final Map.Entry entry = + getArrayEntryAt(i); + if (entry.getKey().isRepeated()) { + final List value = (List) entry.getValue(); + entry.setValue(Collections.unmodifiableList(value)); + } + } + for (Map.Entry entry : + getOverflowEntries()) { + if (entry.getKey().isRepeated()) { + final List value = (List) entry.getValue(); + entry.setValue(Collections.unmodifiableList(value)); + } + } + } + super.makeImmutable(); + } + }; + } + + /** + * Creates a new instance for testing. + * + * @param arraySize The size of the entry array containing the + * lexicographically smallest mappings. + */ + static , V> SmallSortedMap newInstanceForTest( + int arraySize) { + return new SmallSortedMap(arraySize); + } + + private final int maxArraySize; + // The "entry array" is actually a List because generic arrays are not + // allowed. ArrayList also nicely handles the entry shifting on inserts and + // removes. + private List entryList; + private Map overflowEntries; + private boolean isImmutable; + // The EntrySet is a stateless view of the Map. It's initialized the first + // time it is requested and reused henceforth. + private volatile EntrySet lazyEntrySet; + + /** + * @code arraySize Size of the array in which the lexicographically smallest + * mappings are stored. (i.e. the {@code k} referred to in the class + * documentation). + */ + private SmallSortedMap(int arraySize) { + this.maxArraySize = arraySize; + this.entryList = Collections.emptyList(); + this.overflowEntries = Collections.emptyMap(); + } + + /** Make this map immutable from this point forward. */ + public void makeImmutable() { + if (!isImmutable) { + // Note: There's no need to wrap the entryList in an unmodifiableList + // because none of the list's accessors are exposed. The iterator() of + // overflowEntries, on the other hand, is exposed so it must be made + // unmodifiable. + overflowEntries = overflowEntries.isEmpty() ? + Collections.emptyMap() : + Collections.unmodifiableMap(overflowEntries); + isImmutable = true; + } + } + + /** @return Whether {@link #makeImmutable()} has been called. */ + public boolean isImmutable() { + return isImmutable; + } + + /** @return The number of entries in the entry array. */ + public int getNumArrayEntries() { + return entryList.size(); + } + + /** @return The array entry at the given {@code index}. */ + public Map.Entry getArrayEntryAt(int index) { + return entryList.get(index); + } + + /** @return There number of overflow entries. */ + public int getNumOverflowEntries() { + return overflowEntries.size(); + } + + /** @return An iterable over the overflow entries. */ + public Iterable> getOverflowEntries() { + return overflowEntries.isEmpty() ? + EmptySet.>iterable() : + overflowEntries.entrySet(); + } + + @Override + public int size() { + return entryList.size() + overflowEntries.size(); + } + + /** + * The implementation throws a {@code ClassCastException} if o is not an + * object of type {@code K}. + * + * {@inheritDoc} + */ + @Override + public boolean containsKey(Object o) { + @SuppressWarnings("unchecked") + final K key = (K) o; + return binarySearchInArray(key) >= 0 || overflowEntries.containsKey(key); + } + + /** + * The implementation throws a {@code ClassCastException} if o is not an + * object of type {@code K}. + * + * {@inheritDoc} + */ + @Override + public V get(Object o) { + @SuppressWarnings("unchecked") + final K key = (K) o; + final int index = binarySearchInArray(key); + if (index >= 0) { + return entryList.get(index).getValue(); + } + return overflowEntries.get(key); + } + + @Override + public V put(K key, V value) { + checkMutable(); + final int index = binarySearchInArray(key); + if (index >= 0) { + // Replace existing array entry. + return entryList.get(index).setValue(value); + } + ensureEntryArrayMutable(); + final int insertionPoint = -(index + 1); + if (insertionPoint >= maxArraySize) { + // Put directly in overflow. + return getOverflowEntriesMutable().put(key, value); + } + // Insert new Entry in array. + if (entryList.size() == maxArraySize) { + // Shift the last array entry into overflow. + final Entry lastEntryInArray = entryList.remove(maxArraySize - 1); + getOverflowEntriesMutable().put(lastEntryInArray.getKey(), + lastEntryInArray.getValue()); + } + entryList.add(insertionPoint, new Entry(key, value)); + return null; + } + + @Override + public void clear() { + checkMutable(); + if (!entryList.isEmpty()) { + entryList.clear(); + } + if (!overflowEntries.isEmpty()) { + overflowEntries.clear(); + } + } + + /** + * The implementation throws a {@code ClassCastException} if o is not an + * object of type {@code K}. + * + * {@inheritDoc} + */ + @Override + public V remove(Object o) { + checkMutable(); + @SuppressWarnings("unchecked") + final K key = (K) o; + final int index = binarySearchInArray(key); + if (index >= 0) { + return removeArrayEntryAt(index); + } + // overflowEntries might be Collections.unmodifiableMap(), so only + // call remove() if it is non-empty. + if (overflowEntries.isEmpty()) { + return null; + } else { + return overflowEntries.remove(key); + } + } + + private V removeArrayEntryAt(int index) { + checkMutable(); + final V removed = entryList.remove(index).getValue(); + if (!overflowEntries.isEmpty()) { + // Shift the first entry in the overflow to be the last entry in the + // array. + final Iterator> iterator = + getOverflowEntriesMutable().entrySet().iterator(); + entryList.add(new Entry(iterator.next())); + iterator.remove(); + } + return removed; + } + + /** + * @param key The key to find in the entry array. + * @return The returned integer position follows the same semantics as the + * value returned by {@link java.util.Arrays#binarySearch()}. + */ + private int binarySearchInArray(K key) { + int left = 0; + int right = entryList.size() - 1; + + // Optimization: For the common case in which entries are added in + // ascending tag order, check the largest element in the array before + // doing a full binary search. + if (right >= 0) { + int cmp = key.compareTo(entryList.get(right).getKey()); + if (cmp > 0) { + return -(right + 2); // Insert point is after "right". + } else if (cmp == 0) { + return right; + } + } + + while (left <= right) { + int mid = (left + right) / 2; + int cmp = key.compareTo(entryList.get(mid).getKey()); + if (cmp < 0) { + right = mid - 1; + } else if (cmp > 0) { + left = mid + 1; + } else { + return mid; + } + } + return -(left + 1); + } + + /** + * Similar to the AbstractMap implementation of {@code keySet()} and + * {@code values()}, the entry set is created the first time this method is + * called, and returned in response to all subsequent calls. + * + * {@inheritDoc} + */ + @Override + public Set> entrySet() { + if (lazyEntrySet == null) { + lazyEntrySet = new EntrySet(); + } + return lazyEntrySet; + } + + /** + * @throws UnsupportedOperationException if {@link #makeImmutable()} has + * has been called. + */ + private void checkMutable() { + if (isImmutable) { + throw new UnsupportedOperationException(); + } + } + + /** + * @return a {@link SortedMap} to which overflow entries mappings can be + * added or removed. + * @throws UnsupportedOperationException if {@link #makeImmutable()} has been + * called. + */ + @SuppressWarnings("unchecked") + private SortedMap getOverflowEntriesMutable() { + checkMutable(); + if (overflowEntries.isEmpty() && !(overflowEntries instanceof TreeMap)) { + overflowEntries = new TreeMap(); + } + return (SortedMap) overflowEntries; + } + + /** + * Lazily creates the entry list. Any code that adds to the list must first + * call this method. + */ + private void ensureEntryArrayMutable() { + checkMutable(); + if (entryList.isEmpty() && !(entryList instanceof ArrayList)) { + entryList = new ArrayList(maxArraySize); + } + } + + /** + * Entry implementation that implements Comparable in order to support + * binary search within the entry array. Also checks mutability in + * {@link #setValue()}. + */ + private class Entry implements Map.Entry, Comparable { + + private final K key; + private V value; + + Entry(Map.Entry copy) { + this(copy.getKey(), copy.getValue()); + } + + Entry(K key, V value) { + this.key = key; + this.value = value; + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public K getKey() { + return key; + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public V getValue() { + return value; + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public int compareTo(Entry other) { + return getKey().compareTo(other.getKey()); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public V setValue(V newValue) { + checkMutable(); + final V oldValue = this.value; + this.value = newValue; + return oldValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof Map.Entry)) { + return false; + } + @SuppressWarnings("unchecked") + Map.Entry other = (Map.Entry) o; + return equals(key, other.getKey()) && equals(value, other.getValue()); + } + + @Override + public int hashCode() { + return (key == null ? 0 : key.hashCode()) ^ + (value == null ? 0 : value.hashCode()); + } + + @Override + public String toString() { + return key + "=" + value; + } + + /** equals() that handles null values. */ + private boolean equals(Object o1, Object o2) { + return o1 == null ? o2 == null : o1.equals(o2); + } + } + + /** + * Stateless view of the entries in the field map. + */ + private class EntrySet extends AbstractSet> { + + @Override + public Iterator> iterator() { + return new EntryIterator(); + } + + @Override + public int size() { + return SmallSortedMap.this.size(); + } + + /** + * Throws a {@link ClassCastException} if o is not of the expected type. + * + * {@inheritDoc} + */ + @Override + public boolean contains(Object o) { + @SuppressWarnings("unchecked") + final Map.Entry entry = (Map.Entry) o; + final V existing = get(entry.getKey()); + final V value = entry.getValue(); + return existing == value || + (existing != null && existing.equals(value)); + } + + @Override + public boolean add(Map.Entry entry) { + if (!contains(entry)) { + put(entry.getKey(), entry.getValue()); + return true; + } + return false; + } + + /** + * Throws a {@link ClassCastException} if o is not of the expected type. + * + * {@inheritDoc} + */ + @Override + public boolean remove(Object o) { + @SuppressWarnings("unchecked") + final Map.Entry entry = (Map.Entry) o; + if (contains(entry)) { + SmallSortedMap.this.remove(entry.getKey()); + return true; + } + return false; + } + + @Override + public void clear() { + SmallSortedMap.this.clear(); + } + } + + /** + * Iterator implementation that switches from the entry array to the overflow + * entries appropriately. + */ + private class EntryIterator implements Iterator> { + + private int pos = -1; + private boolean nextCalledBeforeRemove; + private Iterator> lazyOverflowIterator; + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public boolean hasNext() { + return (pos + 1) < entryList.size() || + getOverflowIterator().hasNext(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public Map.Entry next() { + nextCalledBeforeRemove = true; + // Always increment pos so that we know whether the last returned value + // was from the array or from overflow. + if (++pos < entryList.size()) { + return entryList.get(pos); + } + return getOverflowIterator().next(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void remove() { + if (!nextCalledBeforeRemove) { + throw new IllegalStateException("remove() was called before next()"); + } + nextCalledBeforeRemove = false; + checkMutable(); + + if (pos < entryList.size()) { + removeArrayEntryAt(pos--); + } else { + getOverflowIterator().remove(); + } + } + + /** + * It is important to create the overflow iterator only after the array + * entries have been iterated over because the overflow entry set changes + * when the client calls remove() on the array entries, which invalidates + * any existing iterators. + */ + private Iterator> getOverflowIterator() { + if (lazyOverflowIterator == null) { + lazyOverflowIterator = overflowEntries.entrySet().iterator(); + } + return lazyOverflowIterator; + } + } + + /** + * Helper class that holds immutable instances of an Iterable/Iterator that + * we return when the overflow entries is empty. This eliminates the creation + * of an Iterator object when there is nothing to iterate over. + */ + private static class EmptySet { + + private static final Iterator ITERATOR = new Iterator() { + //@Override (Java 1.6 override semantics, but we must support 1.5) + public boolean hasNext() { + return false; + } + //@Override (Java 1.6 override semantics, but we must support 1.5) + public Object next() { + throw new NoSuchElementException(); + } + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void remove() { + throw new UnsupportedOperationException(); + } + }; + + private static final Iterable ITERABLE = new Iterable() { + //@Override (Java 1.6 override semantics, but we must support 1.5) + public Iterator iterator() { + return ITERATOR; + } + }; + + @SuppressWarnings("unchecked") + static Iterable iterable() { + return (Iterable) ITERABLE; + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/UninitializedMessageException.java b/retrofit/src/main/java/com/google/protobuf/UninitializedMessageException.java new file mode 100644 index 0000000000..5714c063a9 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/UninitializedMessageException.java @@ -0,0 +1,99 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.Collections; +import java.util.List; + +/** + * Thrown when attempting to build a protocol message that is missing required + * fields. This is a {@code RuntimeException} because it normally represents + * a programming error: it happens when some code which constructs a message + * fails to set all the fields. {@code parseFrom()} methods do not + * throw this; they throw an {@link InvalidProtocolBufferException} if + * required fields are missing, because it is not a programming error to + * receive an incomplete message. In other words, + * {@code UninitializedMessageException} should never be thrown by correct + * code, but {@code InvalidProtocolBufferException} might be. + * + * @author kenton@google.com Kenton Varda + */ +public class UninitializedMessageException extends RuntimeException { + private static final long serialVersionUID = -7466929953374883507L; + + public UninitializedMessageException(final MessageLite message) { + super("Message was missing required fields. (Lite runtime could not " + + "determine which fields were missing)."); + missingFields = null; + } + + public UninitializedMessageException(final List missingFields) { + super(buildDescription(missingFields)); + this.missingFields = missingFields; + } + + private final List missingFields; + + /** + * Get a list of human-readable names of required fields missing from this + * message. Each name is a full path to a field, e.g. "foo.bar[5].baz". + * Returns null if the lite runtime was used, since it lacks the ability to + * find missing fields. + */ + public List getMissingFields() { + return Collections.unmodifiableList(missingFields); + } + + /** + * Converts this exception to an {@link InvalidProtocolBufferException}. + * When a parsed message is missing required fields, this should be thrown + * instead of {@code UninitializedMessageException}. + */ + public InvalidProtocolBufferException asInvalidProtocolBufferException() { + return new InvalidProtocolBufferException(getMessage()); + } + + /** Construct the description string for this exception. */ + private static String buildDescription(final List missingFields) { + final StringBuilder description = + new StringBuilder("Message missing required fields: "); + boolean first = true; + for (final String field : missingFields) { + if (first) { + first = false; + } else { + description.append(", "); + } + description.append(field); + } + return description.toString(); + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java b/retrofit/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java new file mode 100644 index 0000000000..5cc005df88 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java @@ -0,0 +1,205 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +import java.util.AbstractList; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.RandomAccess; + +/** + * An implementation of {@link LazyStringList} that wraps another + * {@link LazyStringList} such that it cannot be modified via the wrapper. + * + * @author jonp@google.com (Jon Perlow) + */ +public class UnmodifiableLazyStringList extends AbstractList + implements LazyStringList, RandomAccess { + + private final LazyStringList list; + + public UnmodifiableLazyStringList(LazyStringList list) { + this.list = list; + } + + @Override + public String get(int index) { + return list.get(index); + } + + @Override + public int size() { + return list.size(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public ByteString getByteString(int index) { + return list.getByteString(index); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void add(ByteString element) { + throw new UnsupportedOperationException(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void set(int index, ByteString element) { + throw new UnsupportedOperationException(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public boolean addAllByteString(Collection element) { + throw new UnsupportedOperationException(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public byte[] getByteArray(int index) { + return list.getByteArray(index); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void add(byte[] element) { + throw new UnsupportedOperationException(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void set(int index, byte[] element) { + throw new UnsupportedOperationException(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public boolean addAllByteArray(Collection element) { + throw new UnsupportedOperationException(); + } + + @Override + public ListIterator listIterator(final int index) { + return new ListIterator() { + ListIterator iter = list.listIterator(index); + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public boolean hasNext() { + return iter.hasNext(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public String next() { + return iter.next(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public boolean hasPrevious() { + return iter.hasPrevious(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public String previous() { + return iter.previous(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public int nextIndex() { + return iter.nextIndex(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public int previousIndex() { + return iter.previousIndex(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void remove() { + throw new UnsupportedOperationException(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void set(String o) { + throw new UnsupportedOperationException(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void add(String o) { + throw new UnsupportedOperationException(); + } + }; + } + + @Override + public Iterator iterator() { + return new Iterator() { + Iterator iter = list.iterator(); + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public boolean hasNext() { + return iter.hasNext(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public String next() { + return iter.next(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public List getUnderlyingElements() { + // The returned value is already unmodifiable. + return list.getUnderlyingElements(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public void mergeFrom(LazyStringList other) { + throw new UnsupportedOperationException(); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public List asByteArrayList() { + return Collections.unmodifiableList(list.asByteArrayList()); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public List asByteStringList() { + return Collections.unmodifiableList(list.asByteStringList()); + } + + //@Override (Java 1.6 override semantics, but we must support 1.5) + public LazyStringList getUnmodifiableView() { + return this; + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/Utf8.java b/retrofit/src/main/java/com/google/protobuf/Utf8.java new file mode 100644 index 0000000000..4d0ef53ba9 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/Utf8.java @@ -0,0 +1,349 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +/** + * A set of low-level, high-performance static utility methods related + * to the UTF-8 character encoding. This class has no dependencies + * outside of the core JDK libraries. + * + *

There are several variants of UTF-8. The one implemented by + * this class is the restricted definition of UTF-8 introduced in + * Unicode 3.1, which mandates the rejection of "overlong" byte + * sequences as well as rejection of 3-byte surrogate codepoint byte + * sequences. Note that the UTF-8 decoder included in Oracle's JDK + * has been modified to also reject "overlong" byte sequences, but (as + * of 2011) still accepts 3-byte surrogate codepoint byte sequences. + * + *

The byte sequences considered valid by this class are exactly + * those that can be roundtrip converted to Strings and back to bytes + * using the UTF-8 charset, without loss:

 {@code
+ * Arrays.equals(bytes, new String(bytes, "UTF-8").getBytes("UTF-8"))
+ * }
+ * + *

See the Unicode Standard,
+ * Table 3-6. UTF-8 Bit Distribution,
+ * Table 3-7. Well Formed UTF-8 Byte Sequences. + * + *

This class supports decoding of partial byte sequences, so that the + * bytes in a complete UTF-8 byte sequences can be stored in multiple + * segments. Methods typically return {@link #MALFORMED} if the partial + * byte sequence is definitely not well-formed, {@link #COMPLETE} if it is + * well-formed in the absence of additional input, or if the byte sequence + * apparently terminated in the middle of a character, an opaque integer + * "state" value containing enough information to decode the character when + * passed to a subsequent invocation of a partial decoding method. + * + * @author martinrb@google.com (Martin Buchholz) + */ +final class Utf8 { + private Utf8() {} + + /** + * State value indicating that the byte sequence is well-formed and + * complete (no further bytes are needed to complete a character). + */ + public static final int COMPLETE = 0; + + /** + * State value indicating that the byte sequence is definitely not + * well-formed. + */ + public static final int MALFORMED = -1; + + // Other state values include the partial bytes of the incomplete + // character to be decoded in the simplest way: we pack the bytes + // into the state int in little-endian order. For example: + // + // int state = byte1 ^ (byte2 << 8) ^ (byte3 << 16); + // + // Such a state is unpacked thus (note the ~ operation for byte2 to + // undo byte1's sign-extension bits): + // + // int byte1 = (byte) state; + // int byte2 = (byte) ~(state >> 8); + // int byte3 = (byte) (state >> 16); + // + // We cannot store a zero byte in the state because it would be + // indistinguishable from the absence of a byte. But we don't need + // to, because partial bytes must always be negative. When building + // a state, we ensure that byte1 is negative and subsequent bytes + // are valid trailing bytes. + + /** + * Returns {@code true} if the given byte array is a well-formed + * UTF-8 byte sequence. + * + *

This is a convenience method, equivalent to a call to {@code + * isValidUtf8(bytes, 0, bytes.length)}. + */ + public static boolean isValidUtf8(byte[] bytes) { + return isValidUtf8(bytes, 0, bytes.length); + } + + /** + * Returns {@code true} if the given byte array slice is a + * well-formed UTF-8 byte sequence. The range of bytes to be + * checked extends from index {@code index}, inclusive, to {@code + * limit}, exclusive. + * + *

This is a convenience method, equivalent to {@code + * partialIsValidUtf8(bytes, index, limit) == Utf8.COMPLETE}. + */ + public static boolean isValidUtf8(byte[] bytes, int index, int limit) { + return partialIsValidUtf8(bytes, index, limit) == COMPLETE; + } + + /** + * Tells whether the given byte array slice is a well-formed, + * malformed, or incomplete UTF-8 byte sequence. The range of bytes + * to be checked extends from index {@code index}, inclusive, to + * {@code limit}, exclusive. + * + * @param state either {@link Utf8#COMPLETE} (if this is the initial decoding + * operation) or the value returned from a call to a partial decoding method + * for the previous bytes + * + * @return {@link #MALFORMED} if the partial byte sequence is + * definitely not well-formed, {@link #COMPLETE} if it is well-formed + * (no additional input needed), or if the byte sequence is + * "incomplete", i.e. apparently terminated in the middle of a character, + * an opaque integer "state" value containing enough information to + * decode the character when passed to a subsequent invocation of a + * partial decoding method. + */ + public static int partialIsValidUtf8( + int state, byte[] bytes, int index, int limit) { + if (state != COMPLETE) { + // The previous decoding operation was incomplete (or malformed). + // We look for a well-formed sequence consisting of bytes from + // the previous decoding operation (stored in state) together + // with bytes from the array slice. + // + // We expect such "straddler characters" to be rare. + + if (index >= limit) { // No bytes? No progress. + return state; + } + int byte1 = (byte) state; + // byte1 is never ASCII. + if (byte1 < (byte) 0xE0) { + // two-byte form + + // Simultaneously checks for illegal trailing-byte in + // leading position and overlong 2-byte form. + if (byte1 < (byte) 0xC2 || + // byte2 trailing-byte test + bytes[index++] > (byte) 0xBF) { + return MALFORMED; + } + } else if (byte1 < (byte) 0xF0) { + // three-byte form + + // Get byte2 from saved state or array + int byte2 = (byte) ~(state >> 8); + if (byte2 == 0) { + byte2 = bytes[index++]; + if (index >= limit) { + return incompleteStateFor(byte1, byte2); + } + } + if (byte2 > (byte) 0xBF || + // overlong? 5 most significant bits must not all be zero + (byte1 == (byte) 0xE0 && byte2 < (byte) 0xA0) || + // illegal surrogate codepoint? + (byte1 == (byte) 0xED && byte2 >= (byte) 0xA0) || + // byte3 trailing-byte test + bytes[index++] > (byte) 0xBF) { + return MALFORMED; + } + } else { + // four-byte form + + // Get byte2 and byte3 from saved state or array + int byte2 = (byte) ~(state >> 8); + int byte3 = 0; + if (byte2 == 0) { + byte2 = bytes[index++]; + if (index >= limit) { + return incompleteStateFor(byte1, byte2); + } + } else { + byte3 = (byte) (state >> 16); + } + if (byte3 == 0) { + byte3 = bytes[index++]; + if (index >= limit) { + return incompleteStateFor(byte1, byte2, byte3); + } + } + + // If we were called with state == MALFORMED, then byte1 is 0xFF, + // which never occurs in well-formed UTF-8, and so we will return + // MALFORMED again below. + + if (byte2 > (byte) 0xBF || + // Check that 1 <= plane <= 16. Tricky optimized form of: + // if (byte1 > (byte) 0xF4 || + // byte1 == (byte) 0xF0 && byte2 < (byte) 0x90 || + // byte1 == (byte) 0xF4 && byte2 > (byte) 0x8F) + (((byte1 << 28) + (byte2 - (byte) 0x90)) >> 30) != 0 || + // byte3 trailing-byte test + byte3 > (byte) 0xBF || + // byte4 trailing-byte test + bytes[index++] > (byte) 0xBF) { + return MALFORMED; + } + } + } + + return partialIsValidUtf8(bytes, index, limit); + } + + /** + * Tells whether the given byte array slice is a well-formed, + * malformed, or incomplete UTF-8 byte sequence. The range of bytes + * to be checked extends from index {@code index}, inclusive, to + * {@code limit}, exclusive. + * + *

This is a convenience method, equivalent to a call to {@code + * partialIsValidUtf8(Utf8.COMPLETE, bytes, index, limit)}. + * + * @return {@link #MALFORMED} if the partial byte sequence is + * definitely not well-formed, {@link #COMPLETE} if it is well-formed + * (no additional input needed), or if the byte sequence is + * "incomplete", i.e. apparently terminated in the middle of a character, + * an opaque integer "state" value containing enough information to + * decode the character when passed to a subsequent invocation of a + * partial decoding method. + */ + public static int partialIsValidUtf8( + byte[] bytes, int index, int limit) { + // Optimize for 100% ASCII. + // Hotspot loves small simple top-level loops like this. + while (index < limit && bytes[index] >= 0) { + index++; + } + + return (index >= limit) ? COMPLETE : + partialIsValidUtf8NonAscii(bytes, index, limit); + } + + private static int partialIsValidUtf8NonAscii( + byte[] bytes, int index, int limit) { + for (;;) { + int byte1, byte2; + + // Optimize for interior runs of ASCII bytes. + do { + if (index >= limit) { + return COMPLETE; + } + } while ((byte1 = bytes[index++]) >= 0); + + if (byte1 < (byte) 0xE0) { + // two-byte form + + if (index >= limit) { + return byte1; + } + + // Simultaneously checks for illegal trailing-byte in + // leading position and overlong 2-byte form. + if (byte1 < (byte) 0xC2 || + bytes[index++] > (byte) 0xBF) { + return MALFORMED; + } + } else if (byte1 < (byte) 0xF0) { + // three-byte form + + if (index >= limit - 1) { // incomplete sequence + return incompleteStateFor(bytes, index, limit); + } + if ((byte2 = bytes[index++]) > (byte) 0xBF || + // overlong? 5 most significant bits must not all be zero + (byte1 == (byte) 0xE0 && byte2 < (byte) 0xA0) || + // check for illegal surrogate codepoints + (byte1 == (byte) 0xED && byte2 >= (byte) 0xA0) || + // byte3 trailing-byte test + bytes[index++] > (byte) 0xBF) { + return MALFORMED; + } + } else { + // four-byte form + + if (index >= limit - 2) { // incomplete sequence + return incompleteStateFor(bytes, index, limit); + } + if ((byte2 = bytes[index++]) > (byte) 0xBF || + // Check that 1 <= plane <= 16. Tricky optimized form of: + // if (byte1 > (byte) 0xF4 || + // byte1 == (byte) 0xF0 && byte2 < (byte) 0x90 || + // byte1 == (byte) 0xF4 && byte2 > (byte) 0x8F) + (((byte1 << 28) + (byte2 - (byte) 0x90)) >> 30) != 0 || + // byte3 trailing-byte test + bytes[index++] > (byte) 0xBF || + // byte4 trailing-byte test + bytes[index++] > (byte) 0xBF) { + return MALFORMED; + } + } + } + } + + private static int incompleteStateFor(int byte1) { + return (byte1 > (byte) 0xF4) ? + MALFORMED : byte1; + } + + private static int incompleteStateFor(int byte1, int byte2) { + return (byte1 > (byte) 0xF4 || + byte2 > (byte) 0xBF) ? + MALFORMED : byte1 ^ (byte2 << 8); + } + + private static int incompleteStateFor(int byte1, int byte2, int byte3) { + return (byte1 > (byte) 0xF4 || + byte2 > (byte) 0xBF || + byte3 > (byte) 0xBF) ? + MALFORMED : byte1 ^ (byte2 << 8) ^ (byte3 << 16); + } + + private static int incompleteStateFor(byte[] bytes, int index, int limit) { + int byte1 = bytes[index - 1]; + switch (limit - index) { + case 0: return incompleteStateFor(byte1); + case 1: return incompleteStateFor(byte1, bytes[index]); + case 2: return incompleteStateFor(byte1, bytes[index], bytes[index + 1]); + default: throw new AssertionError(); + } + } +} diff --git a/retrofit/src/main/java/com/google/protobuf/WireFormat.java b/retrofit/src/main/java/com/google/protobuf/WireFormat.java new file mode 100644 index 0000000000..eba2528ec8 --- /dev/null +++ b/retrofit/src/main/java/com/google/protobuf/WireFormat.java @@ -0,0 +1,163 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package com.google.protobuf; + +/** + * This class is used internally by the Protocol Buffer library and generated + * message implementations. It is public only because those generated messages + * do not reside in the {@code protobuf} package. Others should not use this + * class directly. + * + * This class contains constants and helper functions useful for dealing with + * the Protocol Buffer wire format. + * + * @author kenton@google.com Kenton Varda + */ +public final class WireFormat { + // Do not allow instantiation. + private WireFormat() {} + + public static final int WIRETYPE_VARINT = 0; + public static final int WIRETYPE_FIXED64 = 1; + public static final int WIRETYPE_LENGTH_DELIMITED = 2; + public static final int WIRETYPE_START_GROUP = 3; + public static final int WIRETYPE_END_GROUP = 4; + public static final int WIRETYPE_FIXED32 = 5; + + static final int TAG_TYPE_BITS = 3; + static final int TAG_TYPE_MASK = (1 << TAG_TYPE_BITS) - 1; + + /** Given a tag value, determines the wire type (the lower 3 bits). */ + static int getTagWireType(final int tag) { + return tag & TAG_TYPE_MASK; + } + + /** Given a tag value, determines the field number (the upper 29 bits). */ + public static int getTagFieldNumber(final int tag) { + return tag >>> TAG_TYPE_BITS; + } + + /** Makes a tag value given a field number and wire type. */ + static int makeTag(final int fieldNumber, final int wireType) { + return (fieldNumber << TAG_TYPE_BITS) | wireType; + } + + /** + * Lite equivalent to {@link Descriptors.FieldDescriptor.JavaType}. This is + * only here to support the lite runtime and should not be used by users. + */ + public enum JavaType { + INT(0), + LONG(0L), + FLOAT(0F), + DOUBLE(0D), + BOOLEAN(false), + STRING(""), + BYTE_STRING(ByteString.EMPTY), + ENUM(null), + MESSAGE(null); + + JavaType(final Object defaultDefault) { + this.defaultDefault = defaultDefault; + } + + /** + * The default default value for fields of this type, if it's a primitive + * type. + */ + Object getDefaultDefault() { + return defaultDefault; + } + + private final Object defaultDefault; + } + + /** + * Lite equivalent to {@link Descriptors.FieldDescriptor.Type}. This is + * only here to support the lite runtime and should not be used by users. + */ + public enum FieldType { + DOUBLE (JavaType.DOUBLE , WIRETYPE_FIXED64 ), + FLOAT (JavaType.FLOAT , WIRETYPE_FIXED32 ), + INT64 (JavaType.LONG , WIRETYPE_VARINT ), + UINT64 (JavaType.LONG , WIRETYPE_VARINT ), + INT32 (JavaType.INT , WIRETYPE_VARINT ), + FIXED64 (JavaType.LONG , WIRETYPE_FIXED64 ), + FIXED32 (JavaType.INT , WIRETYPE_FIXED32 ), + BOOL (JavaType.BOOLEAN , WIRETYPE_VARINT ), + STRING (JavaType.STRING , WIRETYPE_LENGTH_DELIMITED) { + public boolean isPackable() { return false; } + }, + GROUP (JavaType.MESSAGE , WIRETYPE_START_GROUP ) { + public boolean isPackable() { return false; } + }, + MESSAGE (JavaType.MESSAGE , WIRETYPE_LENGTH_DELIMITED) { + public boolean isPackable() { return false; } + }, + BYTES (JavaType.BYTE_STRING, WIRETYPE_LENGTH_DELIMITED) { + public boolean isPackable() { return false; } + }, + UINT32 (JavaType.INT , WIRETYPE_VARINT ), + ENUM (JavaType.ENUM , WIRETYPE_VARINT ), + SFIXED32(JavaType.INT , WIRETYPE_FIXED32 ), + SFIXED64(JavaType.LONG , WIRETYPE_FIXED64 ), + SINT32 (JavaType.INT , WIRETYPE_VARINT ), + SINT64 (JavaType.LONG , WIRETYPE_VARINT ); + + FieldType(final JavaType javaType, final int wireType) { + this.javaType = javaType; + this.wireType = wireType; + } + + private final JavaType javaType; + private final int wireType; + + public JavaType getJavaType() { return javaType; } + public int getWireType() { return wireType; } + + public boolean isPackable() { return true; } + } + + // Field numbers for fields in MessageSet wire format. + static final int MESSAGE_SET_ITEM = 1; + static final int MESSAGE_SET_TYPE_ID = 2; + static final int MESSAGE_SET_MESSAGE = 3; + + // Tag numbers. + static final int MESSAGE_SET_ITEM_TAG = + makeTag(MESSAGE_SET_ITEM, WIRETYPE_START_GROUP); + static final int MESSAGE_SET_ITEM_END_TAG = + makeTag(MESSAGE_SET_ITEM, WIRETYPE_END_GROUP); + static final int MESSAGE_SET_TYPE_ID_TAG = + makeTag(MESSAGE_SET_TYPE_ID, WIRETYPE_VARINT); + static final int MESSAGE_SET_MESSAGE_TAG = + makeTag(MESSAGE_SET_MESSAGE, WIRETYPE_LENGTH_DELIMITED); +} diff --git a/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt b/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt new file mode 100644 index 0000000000..8ce98f4e42 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt @@ -0,0 +1,58 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.impl + +import kotlinx.metadata.ClassName +import kotlinx.metadata.KmAnnotation +import kotlinx.metadata.KmAnnotationArgument +import org.jetbrains.kotlin.metadata.ProtoBuf +import org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.* +import org.jetbrains.kotlin.metadata.deserialization.Flags +import org.jetbrains.kotlin.metadata.deserialization.NameResolver + +fun ProtoBuf.Annotation.readAnnotation(strings: NameResolver): KmAnnotation = + KmAnnotation( + strings.getClassName(id), + argumentList.mapNotNull { argument -> + argument.value.readAnnotationArgument(strings)?.let { value -> + strings.getString(argument.nameId) to value + } + }.toMap() + ) + +fun ProtoBuf.Annotation.Argument.Value.readAnnotationArgument(strings: NameResolver): KmAnnotationArgument? { + if (Flags.IS_UNSIGNED[flags]) { + return when (type) { + BYTE -> KmAnnotationArgument.LiteralValue.UByteValue(intValue.toByte().toUByte()) + SHORT -> KmAnnotationArgument.LiteralValue.UShortValue(intValue.toShort().toUShort()) + INT -> KmAnnotationArgument.LiteralValue.UIntValue(intValue.toInt().toUInt()) + LONG -> KmAnnotationArgument.LiteralValue.ULongValue(intValue.toULong()) + else -> error("Cannot read value of unsigned type: $type") + } + } + + return when (type) { + BYTE -> KmAnnotationArgument.LiteralValue.ByteValue(intValue.toByte()) + CHAR -> KmAnnotationArgument.LiteralValue.CharValue(intValue.toInt().toChar()) + SHORT -> KmAnnotationArgument.LiteralValue.ShortValue(intValue.toShort()) + INT -> KmAnnotationArgument.LiteralValue.IntValue(intValue.toInt()) + LONG -> KmAnnotationArgument.LiteralValue.LongValue(intValue) + FLOAT -> KmAnnotationArgument.LiteralValue.FloatValue(floatValue) + DOUBLE -> KmAnnotationArgument.LiteralValue.DoubleValue(doubleValue) + BOOLEAN -> KmAnnotationArgument.LiteralValue.BooleanValue(intValue != 0L) + STRING -> KmAnnotationArgument.LiteralValue.StringValue(strings.getString(stringValue)) + CLASS -> KmAnnotationArgument.LiteralValue.KClassValue(strings.getClassName(classId), arrayDimensionCount) + ENUM -> KmAnnotationArgument.LiteralValue.EnumValue(strings.getClassName(classId), strings.getString(enumValueId)) + ANNOTATION -> KmAnnotationArgument.LiteralValue.AnnotationValue(annotation.readAnnotation(strings)) + ARRAY -> KmAnnotationArgument.LiteralValue.ArrayValue(arrayElementList.mapNotNull { it.readAnnotationArgument(strings) }) + null -> null + } +} + +internal fun NameResolver.getClassName(index: Int): ClassName { + val name = getQualifiedClassName(index) + return if (isLocalClassName(index)) ".$name" else name +} diff --git a/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt b/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt new file mode 100644 index 0000000000..d1276f7ea2 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt @@ -0,0 +1,510 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.impl + +import kotlinx.metadata.* +import kotlinx.metadata.Flags // Don't remove this import. See KT-45553 +import kotlinx.metadata.impl.extensions.MetadataExtensions +import org.jetbrains.kotlin.metadata.ProtoBuf +import org.jetbrains.kotlin.metadata.deserialization.* +import org.jetbrains.kotlin.metadata.deserialization.Flags as F + +/** + * Allows to populate [ReadContext] with additional data + * that can be used when reading metadata in [MetadataExtensions]. + */ +interface ReadContextExtension + +class ReadContext( + val strings: NameResolver, + val types: TypeTable, + internal val versionRequirements: VersionRequirementTable, + private val parent: ReadContext? = null, + val contextExtensions: List = emptyList() +) { + private val typeParameterNameToId = mutableMapOf() + + internal val extensions = MetadataExtensions.INSTANCES + + operator fun get(index: Int): String = + strings.getString(index) + + fun className(index: Int): ClassName = + strings.getClassName(index) + + fun getTypeParameterId(name: Int): Int? = + typeParameterNameToId[name] ?: parent?.getTypeParameterId(name) + + fun withTypeParameters(typeParameters: List): ReadContext = + ReadContext(strings, types, versionRequirements, this, contextExtensions).apply { + for (typeParameter in typeParameters) { + typeParameterNameToId[typeParameter.name] = typeParameter.id + } + } +} + +fun ProtoBuf.Class.accept( + v: KmClassVisitor, + strings: NameResolver, + contextExtensions: List = emptyList() +) { + val c = ReadContext( + strings, + TypeTable(typeTable), + VersionRequirementTable.create(versionRequirementTable), + contextExtensions = contextExtensions + ).withTypeParameters(typeParameterList) + + v.visit(flags, c.className(fqName)) + + for (typeParameter in typeParameterList) { + typeParameter.accept(v::visitTypeParameter, c) + } + + for (supertype in supertypes(c.types)) { + v.visitSupertype(supertype.typeFlags)?.let { supertype.accept(it, c) } + } + + for (constructor in constructorList) { + v.visitConstructor(constructor.flags)?.let { constructor.accept(it, c) } + } + + v.visitDeclarations(functionList, propertyList, typeAliasList, c) + + if (hasCompanionObjectName()) { + v.visitCompanionObject(c[companionObjectName]) + } + + for (nestedClassName in nestedClassNameList) { + v.visitNestedClass(c[nestedClassName]) + } + + for (enumEntry in enumEntryList) { + if (!enumEntry.hasName()) { + throw InconsistentKotlinMetadataException("No name for EnumEntry") + } + v.visitEnumEntry(c[enumEntry.name]) + } + + for (sealedSubclassFqName in sealedSubclassFqNameList) { + v.visitSealedSubclass(c.className(sealedSubclassFqName)) + } + + if (hasInlineClassUnderlyingPropertyName()) { + v.visitInlineClassUnderlyingPropertyName(c[inlineClassUnderlyingPropertyName]) + } + loadInlineClassUnderlyingType(c)?.let { underlyingType -> + v.visitInlineClassUnderlyingType(underlyingType.flags)?.let { underlyingType.accept(it, c) } + } + + for (versionRequirement in versionRequirementList) { + v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } + } + + for (extension in c.extensions) { + extension.readClassExtensions(v, this, c) + } + + v.visitEnd() +} + +private fun ProtoBuf.Class.loadInlineClassUnderlyingType(c: ReadContext): ProtoBuf.Type? { + val type = inlineClassUnderlyingType(c.types) + if (type != null) return type + + if (!hasInlineClassUnderlyingPropertyName()) return null + + // Kotlin compiler doesn't write underlying type to metadata in case it can be loaded from the underlying property. + return propertyList + .singleOrNull { it.receiverType(c.types) == null && c[it.name] == c[inlineClassUnderlyingPropertyName] } + ?.returnType(c.types) +} + +fun ProtoBuf.Package.accept( + v: KmPackageVisitor, + strings: NameResolver, + contextExtensions: List = emptyList() +) { + val c = ReadContext( + strings, + TypeTable(typeTable), + VersionRequirementTable.create(versionRequirementTable), + contextExtensions = contextExtensions + ) + + v.visitDeclarations(functionList, propertyList, typeAliasList, c) + + for (extension in c.extensions) { + extension.readPackageExtensions(v, this, c) + } + + v.visitEnd() +} + +fun ProtoBuf.PackageFragment.accept( + v: KmModuleFragmentVisitor, + strings: NameResolver, + contextExtensions: List = emptyList() +) { + val c = ReadContext( + strings, + TypeTable(ProtoBuf.TypeTable.newBuilder().build()), + VersionRequirementTable.EMPTY, + contextExtensions = contextExtensions + ) + + v.visitPackage()?.let { `package`.accept(it, strings, contextExtensions) } + + class_List.forEach { clazz -> + v.visitClass()?.let { clazz.accept(it, strings, contextExtensions) } + } + + for (extension in c.extensions) { + extension.readModuleFragmentExtensions(v, this, c) + } + + v.visitEnd() +} + +private fun KmDeclarationContainerVisitor.visitDeclarations( + functions: List, + properties: List, + typeAliases: List, + c: ReadContext +) { + for (function in functions) { + visitFunction(function.flags, c[function.name])?.let { function.accept(it, c) } + } + + for (property in properties) { + visitProperty( + property.flags, c[property.name], property.getPropertyGetterFlags(), property.getPropertySetterFlags() + )?.let { property.accept(it, c) } + } + + for (typeAlias in typeAliases) { + visitTypeAlias(typeAlias.flags, c[typeAlias.name])?.let { typeAlias.accept(it, c) } + } +} + +fun ProtoBuf.Function.accept(v: KmLambdaVisitor, strings: NameResolver) { + val c = ReadContext(strings, TypeTable(typeTable), VersionRequirementTable.EMPTY) + + v.visitFunction(flags, c[name])?.let { accept(it, c) } + + v.visitEnd() +} + +private fun ProtoBuf.Constructor.accept(v: KmConstructorVisitor, c: ReadContext) { + for (parameter in valueParameterList) { + v.visitValueParameter(parameter.flags, c[parameter.name])?.let { parameter.accept(it, c) } + } + + for (versionRequirement in versionRequirementList) { + v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } + } + + for (extension in c.extensions) { + extension.readConstructorExtensions(v, this, c) + } + + v.visitEnd() +} + +private fun ProtoBuf.Function.accept(v: KmFunctionVisitor, outer: ReadContext) { + val c = outer.withTypeParameters(typeParameterList) + + for (typeParameter in typeParameterList) { + typeParameter.accept(v::visitTypeParameter, c) + } + + receiverType(c.types)?.let { receiverType -> + v.visitReceiverParameterType(receiverType.typeFlags)?.let { receiverType.accept(it, c) } + } + + for (parameter in valueParameterList) { + v.visitValueParameter(parameter.flags, c[parameter.name])?.let { parameter.accept(it, c) } + } + + returnType(c.types).let { returnType -> + v.visitReturnType(returnType.typeFlags)?.let { returnType.accept(it, c) } + } + + if (hasContract()) { + v.visitContract()?.let { contract.accept(it, c) } + } + + for (versionRequirement in versionRequirementList) { + v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } + } + + for (extension in c.extensions) { + extension.readFunctionExtensions(v, this, c) + } + + v.visitEnd() +} + +fun ProtoBuf.Property.accept(v: KmPropertyVisitor, outer: ReadContext) { + val c = outer.withTypeParameters(typeParameterList) + + for (typeParameter in typeParameterList) { + typeParameter.accept(v::visitTypeParameter, c) + } + + receiverType(c.types)?.let { receiverType -> + v.visitReceiverParameterType(receiverType.typeFlags)?.let { receiverType.accept(it, c) } + } + + if (hasSetterValueParameter()) { + val parameter = setterValueParameter + v.visitSetterParameter(parameter.flags, c[parameter.name])?.let { parameter.accept(it, c) } + } + + returnType(c.types).let { returnType -> + v.visitReturnType(returnType.typeFlags)?.let { returnType.accept(it, c) } + } + + for (versionRequirement in versionRequirementList) { + v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } + } + + for (extension in c.extensions) { + extension.readPropertyExtensions(v, this, c) + } + + v.visitEnd() +} + +private fun ProtoBuf.TypeAlias.accept(v: KmTypeAliasVisitor, outer: ReadContext) { + val c = outer.withTypeParameters(typeParameterList) + + for (typeParameter in typeParameterList) { + typeParameter.accept(v::visitTypeParameter, c) + } + + underlyingType(c.types).let { underlyingType -> + v.visitUnderlyingType(underlyingType.typeFlags)?.let { underlyingType.accept(it, c) } + } + + expandedType(c.types).let { expandedType -> + v.visitExpandedType(expandedType.typeFlags)?.let { expandedType.accept(it, c) } + } + + for (annotation in annotationList) { + v.visitAnnotation(annotation.readAnnotation(c.strings)) + } + + for (versionRequirement in versionRequirementList) { + v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } + } + + for (extension in c.extensions) { + extension.readTypeAliasExtensions(v, this, c) + } + + v.visitEnd() +} + +private fun ProtoBuf.ValueParameter.accept(v: KmValueParameterVisitor, c: ReadContext) { + type(c.types).let { type -> + v.visitType(type.typeFlags)?.let { type.accept(it, c) } + } + + varargElementType(c.types)?.let { varargElementType -> + v.visitVarargElementType(varargElementType.typeFlags)?.let { varargElementType.accept(it, c) } + } + + for (extension in c.extensions) { + extension.readValueParameterExtensions(v, this, c) + } + + v.visitEnd() +} + +private inline fun ProtoBuf.TypeParameter.accept( + visit: (flags: Flags, name: String, id: Int, variance: KmVariance) -> KmTypeParameterVisitor?, + c: ReadContext +) { + val variance = when (variance!!) { + ProtoBuf.TypeParameter.Variance.IN -> KmVariance.IN + ProtoBuf.TypeParameter.Variance.OUT -> KmVariance.OUT + ProtoBuf.TypeParameter.Variance.INV -> KmVariance.INVARIANT + } + + visit(typeParameterFlags, c[name], id, variance)?.let { accept(it, c) } +} + +private fun ProtoBuf.TypeParameter.accept(v: KmTypeParameterVisitor, c: ReadContext) { + for (upperBound in upperBounds(c.types)) { + v.visitUpperBound(upperBound.typeFlags)?.let { upperBound.accept(it, c) } + } + + for (extension in c.extensions) { + extension.readTypeParameterExtensions(v, this, c) + } + + v.visitEnd() +} + +private fun ProtoBuf.Type.accept(v: KmTypeVisitor, c: ReadContext) { + when { + hasClassName() -> v.visitClass(c.className(className)) + hasTypeAliasName() -> v.visitTypeAlias(c.className(typeAliasName)) + hasTypeParameter() -> v.visitTypeParameter(typeParameter) + hasTypeParameterName() -> { + val id = c.getTypeParameterId(typeParameterName) + ?: throw InconsistentKotlinMetadataException("No type parameter id for ${c[typeParameterName]}") + v.visitTypeParameter(id) + } + else -> { + throw InconsistentKotlinMetadataException("No classifier (class, type alias or type parameter) recorded for Type") + } + } + + for (argument in argumentList) { + val variance = when (argument.projection!!) { + ProtoBuf.Type.Argument.Projection.IN -> KmVariance.IN + ProtoBuf.Type.Argument.Projection.OUT -> KmVariance.OUT + ProtoBuf.Type.Argument.Projection.INV -> KmVariance.INVARIANT + ProtoBuf.Type.Argument.Projection.STAR -> null + } + + if (variance != null) { + val argumentType = argument.type(c.types) + ?: throw InconsistentKotlinMetadataException("No type argument for non-STAR projection in Type") + v.visitArgument(argumentType.typeFlags, variance)?.let { argumentType.accept(it, c) } + } else { + v.visitStarProjection() + } + } + + abbreviatedType(c.types)?.let { abbreviatedType -> + v.visitAbbreviatedType(abbreviatedType.typeFlags)?.let { abbreviatedType.accept(it, c) } + } + + outerType(c.types)?.let { outerType -> + v.visitOuterType(outerType.typeFlags)?.let { outerType.accept(it, c) } + } + + flexibleUpperBound(c.types)?.let { upperBound -> + v.visitFlexibleTypeUpperBound( + upperBound.typeFlags, + if (hasFlexibleTypeCapabilitiesId()) c[flexibleTypeCapabilitiesId] else null + )?.let { upperBound.accept(it, c) } + } + + for (extension in c.extensions) { + extension.readTypeExtensions(v, this, c) + } + + v.visitEnd() +} + +private fun acceptVersionRequirementVisitor(id: Int, v: KmVersionRequirementVisitor, c: ReadContext) { + val message = VersionRequirement.create(id, c.strings, c.versionRequirements) + ?: throw InconsistentKotlinMetadataException("No VersionRequirement with the given id in the table") + + val kind = when (message.kind) { + ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION -> KmVersionRequirementVersionKind.LANGUAGE_VERSION + ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION -> KmVersionRequirementVersionKind.COMPILER_VERSION + ProtoBuf.VersionRequirement.VersionKind.API_VERSION -> KmVersionRequirementVersionKind.API_VERSION + } + + val level = when (message.level) { + DeprecationLevel.WARNING -> KmVersionRequirementLevel.WARNING + DeprecationLevel.ERROR -> KmVersionRequirementLevel.ERROR + DeprecationLevel.HIDDEN -> KmVersionRequirementLevel.HIDDEN + } + + v.visit(kind, level, message.errorCode, message.message) + + val (major, minor, patch) = message.version + v.visitVersion(major, minor, patch) + + v.visitEnd() +} + +private fun ProtoBuf.Contract.accept(v: KmContractVisitor, c: ReadContext) { + for (effect in effectList) { + if (!effect.hasEffectType()) continue + + val effectType = when (effect.effectType!!) { + ProtoBuf.Effect.EffectType.RETURNS_CONSTANT -> KmEffectType.RETURNS_CONSTANT + ProtoBuf.Effect.EffectType.CALLS -> KmEffectType.CALLS + ProtoBuf.Effect.EffectType.RETURNS_NOT_NULL -> KmEffectType.RETURNS_NOT_NULL + } + + val effectKind = if (!effect.hasKind()) null else when (effect.kind!!) { + ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE -> KmEffectInvocationKind.AT_MOST_ONCE + ProtoBuf.Effect.InvocationKind.EXACTLY_ONCE -> KmEffectInvocationKind.EXACTLY_ONCE + ProtoBuf.Effect.InvocationKind.AT_LEAST_ONCE -> KmEffectInvocationKind.AT_LEAST_ONCE + } + + v.visitEffect(effectType, effectKind)?.let { effect.accept(it, c) } + } + + v.visitEnd() +} + +private fun ProtoBuf.Effect.accept(v: KmEffectVisitor, c: ReadContext) { + for (constructorArgument in effectConstructorArgumentList) { + v.visitConstructorArgument()?.let { constructorArgument.accept(it, c) } + } + + if (hasConclusionOfConditionalEffect()) { + v.visitConclusionOfConditionalEffect()?.let { conclusionOfConditionalEffect.accept(it, c) } + } + + v.visitEnd() +} + +private fun ProtoBuf.Expression.accept(v: KmEffectExpressionVisitor, c: ReadContext) { + v.visit( + flags, + if (hasValueParameterReference()) valueParameterReference else null + ) + + if (hasConstantValue()) { + v.visitConstantValue( + when (constantValue!!) { + ProtoBuf.Expression.ConstantValue.TRUE -> true + ProtoBuf.Expression.ConstantValue.FALSE -> false + ProtoBuf.Expression.ConstantValue.NULL -> null + } + ) + } + + isInstanceType(c.types)?.let { type -> + v.visitIsInstanceType(type.typeFlags)?.let { type.accept(it, c) } + } + + for (andArgument in andArgumentList) { + v.visitAndArgument()?.let { andArgument.accept(it, c) } + } + + for (orArgument in orArgumentList) { + v.visitOrArgument()?.let { orArgument.accept(it, c) } + } + + v.visitEnd() +} + +private val ProtoBuf.Type.typeFlags: Flags + get() = (if (nullable) 1 shl 0 else 0) + + (flags shl 1) + +private val ProtoBuf.TypeParameter.typeParameterFlags: Flags + get() = if (reified) 1 else 0 + +fun ProtoBuf.Property.getPropertyGetterFlags(): Flags = + if (hasGetterFlags()) getterFlags else getDefaultPropertyAccessorFlags(flags) + +fun ProtoBuf.Property.getPropertySetterFlags(): Flags = + if (hasSetterFlags()) setterFlags else getDefaultPropertyAccessorFlags(flags) + +private fun getDefaultPropertyAccessorFlags(flags: Flags): Flags = + F.getAccessorFlags(F.HAS_ANNOTATIONS.get(flags), F.VISIBILITY.get(flags), F.MODALITY.get(flags), false, false, false) diff --git a/retrofit/src/main/java/kotlinx/metadata/ClassName.kt b/retrofit/src/main/java/kotlinx/metadata/ClassName.kt new file mode 100644 index 0000000000..51cadd7942 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/ClassName.kt @@ -0,0 +1,23 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:JvmName("ClassNameKt") + +package kotlinx.metadata + +/** + * A fully qualified name of a classifier from the Kotlin's point of view. May differ from the JVM name of the class + * which is the runtime representation of this Kotlin classifier (for example, Kotlin class "kotlin/Int" -> JVM class "java/lang/Integer") + * + * Package names in this name are separated by '/', and class names are separated by '.', for example: `"org/foo/bar/Baz.Nested"`. + * + * If this name starts with '.', it represents a local class or an anonymous object. This is used by the Kotlin compiler + * to prevent lookup of this name in the resolution. + */ +// TODO: use inline class in 1.3 +typealias ClassName = String + +val ClassName.isLocal: Boolean + get() = this.startsWith(".") diff --git a/retrofit/src/main/java/kotlinx/metadata/Flag.kt b/retrofit/src/main/java/kotlinx/metadata/Flag.kt new file mode 100644 index 0000000000..42ebc9eea4 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/Flag.kt @@ -0,0 +1,520 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata + +import org.jetbrains.kotlin.metadata.ProtoBuf.* +import org.jetbrains.kotlin.metadata.deserialization.Flags as F +import org.jetbrains.kotlin.metadata.ProtoBuf.Class.Kind as ClassKind + +/** + * Represents a boolean flag that is either present or not in a Kotlin declaration. A "flag" is a boolean trait that is either present + * or not in a declaration. To check whether the flag is present in the bitmask, call [Flag.invoke] on the flag, passing the bitmask + * as the argument: + * + * override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? { + * if (Flag.Function.IS_INLINE(flags)) { + * ... + * } + * } + * + * To construct a bitmask out of several flags, call [flagsOf] on the needed flags: + * + * v.visitFunction(flagsOf(Flag.Function.IS_DECLARATION, Flag.Function.IS_INLINE), "foo") + * + * Flag common to multiple kinds of Kotlin declarations ("common flags") are declared in [Flag.Common]. + * Flag applicable to specific kinds of declarations ("declaration-specific flags") are declared in nested objects of the [Flag] object. + * + * Some flags are mutually exclusive, i.e. there are "flag groups" such that no more than one flag from each group can be present + * in the same bitmask. Among common flags, there are the following flag groups: + * * visibility flags: [IS_INTERNAL], [IS_PRIVATE], [IS_PROTECTED], [IS_PUBLIC], [IS_PRIVATE_TO_THIS], [IS_LOCAL] + * * modality flags: [IS_FINAL], [IS_OPEN], [IS_ABSTRACT], [IS_SEALED] + * + * Some declaration-specific flags form other flag groups, see the documentation of the corresponding containers for more information. + * + * @see Flags + * @see flagsOf + */ +class Flag(private val offset: Int, private val bitWidth: Int, private val value: Int) { + internal constructor(field: F.FlagField<*>, value: Int) : this(field.offset, field.bitWidth, value) + + internal constructor(field: F.BooleanFlagField) : this(field, 1) + + internal operator fun plus(flags: Flags): Flags = + (flags and (((1 shl bitWidth) - 1) shl offset).inv()) + (value shl offset) + + /** + * Checks whether the flag is present in the given bitmask. + */ + operator fun invoke(flags: Flags): Boolean = + (flags ushr offset) and ((1 shl bitWidth) - 1) == value + + companion object Common { + /** + * Signifies that the corresponding declaration has at least one annotation. + * + * This flag is useful for reading Kotlin metadata on JVM efficiently. On JVM, most of the annotations are written not to the Kotlin + * metadata, but directly on the corresponding declarations in the class file. This flag can be used as an optimization to avoid + * reading annotations from the class file (which can be slow) in case when a declaration has no annotations. + */ + @JvmField + val HAS_ANNOTATIONS = Flag(F.HAS_ANNOTATIONS) + + + /** + * A visibility flag, signifying that the corresponding declaration is `internal`. + */ + @JvmField + val IS_INTERNAL = Flag(F.VISIBILITY, Visibility.INTERNAL_VALUE) + + /** + * A visibility flag, signifying that the corresponding declaration is `private`. + */ + @JvmField + val IS_PRIVATE = Flag(F.VISIBILITY, Visibility.PRIVATE_VALUE) + + /** + * A visibility flag, signifying that the corresponding declaration is `protected`. + */ + @JvmField + val IS_PROTECTED = Flag(F.VISIBILITY, Visibility.PROTECTED_VALUE) + + /** + * A visibility flag, signifying that the corresponding declaration is `public`. + */ + @JvmField + val IS_PUBLIC = Flag(F.VISIBILITY, Visibility.PUBLIC_VALUE) + + /** + * A visibility flag, signifying that the corresponding declaration is "private-to-this", which is a non-denotable visibility of + * private members in Kotlin which are callable only on the same instance of the declaring class. + */ + @JvmField + val IS_PRIVATE_TO_THIS = Flag(F.VISIBILITY, Visibility.PRIVATE_TO_THIS_VALUE) + + /** + * A visibility flag, signifying that the corresponding declaration is local, i.e. declared inside a code block + * and not visible from the outside. + */ + @JvmField + val IS_LOCAL = Flag(F.VISIBILITY, Visibility.LOCAL_VALUE) + + + /** + * A modality flag, signifying that the corresponding declaration is `final`. + */ + @JvmField + val IS_FINAL = Flag(F.MODALITY, Modality.FINAL_VALUE) + + /** + * A modality flag, signifying that the corresponding declaration is `open`. + */ + @JvmField + val IS_OPEN = Flag(F.MODALITY, Modality.OPEN_VALUE) + + /** + * A modality flag, signifying that the corresponding declaration is `abstract`. + */ + @JvmField + val IS_ABSTRACT = Flag(F.MODALITY, Modality.ABSTRACT_VALUE) + + /** + * A modality flag, signifying that the corresponding declaration is `sealed`. + */ + @JvmField + val IS_SEALED = Flag(F.MODALITY, Modality.SEALED_VALUE) + } + + /** + * A container of flags applicable to Kotlin classes, including interfaces, objects, enum classes and annotation classes. + * + * In addition to the common flag groups, the following flag groups exist for class flags: + * * class kind flags: [IS_CLASS], [IS_INTERFACE], [IS_ENUM_CLASS], [IS_ENUM_ENTRY], [IS_ANNOTATION_CLASS], [IS_OBJECT], + * [IS_COMPANION_OBJECT] + */ + object Class { + /** + * A class kind flag, signifying that the corresponding class is a usual `class`. + */ + @JvmField + val IS_CLASS = Flag(F.CLASS_KIND, ClassKind.CLASS_VALUE) + + /** + * A class kind flag, signifying that the corresponding class is an `interface`. + */ + @JvmField + val IS_INTERFACE = Flag(F.CLASS_KIND, ClassKind.INTERFACE_VALUE) + + /** + * A class kind flag, signifying that the corresponding class is an `enum class`. + */ + @JvmField + val IS_ENUM_CLASS = Flag(F.CLASS_KIND, ClassKind.ENUM_CLASS_VALUE) + + /** + * A class kind flag, signifying that the corresponding class is an enum entry. + */ + @JvmField + val IS_ENUM_ENTRY = Flag(F.CLASS_KIND, ClassKind.ENUM_ENTRY_VALUE) + + /** + * A class kind flag, signifying that the corresponding class is an `annotation class`. + */ + @JvmField + val IS_ANNOTATION_CLASS = Flag(F.CLASS_KIND, ClassKind.ANNOTATION_CLASS_VALUE) + + /** + * A class kind flag, signifying that the corresponding class is a non-companion `object`. + */ + @JvmField + val IS_OBJECT = Flag(F.CLASS_KIND, ClassKind.OBJECT_VALUE) + + /** + * A class kind flag, signifying that the corresponding class is a `companion object`. + */ + @JvmField + val IS_COMPANION_OBJECT = Flag(F.CLASS_KIND, ClassKind.COMPANION_OBJECT_VALUE) + + + /** + * Signifies that the corresponding class is `inner`. + */ + @JvmField + val IS_INNER = Flag(F.IS_INNER) + + /** + * Signifies that the corresponding class is `data`. + */ + @JvmField + val IS_DATA = Flag(F.IS_DATA) + + /** + * Signifies that the corresponding class is `external`. + */ + @JvmField + val IS_EXTERNAL = Flag(F.IS_EXTERNAL_CLASS) + + /** + * Signifies that the corresponding class is `expect`. + */ + @JvmField + val IS_EXPECT = Flag(F.IS_EXPECT_CLASS) + + @JvmField + @Deprecated( + "Use IS_VALUE instead, which returns true if the class is either a pre-1.5 inline class, or a 1.5+ value class.", + level = DeprecationLevel.ERROR + ) + @Suppress("unused") + val IS_INLINE = Flag(F.IS_INLINE_CLASS) + + /** + * Signifies that the corresponding class is either a pre-Kotlin-1.5 `inline` class, or a 1.5+ `value` class. + */ + @JvmField + val IS_VALUE = Flag(F.IS_INLINE_CLASS) + + /** + * Signifies that the corresponding class is a functional interface, i.e. marked with the keyword `fun`. + */ + @JvmField + val IS_FUN = Flag(F.IS_FUN_INTERFACE) + } + + /** + * A container of flags applicable to Kotlin constructors. + */ + object Constructor { + @JvmField + @Deprecated("Use IS_SECONDARY which holds inverted value instead.", level = DeprecationLevel.ERROR) + @Suppress("unused") + val IS_PRIMARY = Flag(F.IS_SECONDARY, 0) + + /** + * Signifies that the corresponding constructor is secondary, i.e. declared not in the class header, but in the class body. + */ + @JvmField + val IS_SECONDARY = Flag(F.IS_SECONDARY) + + /** + * Signifies that the corresponding constructor has non-stable parameter names, i.e. cannot be called with named arguments. + */ + @JvmField + val HAS_NON_STABLE_PARAMETER_NAMES = Flag(F.IS_CONSTRUCTOR_WITH_NON_STABLE_PARAMETER_NAMES) + } + + /** + * A container of flags applicable to Kotlin functions. + * + * In addition to the common flag groups, the following flag groups exist for function flags: + * * member kind flags: [IS_DECLARATION], [IS_FAKE_OVERRIDE], [IS_DELEGATION], [IS_SYNTHESIZED] + */ + object Function { + /** + * A member kind flag, signifying that the corresponding function is explicitly declared in the containing class. + */ + @JvmField + val IS_DECLARATION = Flag(F.MEMBER_KIND, MemberKind.DECLARATION_VALUE) + + /** + * A member kind flag, signifying that the corresponding function exists in the containing class because a function with a suitable + * signature exists in a supertype. This flag is not written by the Kotlin compiler and its effects are unspecified. + */ + @JvmField + val IS_FAKE_OVERRIDE = Flag(F.MEMBER_KIND, MemberKind.FAKE_OVERRIDE_VALUE) + + /** + * A member kind flag, signifying that the corresponding function exists in the containing class because it has been produced + * by interface delegation (delegation "by"). + */ + @JvmField + val IS_DELEGATION = Flag(F.MEMBER_KIND, MemberKind.DELEGATION_VALUE) + + /** + * A member kind flag, signifying that the corresponding function exists in the containing class because it has been synthesized + * by the compiler and has no declaration in the source code. + */ + @JvmField + val IS_SYNTHESIZED = Flag(F.MEMBER_KIND, MemberKind.SYNTHESIZED_VALUE) + + + /** + * Signifies that the corresponding function is `operator`. + */ + @JvmField + val IS_OPERATOR = Flag(F.IS_OPERATOR) + + /** + * Signifies that the corresponding function is `infix`. + */ + @JvmField + val IS_INFIX = Flag(F.IS_INFIX) + + /** + * Signifies that the corresponding function is `inline`. + */ + @JvmField + val IS_INLINE = Flag(F.IS_INLINE) + + /** + * Signifies that the corresponding function is `tailrec`. + */ + @JvmField + val IS_TAILREC = Flag(F.IS_TAILREC) + + /** + * Signifies that the corresponding function is `external`. + */ + @JvmField + val IS_EXTERNAL = Flag(F.IS_EXTERNAL_FUNCTION) + + /** + * Signifies that the corresponding function is `suspend`. + */ + @JvmField + val IS_SUSPEND = Flag(F.IS_SUSPEND) + + /** + * Signifies that the corresponding function is `expect`. + */ + @JvmField + val IS_EXPECT = Flag(F.IS_EXPECT_FUNCTION) + + /** + * Signifies that the corresponding function has non-stable parameter names, i.e. cannot be called with named arguments. + */ + @JvmField + val HAS_NON_STABLE_PARAMETER_NAMES = Flag(F.IS_FUNCTION_WITH_NON_STABLE_PARAMETER_NAMES) + } + + /** + * A container of flags applicable to Kotlin properties. + * + * In addition to the common flag groups, the following flag groups exist for property flags: + * * member kind flags: [IS_DECLARATION], [IS_FAKE_OVERRIDE], [IS_DELEGATION], [IS_SYNTHESIZED] + */ + object Property { + /** + * A member kind flag, signifying that the corresponding property is explicitly declared in the containing class. + */ + @JvmField + val IS_DECLARATION = Flag(F.MEMBER_KIND, MemberKind.DECLARATION_VALUE) + + /** + * A member kind flag, signifying that the corresponding property exists in the containing class because a property with a suitable + * signature exists in a supertype. This flag is not written by the Kotlin compiler and its effects are unspecified. + */ + @JvmField + val IS_FAKE_OVERRIDE = Flag(F.MEMBER_KIND, MemberKind.FAKE_OVERRIDE_VALUE) + + /** + * A member kind flag, signifying that the corresponding property exists in the containing class because it has been produced + * by interface delegation (delegation "by"). + */ + @JvmField + val IS_DELEGATION = Flag(F.MEMBER_KIND, MemberKind.DELEGATION_VALUE) + + /** + * A member kind flag, signifying that the corresponding property exists in the containing class because it has been synthesized + * by the compiler and has no declaration in the source code. + */ + @JvmField + val IS_SYNTHESIZED = Flag(F.MEMBER_KIND, MemberKind.SYNTHESIZED_VALUE) + + + /** + * Signifies that the corresponding property is `var`. + */ + @JvmField + val IS_VAR = Flag(F.IS_VAR) + + /** + * Signifies that the corresponding property has a getter. + */ + @JvmField + val HAS_GETTER = Flag(F.HAS_GETTER) + + /** + * Signifies that the corresponding property has a setter. + */ + @JvmField + val HAS_SETTER = Flag(F.HAS_SETTER) + + /** + * Signifies that the corresponding property is `const`. + */ + @JvmField + val IS_CONST = Flag(F.IS_CONST) + + /** + * Signifies that the corresponding property is `lateinit`. + */ + @JvmField + val IS_LATEINIT = Flag(F.IS_LATEINIT) + + /** + * Signifies that the corresponding property has a constant value. On JVM, this flag allows an optimization similarly to + * [F.HAS_ANNOTATIONS]: constant values of properties are written to the bytecode directly, and this flag can be used to avoid + * reading the value from the bytecode in case there isn't one. + */ + @JvmField + val HAS_CONSTANT = Flag(F.HAS_CONSTANT) + + /** + * Signifies that the corresponding property is `external`. + */ + @JvmField + val IS_EXTERNAL = Flag(F.IS_EXTERNAL_PROPERTY) + + /** + * Signifies that the corresponding property is a delegated property. + */ + @JvmField + val IS_DELEGATED = Flag(F.IS_DELEGATED) + + /** + * Signifies that the corresponding property is `expect`. + */ + @JvmField + val IS_EXPECT = Flag(F.IS_EXPECT_PROPERTY) + } + + /** + * A container of flags applicable to Kotlin property getters and setters. + */ + object PropertyAccessor { + /** + * Signifies that the corresponding property accessor is not default, i.e. it has a body and/or annotations in the source code. + */ + @JvmField + val IS_NOT_DEFAULT = Flag(F.IS_NOT_DEFAULT) + + /** + * Signifies that the corresponding property accessor is `external`. + */ + @JvmField + val IS_EXTERNAL = Flag(F.IS_EXTERNAL_ACCESSOR) + + /** + * Signifies that the corresponding property accessor is `inline`. + */ + @JvmField + val IS_INLINE = Flag(F.IS_INLINE_ACCESSOR) + } + + /** + * A container of flags applicable to Kotlin types. + */ + object Type { + /** + * Signifies that the corresponding type is marked as nullable, i.e. has a question mark at the end of its notation. + */ + @JvmField + val IS_NULLABLE = Flag(0, 1, 1) + + /** + * Signifies that the corresponding type is `suspend`. + */ + @JvmField + val IS_SUSPEND = Flag(F.SUSPEND_TYPE.offset + 1, F.SUSPEND_TYPE.bitWidth, 1) + } + + /** + * A container of flags applicable to Kotlin type parameters. + */ + object TypeParameter { + /** + * Signifies that the corresponding type parameter is `reified`. + */ + @JvmField + val IS_REIFIED = Flag(0, 1, 1) + } + + /** + * A container of flags applicable to Kotlin value parameters. + */ + object ValueParameter { + /** + * Signifies that the corresponding value parameter declares a default value. Note that the default value itself can be a complex + * expression and is not available via metadata. Also note that in case of an override of a parameter with default value, the + * parameter in the derived method does _not_ declare the default value ([DECLARES_DEFAULT_VALUE] == false), but the parameter is + * still optional at the call site because the default value from the base method is used. + */ + @JvmField + val DECLARES_DEFAULT_VALUE = Flag(F.DECLARES_DEFAULT_VALUE) + + /** + * Signifies that the corresponding value parameter is `crossinline`. + */ + @JvmField + val IS_CROSSINLINE = Flag(F.IS_CROSSINLINE) + + /** + * Signifies that the corresponding value parameter is `noinline`. + */ + @JvmField + val IS_NOINLINE = Flag(F.IS_NOINLINE) + } + + /** + * A container of flags applicable to Kotlin effect expressions. + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + */ + object EffectExpression { + /** + * Signifies that the corresponding effect expression should be negated to compute the proposition or the conclusion of an effect. + */ + @JvmField + val IS_NEGATED = Flag(F.IS_NEGATED) + + /** + * Signifies that the corresponding effect expression checks whether a value of some variable is `null`. + */ + @JvmField + val IS_NULL_CHECK_PREDICATE = Flag(F.IS_NULL_CHECK_PREDICATE) + } +} diff --git a/retrofit/src/main/java/kotlinx/metadata/Flags.kt b/retrofit/src/main/java/kotlinx/metadata/Flags.kt new file mode 100644 index 0000000000..72bc003539 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/Flags.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:JvmName("FlagsKt") + +package kotlinx.metadata + +/** + * Declaration flags are represented as bitmasks of this type. + * + * @see Flag + */ +typealias Flags = Int + +/** + * Combines several flags into an integer bitmask. + * + * Note that in case several mutually exclusive flags are passed (for example, several visibility flags), the resulting bitmask will + * hold the value of the latest flag. For example, `flagsOf(Flag.IS_PRIVATE, Flag.IS_PUBLIC, Flag.IS_INTERNAL)` is the same as + * `flagsOf(Flag.IS_INTERNAL)`. + */ +fun flagsOf(vararg flags: Flag): Flags = + flags.fold(0) { acc, flag -> flag + acc } diff --git a/retrofit/src/main/java/kotlinx/metadata/InconsistentKotlinMetadataException.kt b/retrofit/src/main/java/kotlinx/metadata/InconsistentKotlinMetadataException.kt new file mode 100644 index 0000000000..69c84d20f5 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/InconsistentKotlinMetadataException.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata + +class InconsistentKotlinMetadataException(message: String, cause: Throwable? = null) : RuntimeException(message, cause) diff --git a/retrofit/src/main/java/kotlinx/metadata/annotations.kt b/retrofit/src/main/java/kotlinx/metadata/annotations.kt new file mode 100644 index 0000000000..ac81024e57 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/annotations.kt @@ -0,0 +1,67 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata + +/** + * Represents an annotation, written to the Kotlin metadata. Note that not all annotations are written to metadata on all platforms. + * For example, on JVM most of the annotations are written directly on the corresponding declarations in the class file, + * and entries in the metadata only have a flag ([Flag.HAS_ANNOTATIONS]) to signal if they do have annotations in the bytecode. + * On JVM, only annotations on type parameters and types are serialized to the Kotlin metadata. + * + * @param className the fully qualified name of the annotation class + * @param arguments explicitly specified arguments to the annotation; does not include default values for annotation parameters + * (specified in the annotation class declaration) + */ +data class KmAnnotation(val className: ClassName, val arguments: Map) + +/** + * Represents an argument to the annotation. + */ +sealed class KmAnnotationArgument { + /** + * A kind of annotation argument, whose value is directly accessible via [value]. + * This is possible for annotation arguments of primitive types, unsigned types and strings. + * + * @param T the type of the value of this argument + */ + sealed class LiteralValue : KmAnnotationArgument() { + /** + * The value of this argument. + */ + abstract val value: T + + data class ByteValue(override val value: Byte) : LiteralValue() + data class CharValue(override val value: Char) : LiteralValue() + data class ShortValue(override val value: Short) : LiteralValue() + data class IntValue(override val value: Int) : LiteralValue() + data class LongValue(override val value: Long) : LiteralValue() + data class FloatValue(override val value: Float) : LiteralValue() + data class DoubleValue(override val value: Double) : LiteralValue() + data class BooleanValue(override val value: Boolean) : LiteralValue() + + // TODO: remove @ExperimentalUnsignedTypes once bootstrap stdlib has stable unsigned types. + @ExperimentalUnsignedTypes + data class UByteValue(override val value: UByte) : LiteralValue() + + @ExperimentalUnsignedTypes + data class UShortValue(override val value: UShort) : LiteralValue() + + @ExperimentalUnsignedTypes + data class UIntValue(override val value: UInt) : LiteralValue() + + @ExperimentalUnsignedTypes + data class ULongValue(override val value: ULong) : LiteralValue() + + data class StringValue(override val value: String) : LiteralValue() + + data class KClassValue(val className: ClassName, val arrayDimensionCount: Int) : KmAnnotationArgument() + + data class EnumValue(val enumClassName: ClassName, val enumEntryName: String) : KmAnnotationArgument() + + data class AnnotationValue(val annotation: KmAnnotation) : KmAnnotationArgument() + data class ArrayValue(val elements: List) : KmAnnotationArgument() + } +} diff --git a/retrofit/src/main/java/kotlinx/metadata/extensions.kt b/retrofit/src/main/java/kotlinx/metadata/extensions.kt new file mode 100644 index 0000000000..2f7f8214ea --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/extensions.kt @@ -0,0 +1,105 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata + +import kotlin.reflect.KClass + +/** + * A type of the extension visitor expected by the code that uses the visitor API. + * + * Each declaration which can have platform-specific extensions in the metadata has a method `visitExtensions` in its visitor, e.g.: + * + * open fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor? + * + * The client code is supposed to return the extension visitor corresponding to the given type, or to return `null` if the type is + * of no interest to that code. Each platform-specific extension visitor has a [KmExtensionType] instance declared in the `TYPE` property + * its companion object. For example, to load JVM extensions on a function, one could do: + * + * override fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor? { + * if (type != JvmFunctionExtensionVisitor.TYPE) return null + * + * return object : JvmFunctionExtensionVisitor() { + * ... + * } + * } + * + * In case an extension visitor of an unrelated type is returned, the code using the visitor API must ignore that visitor. + */ +class KmExtensionType(private val klass: KClass) { + override fun equals(other: Any?): Boolean = + other is KmExtensionType && klass == other.klass + + override fun hashCode(): Int = + klass.hashCode() + + override fun toString(): String = + klass.java.name +} + +/** + * A base interface for all extension visitors. + */ +interface KmExtensionVisitor { + /** + * Type of this extension visitor. + */ + val type: KmExtensionType +} + +/** + * A visitor to visit platform-specific extensions for a declaration container, such as a class or a package fragment. + */ +interface KmDeclarationContainerExtensionVisitor : KmExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a class. + */ +interface KmClassExtensionVisitor : KmDeclarationContainerExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a package fragment. + */ +interface KmPackageExtensionVisitor : KmDeclarationContainerExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a module fragment. + */ +interface KmModuleFragmentExtensionVisitor : KmExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a function. + */ +interface KmFunctionExtensionVisitor : KmExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a property. + */ +interface KmPropertyExtensionVisitor : KmExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a constructor. + */ +interface KmConstructorExtensionVisitor : KmExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a type parameter. + */ +interface KmTypeParameterExtensionVisitor : KmExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a type. + */ +interface KmTypeExtensionVisitor : KmExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a type alias. + */ +interface KmTypeAliasExtensionVisitor : KmExtensionVisitor + +/** + * A visitor to visit platform-specific extensions for a value parameter. + */ +interface KmValueParameterExtensionVisitor : KmExtensionVisitor diff --git a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt new file mode 100644 index 0000000000..139655460a --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt @@ -0,0 +1,51 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.impl.extensions + +import kotlinx.metadata.* +import kotlinx.metadata.impl.ReadContext +import org.jetbrains.kotlin.metadata.ProtoBuf +import java.util.* + +interface MetadataExtensions { + fun readClassExtensions(v: KmClassVisitor, proto: ProtoBuf.Class, c: ReadContext) + + fun readPackageExtensions(v: KmPackageVisitor, proto: ProtoBuf.Package, c: ReadContext) + + fun readModuleFragmentExtensions(v: KmModuleFragmentVisitor, proto: ProtoBuf.PackageFragment, c: ReadContext) + + fun readFunctionExtensions(v: KmFunctionVisitor, proto: ProtoBuf.Function, c: ReadContext) + + fun readPropertyExtensions(v: KmPropertyVisitor, proto: ProtoBuf.Property, c: ReadContext) + + fun readConstructorExtensions(v: KmConstructorVisitor, proto: ProtoBuf.Constructor, c: ReadContext) + + fun readTypeParameterExtensions(v: KmTypeParameterVisitor, proto: ProtoBuf.TypeParameter, c: ReadContext) + + fun readTypeExtensions(v: KmTypeVisitor, proto: ProtoBuf.Type, c: ReadContext) + + fun readTypeAliasExtensions(v: KmTypeAliasVisitor, proto: ProtoBuf.TypeAlias, c: ReadContext) + + fun readValueParameterExtensions(v: KmValueParameterVisitor, proto: ProtoBuf.ValueParameter, c: ReadContext) + + fun createFunctionExtension(): KmFunctionExtension + + fun createTypeExtension(): KmTypeExtension + + fun createValueParameterExtension(): KmValueParameterExtension + + companion object { + val INSTANCES: List by lazy { + ServiceLoader.load(MetadataExtensions::class.java, MetadataExtensions::class.java.classLoader).toList().also { + if (it.isEmpty()) error( + "No MetadataExtensions instances found in the classpath. Please ensure that the META-INF/services/ " + + "is not stripped from your application and that the Java virtual machine is not running " + + "under a security manager" + ) + } + } + } +} diff --git a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt new file mode 100644 index 0000000000..de57491bd9 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.impl.extensions + +import kotlinx.metadata.* + +interface KmExtension : KmExtensionVisitor { + fun accept(visitor: V) +} + +interface KmFunctionExtension : KmFunctionExtensionVisitor, KmExtension + +interface KmTypeExtension : KmTypeExtensionVisitor, KmExtension + +interface KmValueParameterExtension : KmValueParameterExtensionVisitor, KmExtension \ No newline at end of file diff --git a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionUtils.kt b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionUtils.kt new file mode 100644 index 0000000000..6b7229ee31 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionUtils.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.impl.extensions + +import kotlinx.metadata.KmExtensionType +import kotlinx.metadata.KmExtensionVisitor + +internal fun > Collection.singleOfType(type: KmExtensionType): N { + var result: N? = null + for (node in this) { + if (node.type != type) continue + if (result != null) { + throw IllegalStateException("Multiple extensions handle the same extension type: $type") + } + result = node + } + if (result == null) { + throw IllegalStateException("No extensions handle the extension type: $type") + } + return result +} diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt new file mode 100644 index 0000000000..0992b18c6e --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.jvm + +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMemberSignature as JvmMemberSignatureImpl + +/** + * A signature of a JVM method or field. + * + * @property name name of method or field + * @property desc JVM descriptor of a method, e.g. `(Ljava/lang/Object;)Z`, or a field type, e.g. `Ljava/lang/String;` + */ +sealed class JvmMemberSignature { + + abstract val name: String + abstract val desc: String + + /** + * Returns a string representation of the signature. + * + * In case of a method it's just [name] and [desc] concatenated together, e.g. `equals(Ljava/lang/Object;)Z` + * + * In case of a field [name] and [desc] are concatenated with `:` separator, e.g. `value:Ljava/lang/String;` + */ + abstract fun asString(): String + + final override fun toString() = asString() +} + +/** + * A signature of a JVM method in the JVM-based format. + * + * Example: `JvmMethodSignature("equals", "(Ljava/lang/Object;)Z")`. + * + * @see JvmMemberSignature + */ +data class JvmMethodSignature(override val name: String, override val desc: String) : JvmMemberSignature() { + override fun asString() = name + desc +} + +/** + * A signature of a JVM field in the JVM-based format. + * + * Example: `JvmFieldSignature("value", "Ljava/lang/String;")`. + * + * @see JvmMemberSignature + */ +data class JvmFieldSignature(override val name: String, override val desc: String) : JvmMemberSignature() { + override fun asString() = "$name:$desc" +} + + +internal fun JvmMemberSignatureImpl.Method.wrapAsPublic() = JvmMethodSignature(name, desc) +internal fun JvmMemberSignatureImpl.Field.wrapAsPublic() = JvmFieldSignature(name, desc) diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt new file mode 100644 index 0000000000..cb48be85dd --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt @@ -0,0 +1,179 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("MemberVisibilityCanBePrivate") + +package kotlinx.metadata.jvm + +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion + +/** + * A mirror to the [Metadata] annotation on a JVM class file, containing the metadata of Kotlin declarations declared in the class file. + * Properties of this class correspond 1:1 to the properties of [Metadata]. + * + * @param kind see [kind] + * @param metadataVersion see [metadataVersion] + * @param bytecodeVersion see [bytecodeVersion] + * @param data1 see [data1] + * @param data2 see [data2] + * @param extraString see [extraString] + * @param packageName see [packageName] + * @param extraInt see [extraInt] + */ +class KotlinClassHeader +@Deprecated( + "Use another constructor, which doesn't take bytecodeVersion as a parameter.", + ReplaceWith("KotlinClassHeader(kind, metadataVersion, data1, data2, extraString, packageName, extraInt)"), + DeprecationLevel.ERROR +) +constructor( + kind: Int?, + metadataVersion: IntArray?, + bytecodeVersion: IntArray?, + data1: Array?, + data2: Array?, + extraString: String?, + packageName: String?, + extraInt: Int? +) { + @Suppress("DEPRECATION_ERROR") + constructor( + kind: Int?, + metadataVersion: IntArray?, + data1: Array?, + data2: Array?, + extraString: String?, + packageName: String?, + extraInt: Int? + ) : this(kind, metadataVersion, null, data1, data2, extraString, packageName, extraInt) + + /** + * A kind of the metadata this header encodes. + * + * @see Metadata.kind + * @see CLASS_KIND + * @see FILE_FACADE_KIND + * @see SYNTHETIC_CLASS_KIND + * @see MULTI_FILE_CLASS_FACADE_KIND + * @see MULTI_FILE_CLASS_PART_KIND + */ + val kind: Int = kind ?: 1 + + /** + * The version of the metadata provided in other properties of this header. + * + * @see Metadata.metadataVersion + * @see COMPATIBLE_METADATA_VERSION + */ + val metadataVersion: IntArray = metadataVersion ?: intArrayOf() + + /** + * The version of the bytecode interface (naming conventions, signatures) of the corresponding class file. + * + * @see Metadata.bytecodeVersion + * @see COMPATIBLE_BYTECODE_VERSION + */ + @Deprecated( + "Bytecode version had no significant use in Kotlin metadata and it will be removed in a future version.", + level = DeprecationLevel.ERROR + ) + val bytecodeVersion: IntArray = bytecodeVersion ?: intArrayOf() + + /** + * The first array of strings used to encode the metadata. + * + * @see Metadata.data1 + */ + val data1: Array = data1 ?: emptyArray() + + /** + * The second array of strings used to encode the metadata. + * + * @see Metadata.data2 + */ + val data2: Array = data2 ?: emptyArray() + + /** + * An extra string field for the metadata. + * + * @see Metadata.extraString + */ + val extraString: String = extraString ?: "" + + /** + * Fully qualified name of the Kotlin package of the corresponding class, in case [JvmPackageName] was used. + * + * @see Metadata.packageName + */ + val packageName: String = packageName ?: "" + + /** + * An extra int field for the metadata. + * + * @see Metadata.extraInt + */ + val extraInt: Int = extraInt ?: 0 + + companion object { + /** + * A class file kind signifying that the corresponding class file contains a declaration of a Kotlin class. + * + * @see kind + */ + const val CLASS_KIND = 1 + + /** + * A class file kind signifying that the corresponding class file is a compiled Kotlin file facade. + * + * @see kind + */ + const val FILE_FACADE_KIND = 2 + + /** + * A class file kind signifying that the corresponding class file is synthetic, e.g. it's a class for lambda, `$DefaultImpls` class + * for interface method implementations, `$WhenMappings` class for optimized `when` over enums, etc. + * + * @see kind + */ + const val SYNTHETIC_CLASS_KIND = 3 + + /** + * A class file kind signifying that the corresponding class file is a compiled multi-file class facade. + * + * @see kind + * @see JvmMultifileClass + */ + const val MULTI_FILE_CLASS_FACADE_KIND = 4 + + /** + * A class file kind signifying that the corresponding class file is a compiled multi-file class part, i.e. an internal class + * with method bodies and their metadata, accessed only from the corresponding facade. + * + * @see kind + * @see JvmMultifileClass + */ + const val MULTI_FILE_CLASS_PART_KIND = 5 + + /** + * The latest metadata version supported by this version of the library. + * + * @see metadataVersion + */ + @JvmField + val COMPATIBLE_METADATA_VERSION = JvmMetadataVersion.INSTANCE.toArray().copyOf() + + /** + * The latest bytecode version supported by this version of the library. + * + * @see bytecodeVersion + */ + @Deprecated( + "Bytecode version had no significant use in Kotlin metadata and it will be removed in a future version.", + level = DeprecationLevel.ERROR + ) + @JvmField + val COMPATIBLE_BYTECODE_VERSION = intArrayOf(1, 0, 3) + } +} diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassMetadata.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassMetadata.kt new file mode 100644 index 0000000000..bd34b514d1 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassMetadata.kt @@ -0,0 +1,78 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.jvm + +import kotlinx.metadata.* +import kotlinx.metadata.impl.accept +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil +import kotlin.LazyThreadSafetyMode.PUBLICATION + +/** + * Represents the parsed metadata of a Kotlin JVM class file. + * + * To create an instance of [KotlinClassMetadata], first obtain a [KotlinClassHeader] instance by loading the contents + * of the [Metadata] annotation on a class file, and then call [KotlinClassMetadata.read]. + */ +sealed class KotlinClassMetadata(val header: KotlinClassHeader) { + /** + * Represents metadata of a class file containing a declaration of a Kotlin class. + */ + class Class internal constructor(header: KotlinClassHeader) : KotlinClassMetadata(header) { + private val classData by lazy(PUBLICATION) { + val data1 = (header.data1.takeIf(Array<*>::isNotEmpty) + ?: throw InconsistentKotlinMetadataException("data1 must not be empty")) + JvmProtoBufUtil.readClassDataFrom(data1, header.data2) + } + + /** + * Visits metadata of this class with a new [KmClass] instance and returns that instance. + */ + fun toKmClass(): KmClass = + KmClass().apply(this::accept) + + /** + * Makes the given visitor visit metadata of this class. + * + * @param v the visitor that must visit this class + */ + fun accept(v: KmClassVisitor) { + val (strings, proto) = classData + proto.accept(v, strings) + } + } + + companion object { + /** + * Reads and parses the given header of a Kotlin JVM class file and returns the correct type of [KotlinClassMetadata] encoded by + * this header, or `null` if this header encodes an unsupported kind of Kotlin classes or has an unsupported metadata version. + * + * Throws [InconsistentKotlinMetadataException] if the metadata has inconsistencies which signal that it may have been + * modified by a separate tool. + * + * @param header the header of a Kotlin JVM class file to be parsed + */ + @JvmStatic + fun read(header: KotlinClassHeader): KotlinClassMetadata? { + if (!JvmMetadataVersion( + header.metadataVersion, + (header.extraInt and (1 shl 3)/* see JvmAnnotationNames.METADATA_STRICT_VERSION_SEMANTICS_FLAG */) != 0 + ).isCompatible() + ) return null + + return try { + when (header.kind) { + KotlinClassHeader.CLASS_KIND -> Class(header) + else -> throw IllegalArgumentException("The metadata passed are not of a class") + } + } catch (e: InconsistentKotlinMetadataException) { + throw e + } catch (e: Throwable) { + throw InconsistentKotlinMetadataException("Exception occurred when reading Kotlin metadata", e) + } + } + } +} diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt new file mode 100644 index 0000000000..8c7ee9b682 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt @@ -0,0 +1,119 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.jvm.impl + +import kotlinx.metadata.* +import kotlinx.metadata.impl.* +import kotlinx.metadata.impl.extensions.* +import kotlinx.metadata.jvm.* +import org.jetbrains.kotlin.metadata.ProtoBuf +import org.jetbrains.kotlin.metadata.deserialization.getExtensionOrNull +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil + +internal class JvmMetadataExtensions : MetadataExtensions { + override fun readClassExtensions(v: KmClassVisitor, proto: ProtoBuf.Class, c: ReadContext) { + val ext = v.visitExtensions(JvmClassExtensionVisitor.TYPE) as? JvmClassExtensionVisitor ?: return + + val anonymousObjectOriginName = proto.getExtensionOrNull(JvmProtoBuf.anonymousObjectOriginName) + if (anonymousObjectOriginName != null) { + ext.visitAnonymousObjectOriginName(c[anonymousObjectOriginName]) + } + + for (property in proto.getExtension(JvmProtoBuf.classLocalVariable)) { + ext.visitLocalDelegatedProperty( + property.flags, c[property.name], property.getPropertyGetterFlags(), property.getPropertySetterFlags() + )?.let { property.accept(it, c) } + } + + ext.visitModuleName(proto.getExtensionOrNull(JvmProtoBuf.classModuleName)?.let(c::get) ?: JvmProtoBufUtil.DEFAULT_MODULE_NAME) + + ext.visitEnd() + } + + override fun readPackageExtensions(v: KmPackageVisitor, proto: ProtoBuf.Package, c: ReadContext) { + val ext = v.visitExtensions(JvmPackageExtensionVisitor.TYPE) as? JvmPackageExtensionVisitor ?: return + + for (property in proto.getExtension(JvmProtoBuf.packageLocalVariable)) { + ext.visitLocalDelegatedProperty( + property.flags, c[property.name], property.getPropertyGetterFlags(), property.getPropertySetterFlags() + )?.let { property.accept(it, c) } + } + + ext.visitModuleName(proto.getExtensionOrNull(JvmProtoBuf.packageModuleName)?.let(c::get) ?: JvmProtoBufUtil.DEFAULT_MODULE_NAME) + + ext.visitEnd() + } + + // ModuleFragment is not used by JVM backend. + override fun readModuleFragmentExtensions(v: KmModuleFragmentVisitor, proto: ProtoBuf.PackageFragment, c: ReadContext) {} + + override fun readFunctionExtensions(v: KmFunctionVisitor, proto: ProtoBuf.Function, c: ReadContext) { + val ext = v.visitExtensions(JvmFunctionExtensionVisitor.TYPE) as? JvmFunctionExtensionVisitor ?: return + ext.visit(JvmProtoBufUtil.getJvmMethodSignature(proto, c.strings, c.types)?.wrapAsPublic()) + + val lambdaClassOriginName = proto.getExtensionOrNull(JvmProtoBuf.lambdaClassOriginName) + if (lambdaClassOriginName != null) { + ext.visitLambdaClassOriginName(c[lambdaClassOriginName]) + } + + ext.visitEnd() + } + + override fun readPropertyExtensions(v: KmPropertyVisitor, proto: ProtoBuf.Property, c: ReadContext) { + val ext = v.visitExtensions(JvmPropertyExtensionVisitor.TYPE) as? JvmPropertyExtensionVisitor ?: return + val fieldSignature = JvmProtoBufUtil.getJvmFieldSignature(proto, c.strings, c.types) + val propertySignature = proto.getExtensionOrNull(JvmProtoBuf.propertySignature) + val getterSignature = + if (propertySignature != null && propertySignature.hasGetter()) propertySignature.getter else null + val setterSignature = + if (propertySignature != null && propertySignature.hasSetter()) propertySignature.setter else null + ext.visit( + proto.getExtension(JvmProtoBuf.flags), + fieldSignature?.wrapAsPublic(), + getterSignature?.run { JvmMethodSignature(c[name], c[desc]) }, + setterSignature?.run { JvmMethodSignature(c[name], c[desc]) } + ) + + val syntheticMethod = + if (propertySignature != null && propertySignature.hasSyntheticMethod()) propertySignature.syntheticMethod else null + ext.visitSyntheticMethodForAnnotations(syntheticMethod?.run { JvmMethodSignature(c[name], c[desc]) }) + + ext.visitEnd() + } + + override fun readConstructorExtensions(v: KmConstructorVisitor, proto: ProtoBuf.Constructor, c: ReadContext) { + val ext = v.visitExtensions(JvmConstructorExtensionVisitor.TYPE) as? JvmConstructorExtensionVisitor ?: return + ext.visit(JvmProtoBufUtil.getJvmConstructorSignature(proto, c.strings, c.types)?.wrapAsPublic()) + } + + override fun readTypeParameterExtensions(v: KmTypeParameterVisitor, proto: ProtoBuf.TypeParameter, c: ReadContext) { + val ext = v.visitExtensions(JvmTypeParameterExtensionVisitor.TYPE) as? JvmTypeParameterExtensionVisitor ?: return + for (annotation in proto.getExtension(JvmProtoBuf.typeParameterAnnotation)) { + ext.visitAnnotation(annotation.readAnnotation(c.strings)) + } + ext.visitEnd() + } + + override fun readTypeExtensions(v: KmTypeVisitor, proto: ProtoBuf.Type, c: ReadContext) { + val ext = v.visitExtensions(JvmTypeExtensionVisitor.TYPE) as? JvmTypeExtensionVisitor ?: return + ext.visit(proto.getExtension(JvmProtoBuf.isRaw)) + for (annotation in proto.getExtension(JvmProtoBuf.typeAnnotation)) { + ext.visitAnnotation(annotation.readAnnotation(c.strings)) + } + ext.visitEnd() + } + + override fun readTypeAliasExtensions(v: KmTypeAliasVisitor, proto: ProtoBuf.TypeAlias, c: ReadContext) {} + + override fun readValueParameterExtensions(v: KmValueParameterVisitor, proto: ProtoBuf.ValueParameter, c: ReadContext) {} + + override fun createFunctionExtension(): KmFunctionExtension = JvmFunctionExtension() + + override fun createTypeExtension(): KmTypeExtension = JvmTypeExtension() + + override fun createValueParameterExtension(): KmValueParameterExtension = JvmValueParameterExtension() +} diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt new file mode 100644 index 0000000000..5c0f99fbe1 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.jvm.impl + +import kotlinx.metadata.* +import kotlinx.metadata.impl.extensions.* +import kotlinx.metadata.jvm.* + +internal val KmFunction.jvm: JvmFunctionExtension + get() = visitExtensions(JvmFunctionExtensionVisitor.TYPE) as JvmFunctionExtension + +internal class JvmFunctionExtension : JvmFunctionExtensionVisitor(), KmFunctionExtension { + var signature: JvmMethodSignature? = null + var lambdaClassOriginName: String? = null + + override fun visit(signature: JvmMethodSignature?) { + this.signature = signature + } + + override fun visitLambdaClassOriginName(internalName: String) { + this.lambdaClassOriginName = internalName + } + + override fun accept(visitor: KmFunctionExtensionVisitor) { + require(visitor is JvmFunctionExtensionVisitor) + visitor.visit(signature) + lambdaClassOriginName?.let(visitor::visitLambdaClassOriginName) + visitor.visitEnd() + } +} + +internal class JvmTypeExtension : JvmTypeExtensionVisitor(), KmTypeExtension { + var isRaw: Boolean = false + val annotations: MutableList = mutableListOf() + + override fun visit(isRaw: Boolean) { + this.isRaw = isRaw + } + + override fun visitAnnotation(annotation: KmAnnotation) { + annotations.add(annotation) + } + + override fun accept(visitor: KmTypeExtensionVisitor) { + require(visitor is JvmTypeExtensionVisitor) + visitor.visit(isRaw) + annotations.forEach(visitor::visitAnnotation) + visitor.visitEnd() + } +} + +internal class JvmValueParameterExtension : JvmValueParameterExtensionVisitor(), KmValueParameterExtension { + override fun accept(visitor: KmValueParameterExtensionVisitor) { + require(visitor is JvmValueParameterExtensionVisitor) + visitor.visitEnd() + } +} diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt new file mode 100644 index 0000000000..7d16c7bffb --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt @@ -0,0 +1,405 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata.jvm + +import kotlinx.metadata.* +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.* + +/** + * A visitor containing the common code to visit JVM extensions for Kotlin declaration containers, such as classes and package fragments. + */ +abstract class JvmDeclarationContainerExtensionVisitor @JvmOverloads constructor( + protected open val delegate: JvmDeclarationContainerExtensionVisitor? = null +) : KmDeclarationContainerExtensionVisitor { + /** + * Visits the metadata of a local delegated property used somewhere inside this container (but not in a nested declaration container). + * Note that for classes produced by the Kotlin compiler, such properties will have default accessors. + * + * The order of visited local delegated properties is important. The Kotlin compiler generates the corresponding property's index + * at the call site, so that reflection would be able to load the metadata of the property with that index at runtime. + * If an incorrect index is used, either the `KProperty<*>` object passed to delegate methods will point to the wrong property + * at runtime, or an exception will be thrown. + * + * @param flags property flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Property] flags + * @param name the name of the property + * @param getterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag + * and [Flag.PropertyAccessor] flags + * @param setterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag + * and [Flag.PropertyAccessor] flags + */ + open fun visitLocalDelegatedProperty(flags: Flags, name: String, getterFlags: Flags, setterFlags: Flags): KmPropertyVisitor? = + delegate?.visitLocalDelegatedProperty(flags, name, getterFlags, setterFlags) + + /** + * Visits the name of the module where this container is declared. + */ + open fun visitModuleName(name: String) { + delegate?.visitModuleName(name) + } +} + +/** + * A visitor to visit JVM extensions for a class. + */ +open class JvmClassExtensionVisitor @JvmOverloads constructor( + delegate: JvmClassExtensionVisitor? = null +) : KmClassExtensionVisitor, JvmDeclarationContainerExtensionVisitor(delegate) { + override val delegate: JvmClassExtensionVisitor? + get() = super.delegate as JvmClassExtensionVisitor? + + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits the JVM internal name of the original class this anonymous object is copied from. This method is called for + * anonymous objects copied from bodies of inline functions to the use site by the Kotlin compiler. + */ + open fun visitAnonymousObjectOriginName(internalName: String) { + delegate?.visitAnonymousObjectOriginName(internalName) + } + + /** + * Visits the end of JVM extensions for the class. + */ + open fun visitEnd() { + delegate?.visitEnd() + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmClassExtensionVisitor::class) + } +} + +/** + * A visitor to visit JVM extensions for a package fragment. + */ +open class JvmPackageExtensionVisitor @JvmOverloads constructor( + delegate: JvmPackageExtensionVisitor? = null +) : KmPackageExtensionVisitor, JvmDeclarationContainerExtensionVisitor(delegate) { + override val delegate: JvmPackageExtensionVisitor? + get() = super.delegate as JvmPackageExtensionVisitor? + + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits the end of JVM extensions for the package fragment. + */ + open fun visitEnd() { + delegate?.visitEnd() + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmPackageExtensionVisitor::class) + } +} + +/** + * A visitor to visit JVM extensions for a function. + */ +open class JvmFunctionExtensionVisitor @JvmOverloads constructor( + private val delegate: JvmFunctionExtensionVisitor? = null +) : KmFunctionExtensionVisitor { + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits the JVM signature of the function, or null if the JVM signature of this function is unknown. + * + * Example: `JvmMethodSignature("equals", "(Ljava/lang/Object;)Z")` + * + * @param signature the signature of the function + */ + open fun visit(signature: JvmMethodSignature?) { + delegate?.visit(signature) + } + + /** + * Visits the JVM internal name of the original class the lambda class for this function is copied from. + * This information is present for lambdas copied from bodies of inline functions to the use site by the Kotlin compiler. + */ + open fun visitLambdaClassOriginName(internalName: String) { + delegate?.visitLambdaClassOriginName(internalName) + } + + /** + * Visits the end of JVM extensions for the function. + */ + open fun visitEnd() { + delegate?.visitEnd() + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmFunctionExtensionVisitor::class) + } +} + +/** + * A visitor to visit JVM extensions for a property. + */ +open class JvmPropertyExtensionVisitor @JvmOverloads constructor( + private val delegate: JvmPropertyExtensionVisitor? = null +) : KmPropertyExtensionVisitor { + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits JVM signatures of field and accessors generated for the property. + * + * @param jvmFlags JVM-specific flags of the property, consisting of [JvmFlag.Property] flags + * @param fieldSignature the signature of the backing field of the property, or `null` if this property has no backing field. + * Example: `JvmFieldSignature("X", "Ljava/lang/Object;")` + * @param getterSignature the signature of the property getter, or `null` if this property has no getter or its signature is unknown. + * Example: `JvmMethodSignature("getX", "()Ljava/lang/Object;")` + * @param setterSignature the signature of the property setter, or `null` if this property has no setter or its signature is unknown. + * Example: `JvmMethodSignature("setX", "(Ljava/lang/Object;)V")` + */ + open fun visit( + jvmFlags: Flags, + fieldSignature: JvmFieldSignature?, + getterSignature: JvmMethodSignature?, + setterSignature: JvmMethodSignature? + ) { + delegate?.visit(jvmFlags, fieldSignature, getterSignature, setterSignature) + + @Suppress("DEPRECATION_ERROR") + visit(fieldSignature, getterSignature, setterSignature) + } + + @Deprecated( + "Use visit(Flags, JvmFieldSignature?, JvmMethodSignature?, JvmMethodSignature?) instead.", + level = DeprecationLevel.ERROR, + replaceWith = ReplaceWith("visit(flagsOf(), fieldSignature, getterSignature, setterSignature)", "kotlinx.metadata.flagsOf") + ) + open fun visit( + fieldSignature: JvmFieldSignature?, + getterSignature: JvmMethodSignature?, + setterSignature: JvmMethodSignature? + ) { + @Suppress("DEPRECATION_ERROR") + delegate?.visit(fieldSignature, getterSignature, setterSignature) + } + + /** + * Visits the JVM signature of a synthetic method which is generated to store annotations on a property in the bytecode. + * + * Example: `JvmMethodSignature("getX$annotations", "()V")` + * + * @param signature the signature of the synthetic method + */ + open fun visitSyntheticMethodForAnnotations(signature: JvmMethodSignature?) { + delegate?.visitSyntheticMethodForAnnotations(signature) + } + + /** + * Visits the end of JVM extensions for the property. + */ + open fun visitEnd() { + delegate?.visitEnd() + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmPropertyExtensionVisitor::class) + } +} + +/** + * A visitor to visit JVM extensions for a constructor. + */ +open class JvmConstructorExtensionVisitor @JvmOverloads constructor( + private val delegate: JvmConstructorExtensionVisitor? = null +) : KmConstructorExtensionVisitor { + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits the JVM signature of the constructor, or null if the JVM signature of this constructor is unknown. + * + * Example: `JvmMethodSignature("", "(Ljava/lang/Object;)V")` + * + * @param signature the signature of the constructor + */ + open fun visit(signature: JvmMethodSignature?) { + delegate?.visit(signature) + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmConstructorExtensionVisitor::class) + } +} + +/** + * A visitor to visit JVM extensions for a type parameter. + */ +open class JvmTypeParameterExtensionVisitor @JvmOverloads constructor( + private val delegate: JvmTypeParameterExtensionVisitor? = null +) : KmTypeParameterExtensionVisitor { + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits an annotation on the type parameter. + * + * @param annotation the annotation on the type parameter + */ + open fun visitAnnotation(annotation: KmAnnotation) { + delegate?.visitAnnotation(annotation) + } + + /** + * Visits the end of JVM extensions for the type parameter. + */ + open fun visitEnd() { + delegate?.visitEnd() + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmTypeParameterExtensionVisitor::class) + } +} + +/** + * A visitor to visit JVM extensions for a type. + */ +open class JvmTypeExtensionVisitor @JvmOverloads constructor( + private val delegate: JvmTypeExtensionVisitor? = null +) : KmTypeExtensionVisitor { + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits the JVM-specific flags of a type. + * + * @param isRaw whether the type is seen as a raw type in Java + */ + open fun visit(isRaw: Boolean) { + delegate?.visit(isRaw) + } + + /** + * Visits an annotation on the type. + * + * @param annotation the annotation on the type + */ + open fun visitAnnotation(annotation: KmAnnotation) { + delegate?.visitAnnotation(annotation) + } + + /** + * Visits the end of JVM extensions for the type parameter. + */ + open fun visitEnd() { + delegate?.visitEnd() + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmTypeExtensionVisitor::class) + + /** + * The type flexibility id, signifying that the visited type is a JVM platform type. + * + * @see KmTypeVisitor.visitFlexibleTypeUpperBound + */ + const val PLATFORM_TYPE_ID = JvmProtoBufUtil.PLATFORM_TYPE_ID + } +} + +/** + * A visitor to visit JVM extensions for a type alias. + */ +open class JvmTypeAliasExtensionVisitor @JvmOverloads constructor( + private val delegate: JvmTypeAliasExtensionVisitor? = null +) : KmTypeAliasExtensionVisitor { + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits the end of JVM extensions for the type alias. + */ + open fun visitEnd() { + delegate?.visitEnd() + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmTypeAliasExtensionVisitor::class) + } +} + +/** + * A visitor to visit JVM extensions for a value parameter. + */ +open class JvmValueParameterExtensionVisitor @JvmOverloads constructor( + private val delegate: JvmValueParameterExtensionVisitor? = null +) : KmTypeAliasExtensionVisitor { + final override val type: KmExtensionType + get() = TYPE + + /** + * Visits the end of JVM extensions for the value parameter. + */ + open fun visitEnd() { + delegate?.visitEnd() + } + + companion object { + /** + * The type of this extension visitor. + * + * @see KmExtensionType + */ + @JvmField + val TYPE: KmExtensionType = KmExtensionType(JvmValueParameterExtensionVisitor::class) + } +} diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensions.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensions.kt new file mode 100644 index 0000000000..f2d4468717 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensions.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("unused") + +package kotlinx.metadata.jvm + +import kotlinx.metadata.* +import kotlinx.metadata.jvm.impl.jvm + +/** + * JVM signature of the function, or null if the JVM signature of this function is unknown. + * + * Example: `JvmMethodSignature("equals", "(Ljava/lang/Object;)Z")`. + */ +var KmFunction.signature: JvmMethodSignature? + get() = jvm.signature + set(value) { + jvm.signature = value + } diff --git a/retrofit/src/main/java/kotlinx/metadata/nodes.kt b/retrofit/src/main/java/kotlinx/metadata/nodes.kt new file mode 100644 index 0000000000..4d6f7582af --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/nodes.kt @@ -0,0 +1,1007 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("MemberVisibilityCanBePrivate") + +package kotlinx.metadata + +import kotlinx.metadata.impl.extensions.* + +/** + * Represents a Kotlin declaration container, such as a class or a package fragment. + */ +interface KmDeclarationContainer { + /** + * Functions in the container. + */ + val functions: MutableList + + /** + * Properties in the container. + */ + val properties: MutableList + + /** + * Type aliases in the container. + */ + val typeAliases: MutableList +} + +/** + * Represents a Kotlin class. + */ +class KmClass : KmClassVisitor(), KmDeclarationContainer { + /** + * Class flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Class] flags. + */ + var flags: Flags = flagsOf() + + /** + * Name of the class. + */ + lateinit var name: ClassName + + /** + * Type parameters of the class. + */ + val typeParameters: MutableList = ArrayList(0) + + /** + * Supertypes of the class. + */ + val supertypes: MutableList = ArrayList(1) + + /** + * Functions in the class. + */ + override val functions: MutableList = ArrayList() + + /** + * Properties in the class. + */ + override val properties: MutableList = ArrayList() + + /** + * Type aliases in the class. + */ + override val typeAliases: MutableList = ArrayList(0) + + /** + * Constructors of the class. + */ + val constructors: MutableList = ArrayList(1) + + /** + * Name of the companion object of this class, if it has one. + */ + var companionObject: String? = null + + /** + * Names of nested classes of this class. + */ + val nestedClasses: MutableList = ArrayList(0) + + /** + * Names of enum entries, if this class is an enum class. + */ + val enumEntries: MutableList = ArrayList(0) + + /** + * Names of direct subclasses of this class, if this class is `sealed`. + */ + val sealedSubclasses: MutableList = ArrayList(0) + + /** + * Name of the underlying property, if this class is `inline`. + */ + var inlineClassUnderlyingPropertyName: String? = null + + /** + * Type of the underlying property, if this class is `inline`. + */ + var inlineClassUnderlyingType: KmType? = null + + /** + * Version requirements on this class. + */ + val versionRequirements: MutableList = ArrayList(0) + +// private val extensions: List = +// MetadataExtensions.INSTANCES.map(MetadataExtensions::createClassExtension) + + override fun visit(flags: Flags, name: ClassName) { + this.flags = flags + this.name = name + } + + override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor = + KmTypeParameter(flags, name, id, variance).addTo(typeParameters) + + override fun visitSupertype(flags: Flags): KmTypeVisitor = + KmType(flags).addTo(supertypes) + + override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor = + KmFunction(flags, name).addTo(functions) + + override fun visitProperty(flags: Flags, name: String, getterFlags: Flags, setterFlags: Flags): KmPropertyVisitor = + KmProperty(flags, name, getterFlags, setterFlags).addTo(properties) + + override fun visitTypeAlias(flags: Flags, name: String): KmTypeAliasVisitor = + KmTypeAlias(flags, name).addTo(typeAliases) + + override fun visitConstructor(flags: Flags): KmConstructorVisitor = + KmConstructor(flags).addTo(constructors) + + override fun visitCompanionObject(name: String) { + this.companionObject = name + } + + override fun visitNestedClass(name: String) { + nestedClasses.add(name) + } + + override fun visitEnumEntry(name: String) { + enumEntries.add(name) + } + + override fun visitSealedSubclass(name: ClassName) { + sealedSubclasses.add(name) + } + + override fun visitInlineClassUnderlyingPropertyName(name: String) { + inlineClassUnderlyingPropertyName = name + } + + override fun visitInlineClassUnderlyingType(flags: Flags): KmTypeVisitor = + KmType(flags).also { inlineClassUnderlyingType = it } + + override fun visitVersionRequirement(): KmVersionRequirementVisitor = + KmVersionRequirement().addTo(versionRequirements) + + override fun visitExtensions(type: KmExtensionType): KmClassExtensionVisitor = object : KmClassExtensionVisitor { + override val type: KmExtensionType + get() = type + } +// extensions.singleOfType(type) + + /** + * Populates the given visitor with data in this class. + * + * @param visitor the visitor which will visit data in this class + */ + fun accept(visitor: KmClassVisitor) { + visitor.visit(flags, name) + typeParameters.forEach { visitor.visitTypeParameter(it.flags, it.name, it.id, it.variance)?.let(it::accept) } + supertypes.forEach { visitor.visitSupertype(it.flags)?.let(it::accept) } + functions.forEach { visitor.visitFunction(it.flags, it.name)?.let(it::accept) } + properties.forEach { visitor.visitProperty(it.flags, it.name, it.getterFlags, it.setterFlags)?.let(it::accept) } + typeAliases.forEach { visitor.visitTypeAlias(it.flags, it.name)?.let(it::accept) } + constructors.forEach { visitor.visitConstructor(it.flags)?.let(it::accept) } + companionObject?.let(visitor::visitCompanionObject) + nestedClasses.forEach(visitor::visitNestedClass) + enumEntries.forEach(visitor::visitEnumEntry) + sealedSubclasses.forEach(visitor::visitSealedSubclass) + inlineClassUnderlyingPropertyName?.let(visitor::visitInlineClassUnderlyingPropertyName) + inlineClassUnderlyingType?.let { visitor.visitInlineClassUnderlyingType(it.flags)?.let(it::accept) } + versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } +// extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a Kotlin package fragment, including single file facades and multi-file class parts. + */ +class KmPackage : KmPackageVisitor(), KmDeclarationContainer { + /** + * Functions in the package fragment. + */ + override val functions: MutableList = ArrayList() + + /** + * Properties in the package fragment. + */ + override val properties: MutableList = ArrayList() + + /** + * Type aliases in the package fragment. + */ + override val typeAliases: MutableList = ArrayList(0) + + override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor = + KmFunction(flags, name).addTo(functions) + + override fun visitProperty(flags: Flags, name: String, getterFlags: Flags, setterFlags: Flags): KmPropertyVisitor = + KmProperty(flags, name, getterFlags, setterFlags).addTo(properties) + + override fun visitTypeAlias(flags: Flags, name: String): KmTypeAliasVisitor = + KmTypeAlias(flags, name).addTo(typeAliases) + + /** + * Populates the given visitor with data in this package fragment. + * + * @param visitor the visitor which will visit data in this package fragment + */ + fun accept(visitor: KmPackageVisitor) { + functions.forEach { visitor.visitFunction(it.flags, it.name)?.let(it::accept) } + properties.forEach { visitor.visitProperty(it.flags, it.name, it.getterFlags, it.setterFlags)?.let(it::accept) } + typeAliases.forEach { visitor.visitTypeAlias(it.flags, it.name)?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a Kotlin module fragment. This is used to represent metadata of a part of a module on platforms other than JVM. + */ +class KmModuleFragment : KmModuleFragmentVisitor() { + + /** + * Top-level functions, type aliases and properties in the module fragment. + */ + var pkg: KmPackage? = null + + /** + * Classes in the module fragment. + */ + val classes: MutableList = ArrayList() + + override fun visitPackage(): KmPackageVisitor? = + KmPackage().also { pkg = it } + + override fun visitClass(): KmClassVisitor? = + KmClass().addTo(classes) + + /** + * Populates the given visitor with data in this module fragment. + * + * @param visitor the visitor which will visit data in the module fragment. + */ + fun accept(visitor: KmModuleFragmentVisitor) { + pkg?.let { visitor.visitPackage()?.let(it::accept) } + classes.forEach { visitor.visitClass()?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a synthetic class generated for a Kotlin lambda. + */ +class KmLambda : KmLambdaVisitor() { + /** + * Signature of the synthetic anonymous function, representing the lambda. + */ + lateinit var function: KmFunction + + override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor = + KmFunction(flags, name).also { function = it } + + /** + * Populates the given visitor with data in this lambda. + * + * @param visitor the visitor which will visit data in this lambda + */ + fun accept(visitor: KmLambdaVisitor) { + visitor.visitFunction(function.flags, function.name)?.let(function::accept) + visitor.visitEnd() + } +} + +/** + * Represents a constructor of a Kotlin class. + * + * @property flags constructor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag and [Flag.Constructor] flags + */ +class KmConstructor(var flags: Flags) : KmConstructorVisitor() { + /** + * Value parameters of the constructor. + */ + val valueParameters: MutableList = ArrayList() + + /** + * Version requirements on the constructor. + */ + val versionRequirements: MutableList = ArrayList(0) + + override fun visitValueParameter(flags: Flags, name: String): KmValueParameterVisitor = + KmValueParameter(flags, name).addTo(valueParameters) + + override fun visitVersionRequirement(): KmVersionRequirementVisitor = + KmVersionRequirement().addTo(versionRequirements) + + /** + * Populates the given visitor with data in this constructor. + * + * @param visitor the visitor which will visit data in this class + */ + fun accept(visitor: KmConstructorVisitor) { + valueParameters.forEach { visitor.visitValueParameter(it.flags, it.name)?.let(it::accept) } + versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a Kotlin function declaration. + * + * @property flags function flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Function] flags + * @property name the name of the function + */ +class KmFunction( + var flags: Flags, + var name: String +) : KmFunctionVisitor() { + /** + * Type parameters of the function. + */ + val typeParameters: MutableList = ArrayList(0) + + /** + * Type of the receiver of the function, if this is an extension function. + */ + var receiverParameterType: KmType? = null + + /** + * Value parameters of the function. + */ + val valueParameters: MutableList = ArrayList() + + /** + * Return type of the function. + */ + lateinit var returnType: KmType + + /** + * Version requirements on the function. + */ + val versionRequirements: MutableList = ArrayList(0) + + /** + * Contract of the function. + */ + var contract: KmContract? = null + + private val extensions: List = + MetadataExtensions.INSTANCES.map(MetadataExtensions::createFunctionExtension) + + override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor = + KmTypeParameter(flags, name, id, variance).addTo(typeParameters) + + override fun visitReceiverParameterType(flags: Flags): KmTypeVisitor = + KmType(flags).also { receiverParameterType = it } + + override fun visitValueParameter(flags: Flags, name: String): KmValueParameterVisitor = + KmValueParameter(flags, name).addTo(valueParameters) + + override fun visitReturnType(flags: Flags): KmTypeVisitor = + KmType(flags).also { returnType = it } + + override fun visitVersionRequirement(): KmVersionRequirementVisitor = + KmVersionRequirement().addTo(versionRequirements) + + override fun visitContract(): KmContractVisitor = + KmContract().also { contract = it } + + override fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor = + extensions.singleOfType(type) + + /** + * Populates the given visitor with data in this function. + * + * @param visitor the visitor which will visit data in this function + */ + fun accept(visitor: KmFunctionVisitor) { + typeParameters.forEach { visitor.visitTypeParameter(it.flags, it.name, it.id, it.variance)?.let(it::accept) } + receiverParameterType?.let { visitor.visitReceiverParameterType(it.flags)?.let(it::accept) } + valueParameters.forEach { visitor.visitValueParameter(it.flags, it.name)?.let(it::accept) } + visitor.visitReturnType(returnType.flags)?.let(returnType::accept) + versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } + contract?.let { visitor.visitContract()?.let(it::accept) } + extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a Kotlin property declaration. + * + * @property flags property flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Property] flags + * @property name the name of the property + * @property getterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag + * and [Flag.PropertyAccessor] flags + * @property setterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag + * and [Flag.PropertyAccessor] flags + */ +class KmProperty( + var flags: Flags, + var name: String, + var getterFlags: Flags, + var setterFlags: Flags +) : KmPropertyVisitor() { + /** + * Type parameters of the property. + */ + val typeParameters: MutableList = ArrayList(0) + + /** + * Type of the receiver of the property, if this is an extension property. + */ + var receiverParameterType: KmType? = null + + /** + * Value parameter of the setter of this property, if this is a `var` property. + */ + var setterParameter: KmValueParameter? = null + + /** + * Type of the property. + */ + lateinit var returnType: KmType + + /** + * Version requirements on the property. + */ + val versionRequirements: MutableList = ArrayList(0) + + override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor = + KmTypeParameter(flags, name, id, variance).addTo(typeParameters) + + override fun visitReceiverParameterType(flags: Flags): KmTypeVisitor = + KmType(flags).also { receiverParameterType = it } + + override fun visitSetterParameter(flags: Flags, name: String): KmValueParameterVisitor = + KmValueParameter(flags, name).also { setterParameter = it } + + override fun visitReturnType(flags: Flags): KmTypeVisitor = + KmType(flags).also { returnType = it } + + override fun visitVersionRequirement(): KmVersionRequirementVisitor = + KmVersionRequirement().addTo(versionRequirements) + + /** + * Populates the given visitor with data in this property. + * + * @param visitor the visitor which will visit data in this property + */ + fun accept(visitor: KmPropertyVisitor) { + typeParameters.forEach { visitor.visitTypeParameter(it.flags, it.name, it.id, it.variance)?.let(it::accept) } + receiverParameterType?.let { visitor.visitReceiverParameterType(it.flags)?.let(it::accept) } + setterParameter?.let { visitor.visitSetterParameter(it.flags, it.name)?.let(it::accept) } + visitor.visitReturnType(returnType.flags)?.let(returnType::accept) + versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a Kotlin type alias declaration. + * + * @property flags type alias flags, consisting of [Flag.HAS_ANNOTATIONS] and visibility flag + * @property name the name of the type alias + */ +class KmTypeAlias( + var flags: Flags, + var name: String +) : KmTypeAliasVisitor() { + /** + * Type parameters of the type alias. + */ + val typeParameters: MutableList = ArrayList(0) + + /** + * Underlying type of the type alias, i.e. the type in the right-hand side of the type alias declaration. + */ + lateinit var underlyingType: KmType + + /** + * Expanded type of the type alias, i.e. the full expansion of the underlying type, where all type aliases are substituted + * with their expanded types. If no type aliases are used in the underlying type, expanded type is equal to the underlying type. + */ + lateinit var expandedType: KmType + + /** + * Annotations on the type alias. + */ + val annotations: MutableList = ArrayList(0) + + /** + * Version requirements on the type alias. + */ + val versionRequirements: MutableList = ArrayList(0) + + override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor = + KmTypeParameter(flags, name, id, variance).addTo(typeParameters) + + override fun visitUnderlyingType(flags: Flags): KmTypeVisitor = + KmType(flags).also { underlyingType = it } + + override fun visitExpandedType(flags: Flags): KmTypeVisitor = + KmType(flags).also { expandedType = it } + + override fun visitAnnotation(annotation: KmAnnotation) { + annotations.add(annotation) + } + + override fun visitVersionRequirement(): KmVersionRequirementVisitor = + KmVersionRequirement().addTo(versionRequirements) + + /** + * Populates the given visitor with data in this type alias. + * + * @param visitor the visitor which will visit data in this type alias + */ + fun accept(visitor: KmTypeAliasVisitor) { + typeParameters.forEach { visitor.visitTypeParameter(it.flags, it.name, it.id, it.variance)?.let(it::accept) } + visitor.visitUnderlyingType(underlyingType.flags)?.let(underlyingType::accept) + visitor.visitExpandedType(expandedType.flags)?.let(expandedType::accept) + annotations.forEach(visitor::visitAnnotation) + versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a value parameter of a Kotlin constructor, function or property setter. + * + * @property flags value parameter flags, consisting of [Flag.ValueParameter] flags + * @property name the name of the value parameter + */ +class KmValueParameter( + var flags: Flags, + var name: String +) : KmValueParameterVisitor() { + /** + * Type of the value parameter, if this is **not** a `vararg` parameter. + */ + var type: KmType? = null + + /** + * Type of the value parameter, if this is a `vararg` parameter. + */ + var varargElementType: KmType? = null + + private val extensions: List = + MetadataExtensions.INSTANCES.map(MetadataExtensions::createValueParameterExtension) + + override fun visitType(flags: Flags): KmTypeVisitor = + KmType(flags).also { type = it } + + override fun visitVarargElementType(flags: Flags): KmTypeVisitor = + KmType(flags).also { varargElementType = it } + + override fun visitExtensions(type: KmExtensionType): KmValueParameterExtensionVisitor? = + extensions.singleOfType(type) + + /** + * Populates the given visitor with data in this value parameter. + * + * @param visitor the visitor which will visit data in this value parameter + */ + fun accept(visitor: KmValueParameterVisitor) { + type?.let { visitor.visitType(it.flags)?.let(it::accept) } + varargElementType?.let { visitor.visitVarargElementType(it.flags)?.let(it::accept) } + extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a type parameter of a Kotlin class, function, property or type alias. + * + * @property flags type parameter flags, consisting of [Flag.TypeParameter] flags + * @property name the name of the type parameter + * @property id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where + * the name isn't enough (e.g. `class A { fun foo(t: T) }`) + * @property variance the declaration-site variance of the type parameter + */ +class KmTypeParameter( + var flags: Flags, + var name: String, + var id: Int, + var variance: KmVariance +) : KmTypeParameterVisitor() { + /** + * Upper bounds of the type parameter. + */ + val upperBounds: MutableList = ArrayList(1) + + override fun visitUpperBound(flags: Flags): KmTypeVisitor = + KmType(flags).addTo(upperBounds) + + /** + * Populates the given visitor with data in this type parameter. + * + * @param visitor the visitor which will visit data in this type parameter + */ + fun accept(visitor: KmTypeParameterVisitor) { + upperBounds.forEach { visitor.visitUpperBound(it.flags)?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a type. + * + * @property flags type flags, consisting of [Flag.Type] flags + */ +class KmType(var flags: Flags) : KmTypeVisitor() { + /** + * Classifier of the type. + */ + lateinit var classifier: KmClassifier + + /** + * Arguments of the type, if the type's classifier is a class or a type alias. + */ + val arguments: MutableList = ArrayList(0) + + /** + * Abbreviation of this type. Note that all types are expanded for metadata produced by the Kotlin compiler. For example: + * + * typealias A = MutableList + * + * fun foo(a: A) {} + * + * The type of the `foo`'s parameter in the metadata is actually `MutableList`, and its abbreviation is `A`. + */ + var abbreviatedType: KmType? = null + + /** + * Outer type of this type, if this type's classifier is an inner class. For example: + * + * class A { inner class B } + * + * fun foo(a: A<*>.B) {} + * + * The type of the `foo`'s parameter in the metadata is `B` (a type whose classifier is class `B`, and it has one type argument, + * type `Byte?`), and its outer type is `A<*>` (a type whose classifier is class `A`, and it has one type argument, star projection). + */ + var outerType: KmType? = null + + /** + * Upper bound of this type, if this type is flexible. In that case, all other data refers to the lower bound of the type. + * + * Flexible types in Kotlin include platform types in Kotlin/JVM and `dynamic` type in Kotlin/JS. + */ + var flexibleTypeUpperBound: KmFlexibleTypeUpperBound? = null + + private val extensions: List = + MetadataExtensions.INSTANCES.map(MetadataExtensions::createTypeExtension) + + override fun visitClass(name: ClassName) { + classifier = KmClassifier.Class(name) + } + + override fun visitTypeAlias(name: ClassName) { + classifier = KmClassifier.TypeAlias(name) + } + + override fun visitTypeParameter(id: Int) { + classifier = KmClassifier.TypeParameter(id) + } + + override fun visitArgument(flags: Flags, variance: KmVariance): KmTypeVisitor = + KmType(flags).also { arguments.add(KmTypeProjection(variance, it)) } + + override fun visitStarProjection() { + arguments.add(KmTypeProjection.STAR) + } + + override fun visitAbbreviatedType(flags: Flags): KmTypeVisitor = + KmType(flags).also { abbreviatedType = it } + + override fun visitOuterType(flags: Flags): KmTypeVisitor = + KmType(flags).also { outerType = it } + + override fun visitFlexibleTypeUpperBound(flags: Flags, typeFlexibilityId: String?): KmTypeVisitor = + KmType(flags).also { flexibleTypeUpperBound = KmFlexibleTypeUpperBound(it, typeFlexibilityId) } + + override fun visitExtensions(type: KmExtensionType): KmTypeExtension = + extensions.singleOfType(type) + + /** + * Populates the given visitor with data in this type. + * + * @param visitor the visitor which will visit data in this type + */ + fun accept(visitor: KmTypeVisitor) { + when (val classifier = classifier) { + is KmClassifier.Class -> visitor.visitClass(classifier.name) + is KmClassifier.TypeParameter -> visitor.visitTypeParameter(classifier.id) + is KmClassifier.TypeAlias -> visitor.visitTypeAlias(classifier.name) + } + arguments.forEach { argument -> + if (argument == KmTypeProjection.STAR) visitor.visitStarProjection() + else { + val (variance, type) = argument + if (variance == null || type == null) + throw InconsistentKotlinMetadataException("Variance and type must be set for non-star type projection") + visitor.visitArgument(type.flags, variance)?.let(type::accept) + } + } + abbreviatedType?.let { visitor.visitAbbreviatedType(it.flags)?.let(it::accept) } + outerType?.let { visitor.visitOuterType(it.flags)?.let(it::accept) } + flexibleTypeUpperBound?.let { visitor.visitFlexibleTypeUpperBound(it.type.flags, it.typeFlexibilityId)?.let(it.type::accept) } + extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a version requirement on a Kotlin declaration. + * + * Version requirement is an internal feature of the Kotlin compiler and the standard Kotlin library, + * enabled for example with the internal [kotlin.internal.RequireKotlin] annotation. + */ +class KmVersionRequirement : KmVersionRequirementVisitor() { + /** + * Kind of the version that this declaration requires. + */ + lateinit var kind: KmVersionRequirementVersionKind + + /** + * Level of the diagnostic that must be reported on the usages of the declaration in case the version requirement is not satisfied. + */ + lateinit var level: KmVersionRequirementLevel + + /** + * Optional error code to be displayed in the diagnostic. + */ + var errorCode: Int? = null + + /** + * Optional message to be displayed in the diagnostic. + */ + var message: String? = null + + /** + * Version required by this requirement. + */ + lateinit var version: KmVersion + + override fun visit(kind: KmVersionRequirementVersionKind, level: KmVersionRequirementLevel, errorCode: Int?, message: String?) { + this.kind = kind + this.level = level + this.errorCode = errorCode + this.message = message + } + + override fun visitVersion(major: Int, minor: Int, patch: Int) { + this.version = KmVersion(major, minor, patch) + } + + /** + * Populates the given visitor with data in this version requirement. + * + * @param visitor the visitor which will visit data in this version requirement + */ + fun accept(visitor: KmVersionRequirementVisitor) { + visitor.visit(kind, level, errorCode, message) + visitor.visitVersion(version.major, version.minor, version.patch) + visitor.visitEnd() + } +} + +/** + * Represents a contract of a Kotlin function. + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + */ +class KmContract : KmContractVisitor() { + /** + * Effects of this contract. + */ + val effects: MutableList = ArrayList(1) + + override fun visitEffect(type: KmEffectType, invocationKind: KmEffectInvocationKind?): KmEffectVisitor = + KmEffect(type, invocationKind).addTo(effects) + + /** + * Populates the given visitor with data in this contract. + * + * @param visitor the visitor which will visit data in this contract + */ + fun accept(visitor: KmContractVisitor) { + effects.forEach { visitor.visitEffect(it.type, it.invocationKind)?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents an effect (a part of the contract of a Kotlin function). + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + * + * @property type type of the effect + * @property invocationKind optional number of invocations of the lambda parameter of this function, + * specified further in the effect expression + */ +class KmEffect( + var type: KmEffectType, + var invocationKind: KmEffectInvocationKind? +) : KmEffectVisitor() { + /** + * Arguments of the effect constructor, i.e. the constant value for the [KmEffectType.RETURNS_CONSTANT] effect, + * or the parameter reference for the [KmEffectType.CALLS] effect. + */ + val constructorArguments: MutableList = ArrayList(1) + + /** + * Conclusion of the effect. If this value is set, the effect represents an implication with this value as the right-hand side. + */ + var conclusion: KmEffectExpression? = null + + override fun visitConstructorArgument(): KmEffectExpressionVisitor = + KmEffectExpression().addTo(constructorArguments) + + override fun visitConclusionOfConditionalEffect(): KmEffectExpressionVisitor = + KmEffectExpression().also { conclusion = it } + + /** + * Populates the given visitor with data in this effect. + * + * @param visitor the visitor which will visit data in this effect + */ + fun accept(visitor: KmEffectVisitor) { + constructorArguments.forEach { visitor.visitConstructorArgument()?.let(it::accept) } + conclusion?.let { visitor.visitConclusionOfConditionalEffect()?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents an effect expression, the contents of an effect (a part of the contract of a Kotlin function). + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + */ +class KmEffectExpression : KmEffectExpressionVisitor() { + /** + * Effect expression flags, consisting of [Flag.EffectExpression] flags. + */ + var flags: Flags = flagsOf() + + /** + * Optional 1-based index of the value parameter of the function, for effects which assert something about + * the function parameters. The index 0 means the extension receiver parameter. + */ + var parameterIndex: Int? = null + + /** + * Constant value used in the effect expression. + */ + var constantValue: KmConstantValue? = null + + /** + * Type used as the target of an `is`-expression in the effect expression. + */ + var isInstanceType: KmType? = null + + /** + * Arguments of an `&&`-expression. If this list is non-empty, the resulting effect expression is a conjunction of this expression + * and elements of the list. + */ + val andArguments: MutableList = ArrayList(0) + + /** + * Arguments of an `||`-expression. If this list is non-empty, the resulting effect expression is a disjunction of this expression + * and elements of the list. + */ + val orArguments: MutableList = ArrayList(0) + + override fun visit(flags: Flags, parameterIndex: Int?) { + this.flags = flags + this.parameterIndex = parameterIndex + } + + override fun visitConstantValue(value: Any?) { + constantValue = KmConstantValue(value) + } + + override fun visitIsInstanceType(flags: Flags): KmTypeVisitor = + KmType(flags).also { isInstanceType = it } + + override fun visitAndArgument(): KmEffectExpressionVisitor = + KmEffectExpression().addTo(andArguments) + + override fun visitOrArgument(): KmEffectExpressionVisitor = + KmEffectExpression().addTo(orArguments) + + /** + * Populates the given visitor with data in this effect expression. + * + * @param visitor the visitor which will visit data in this effect expression + */ + fun accept(visitor: KmEffectExpressionVisitor) { + visitor.visit(flags, parameterIndex) + constantValue?.let { visitor.visitConstantValue(it.value) } + isInstanceType?.let { visitor.visitIsInstanceType(it.flags)?.let(it::accept) } + andArguments.forEach { visitor.visitAndArgument()?.let(it::accept) } + orArguments.forEach { visitor.visitOrArgument()?.let(it::accept) } + visitor.visitEnd() + } +} + +/** + * Represents a classifier of a Kotlin type. A classifier is a class, type parameter or type alias. + * For example, in `MutableMap`, `MutableMap` is the classifier. + */ +sealed class KmClassifier { + /** + * Represents a class used as a classifier in a type. + * + * @property name the name of the class + */ + data class Class(val name: ClassName) : KmClassifier() + + /** + * Represents a type parameter used as a classifier in a type. + * + * @property id id of the type parameter + */ + data class TypeParameter(val id: Int) : KmClassifier() + + /** + * Represents a type alias used as a classifier in a type. Note that all types are expanded for metadata produced + * by the Kotlin compiler, so the type with a type alias classifier may only appear in [KmType.abbreviatedType]. + * + * @property name the name of the type alias + */ + data class TypeAlias(val name: ClassName) : KmClassifier() +} + +/** + * Represents type projection used in a type argument of the type based on a class or on a type alias. + * For example, in `MutableMap`, `in String?` is the type projection which is the first type argument of the type. + * + * @property variance the variance of the type projection, or `null` if this is a star projection + * @property type the projected type, or `null` if this is a star projection + */ +data class KmTypeProjection(var variance: KmVariance?, var type: KmType?) { + companion object { + /** + * Star projection (`*`). + * For example, in `MutableMap`, `*` is the star projection which is the second type argument of the type. + */ + @JvmField + val STAR = KmTypeProjection(null, null) + } +} + +/** + * Represents an upper bound of a flexible Kotlin type. + * + * @property type upper bound of the flexible type + * @property typeFlexibilityId id of the kind of flexibility this type has. For example, "kotlin.jvm.PlatformType" for JVM platform types, + * or "kotlin.DynamicType" for JS dynamic type + */ +data class KmFlexibleTypeUpperBound(var type: KmType, var typeFlexibilityId: String?) + +/** + * Represents a version used in a version requirement. + * + * @property major the major component of the version (e.g. "1" in "1.2.3") + * @property minor the minor component of the version (e.g. "2" in "1.2.3") + * @property patch the patch component of the version (e.g. "3" in "1.2.3") + */ +data class KmVersion(val major: Int, val minor: Int, val patch: Int) { + override fun toString(): String = "$major.$minor.$patch" +} + +/** + * Represents a constant value used in an effect expression. + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + * + * @property value the constant value. May be `true`, `false` or `null` + */ +data class KmConstantValue(val value: Any?) + +internal fun T.addTo(collection: MutableCollection): T { + collection.add(this) + return this +} diff --git a/retrofit/src/main/java/kotlinx/metadata/visitors.kt b/retrofit/src/main/java/kotlinx/metadata/visitors.kt new file mode 100644 index 0000000000..2863b893a6 --- /dev/null +++ b/retrofit/src/main/java/kotlinx/metadata/visitors.kt @@ -0,0 +1,903 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlinx.metadata + +/** + * A visitor containing the common code to visit Kotlin declaration containers, such as classes and package fragments. + */ +abstract class KmDeclarationContainerVisitor @JvmOverloads constructor(protected open val delegate: KmDeclarationContainerVisitor? = null) { + /** + * Visits a function in the container. + * + * @param flags function flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Function] flags + * @param name the name of the function + */ + open fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? = + delegate?.visitFunction(flags, name) + + /** + * Visits a property in the container. + * + * @param flags property flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Property] flags + * @param name the name of the property + * @param getterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag + * and [Flag.PropertyAccessor] flags + * @param setterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag + * and [Flag.PropertyAccessor] flags + */ + open fun visitProperty(flags: Flags, name: String, getterFlags: Flags, setterFlags: Flags): KmPropertyVisitor? = + delegate?.visitProperty(flags, name, getterFlags, setterFlags) + + /** + * Visits a type alias in the container. + * + * @param flags type alias flags, consisting of [Flag.HAS_ANNOTATIONS] and visibility flag + * @param name the name of the type alias + */ + open fun visitTypeAlias(flags: Flags, name: String): KmTypeAliasVisitor? = + delegate?.visitTypeAlias(flags, name) + + /** + * Visits the extensions of the given type on the container. + * + * @param type the type of extension visitor to be returned + */ + abstract fun visitExtensions(type: KmExtensionType): KmDeclarationContainerExtensionVisitor? +} + +/** + * A visitor to visit Kotlin classes, including interfaces, objects, enum classes and annotation classes. + * + * When using this class, [visit] must be called first, followed by zero or more [visitTypeParameter] calls, followed by zero or more calls + * to other visit* methods, followed by [visitEnd]. + */ +abstract class KmClassVisitor @JvmOverloads constructor(delegate: KmClassVisitor? = null) : KmDeclarationContainerVisitor(delegate) { + override val delegate: KmClassVisitor? + get() = super.delegate as KmClassVisitor? + + /** + * Visits the basic information about the class. + * + * @param flags class flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Class] flags + * @param name the name of the class + */ + open fun visit(flags: Flags, name: ClassName) { + delegate?.visit(flags, name) + } + + /** + * Visits a type parameter of the class. + * + * @param flags type parameter flags, consisting of [Flag.TypeParameter] flags + * @param name the name of the type parameter + * @param id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where + * the name isn't enough (e.g. `class A { fun foo(t: T) }`) + * @param variance the declaration-site variance of the type parameter + */ + open fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = + delegate?.visitTypeParameter(flags, name, id, variance) + + /** + * Visits a supertype of the class. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitSupertype(flags: Flags): KmTypeVisitor? = + delegate?.visitSupertype(flags) + + /** + * Visits a constructor of the class. + * + * @param flags constructor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag and [Flag.Constructor] flags + */ + open fun visitConstructor(flags: Flags): KmConstructorVisitor? = + delegate?.visitConstructor(flags) + + /** + * Visits the name of the companion object of this class, if it has one. + * + * @param name the name of the companion object + */ + open fun visitCompanionObject(name: String) { + delegate?.visitCompanionObject(name) + } + + /** + * Visits the name of a nested class of this class. + * + * @param name the name of a nested class + */ + open fun visitNestedClass(name: String) { + delegate?.visitNestedClass(name) + } + + /** + * Visits the name of an enum entry, if this class is an enum class. + * + * @param name the name of an enum entry + */ + open fun visitEnumEntry(name: String) { + delegate?.visitEnumEntry(name) + } + + /** + * Visits the name of a direct subclass of this class, if this class is `sealed`. + * + * @param name the name of a direct subclass + */ + open fun visitSealedSubclass(name: ClassName) { + delegate?.visitSealedSubclass(name) + } + + /** + * Visits the name of the underlying property, if this class is `inline`. + * + * @param name the name of the underlying property. + */ + open fun visitInlineClassUnderlyingPropertyName(name: String) { + delegate?.visitInlineClassUnderlyingPropertyName(name) + } + + /** + * Visits the type of the underlying property, if this class is `inline`. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitInlineClassUnderlyingType(flags: Flags): KmTypeVisitor? = + delegate?.visitInlineClassUnderlyingType(flags) + + /** + * Visits the version requirement on this class. + */ + open fun visitVersionRequirement(): KmVersionRequirementVisitor? = + delegate?.visitVersionRequirement() + + /** + * Visits the extensions of the given type on the class. + * + * @param type the type of extension visitor to be returned + */ + override fun visitExtensions(type: KmExtensionType): KmClassExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the class. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit Kotlin package fragments, including single file facades and multi-file class parts. + * + * When using this class, [visitEnd] must be called exactly once and after calls to all other visit* methods. + */ +abstract class KmPackageVisitor @JvmOverloads constructor(delegate: KmPackageVisitor? = null) : KmDeclarationContainerVisitor(delegate) { + override val delegate: KmPackageVisitor? + get() = super.delegate as KmPackageVisitor? + + /** + * Visits the extensions of the given type on the package fragment. + * + * @param type the type of extension visitor to be returned + */ + override fun visitExtensions(type: KmExtensionType): KmPackageExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the package fragment. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit module fragments. The module fragment can have no more than one package, and any number of classes, + * and must have at least one declaration. + * + * When using this class, [visitEnd] must be called exactly once and after calls to all other visit* methods. + */ +abstract class KmModuleFragmentVisitor @JvmOverloads constructor(private val delegate: KmModuleFragmentVisitor? = null) { + + /** + * Visits a package within the module fragment. + */ + open fun visitPackage(): KmPackageVisitor? = + delegate?.visitPackage() + + /** + * Visits a class within the module fragment. + */ + open fun visitClass(): KmClassVisitor? = + delegate?.visitClass() + + /** + * Visits the extensions of the given type on the module fragment. + * + * @param type the type of extension visitor to be returned. + */ + open fun visitExtensions(type: KmExtensionType): KmModuleFragmentExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the module fragment. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit the metadata of a synthetic class generated for a Kotlin lambda. + * + * When using this class, [visitFunction] must be called first, followed by [visitEnd]. + */ +abstract class KmLambdaVisitor @JvmOverloads constructor(private val delegate: KmLambdaVisitor? = null) { + /** + * Visits the signature of a synthetic anonymous function, representing the lambda. + * + * @param flags function flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Function] flags + * @param name the name of the function (usually `""` or `""` for lambdas emitted by the Kotlin compiler) + */ + open fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? = + delegate?.visitFunction(flags, name) + + /** + * Visits the end of the lambda. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit a constructor of a Kotlin class. + * + * When using this class, [visitEnd] must be called exactly once and after calls to all other visit* methods. + */ +abstract class KmConstructorVisitor @JvmOverloads constructor(private val delegate: KmConstructorVisitor? = null) { + /** + * Visits a value parameter of the constructor. + * + * @param flags value parameter flags, consisting of [Flag.ValueParameter] flags + * @param name the name of the value parameter + */ + open fun visitValueParameter(flags: Flags, name: String): KmValueParameterVisitor? = + delegate?.visitValueParameter(flags, name) + + /** + * Visits the version requirement on this constructor. + */ + open fun visitVersionRequirement(): KmVersionRequirementVisitor? = + delegate?.visitVersionRequirement() + + /** + * Visits the extensions of the given type on the constructor. + * + * @param type the type of extension visitor to be returned + */ + open fun visitExtensions(type: KmExtensionType): KmConstructorExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the constructor. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit a Kotlin function declaration. + * + * When using this class, zero or more calls to [visitTypeParameter] must be done first, followed by zero or more calls + * to other visit* methods, followed by [visitEnd]. + */ +abstract class KmFunctionVisitor @JvmOverloads constructor(private val delegate: KmFunctionVisitor? = null) { + /** + * Visits a type parameter of the function. + * + * @param flags type parameter flags, consisting of [Flag.TypeParameter] flags + * @param name the name of the type parameter + * @param id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where + * the name isn't enough (e.g. `class A { fun foo(t: T) }`) + * @param variance the declaration-site variance of the type parameter + */ + open fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = + delegate?.visitTypeParameter(flags, name, id, variance) + + /** + * Visits the type of the receiver of the function, if this is an extension function. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitReceiverParameterType(flags: Flags): KmTypeVisitor? = + delegate?.visitReceiverParameterType(flags) + + /** + * Visits a value parameter of the function. + * + * @param flags value parameter flags, consisting of [Flag.ValueParameter] flags + * @param name the name of the value parameter + */ + open fun visitValueParameter(flags: Flags, name: String): KmValueParameterVisitor? = + delegate?.visitValueParameter(flags, name) + + /** + * Visits the return type of the function. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitReturnType(flags: Flags): KmTypeVisitor? = + delegate?.visitReturnType(flags) + + /** + * Visits the version requirement on this function. + */ + open fun visitVersionRequirement(): KmVersionRequirementVisitor? = + delegate?.visitVersionRequirement() + + /** + * Visits the contract of the function. + */ + open fun visitContract(): KmContractVisitor? = + delegate?.visitContract() + + /** + * Visits the extensions of the given type on the function. + * + * @param type the type of extension visitor to be returned + */ + open fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the function. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit a Kotlin property declaration. + * + * When using this class, zero or more calls to [visitTypeParameter] must be done first, followed by zero or more calls + * to other visit* methods, followed by [visitEnd]. + */ +abstract class KmPropertyVisitor @JvmOverloads constructor(private val delegate: KmPropertyVisitor? = null) { + /** + * Visits a type parameter of the property. + * + * @param flags type parameter flags, consisting of [Flag.TypeParameter] flags + * @param name the name of the type parameter + * @param id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where + * the name isn't enough (e.g. `class A { fun foo(t: T) }`) + * @param variance the declaration-site variance of the type parameter + */ + open fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = + delegate?.visitTypeParameter(flags, name, id, variance) + + /** + * Visits the type of the receiver of the property, if this is an extension property. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitReceiverParameterType(flags: Flags): KmTypeVisitor? = + delegate?.visitReceiverParameterType(flags) + + /** + * Visits a value parameter of the setter of this property, if this is a `var` property. + * + * @param flags value parameter flags, consisting of [Flag.ValueParameter] flags + * @param name the name of the value parameter (`""` for properties emitted by the Kotlin compiler) + */ + open fun visitSetterParameter(flags: Flags, name: String): KmValueParameterVisitor? = + delegate?.visitSetterParameter(flags, name) + + /** + * Visits the type of the property. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitReturnType(flags: Flags): KmTypeVisitor? = + delegate?.visitReturnType(flags) + + /** + * Visits the version requirement on this property. + */ + open fun visitVersionRequirement(): KmVersionRequirementVisitor? = + delegate?.visitVersionRequirement() + + /** + * Visits the extensions of the given type on the property. + * + * @param type the type of extension visitor to be returned + */ + open fun visitExtensions(type: KmExtensionType): KmPropertyExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the property. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit a Kotlin type alias declaration. + * + * When using this class, zero or more calls to [visitTypeParameter] must be done first, followed by zero or more calls + * to other visit* methods, followed by [visitEnd]. + */ +abstract class KmTypeAliasVisitor @JvmOverloads constructor(private val delegate: KmTypeAliasVisitor? = null) { + /** + * Visits a type parameter of the type alias. + * + * @param flags type parameter flags, consisting of [Flag.TypeParameter] flags + * @param name the name of the type parameter + * @param id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where + * the name isn't enough (e.g. `class A { fun foo(t: T) }`) + * @param variance the declaration-site variance of the type parameter + */ + open fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = + delegate?.visitTypeParameter(flags, name, id, variance) + + /** + * Visits the underlying type of the type alias, i.e. the type in the right-hand side of the type alias declaration. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitUnderlyingType(flags: Flags): KmTypeVisitor? = + delegate?.visitUnderlyingType(flags) + + /** + * Visits the expanded type of the type alias, i.e. the full expansion of the underlying type, where all type aliases are substituted + * with their expanded types. If no type aliases are used in the underlying type, expanded type is equal to the underlying type. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitExpandedType(flags: Flags): KmTypeVisitor? = + delegate?.visitExpandedType(flags) + + /** + * Visits the annotation on the type alias. + * + * @param annotation annotation on the type alias + */ + open fun visitAnnotation(annotation: KmAnnotation) { + delegate?.visitAnnotation(annotation) + } + + /** + * Visits the version requirement on this type alias. + */ + open fun visitVersionRequirement(): KmVersionRequirementVisitor? = + delegate?.visitVersionRequirement() + + /** + * Visits the extensions of the given type on the type alias. + * + * @param type the type of extension visitor to be returned + */ + open fun visitExtensions(type: KmExtensionType): KmTypeAliasExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the type alias. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit a value parameter of a Kotlin constructor, function or property setter. + * + * When using this class, either [visitType] or [visitVarargElementType] must be called first (depending on whether the value parameter + * is `vararg` or not), followed by [visitEnd]. + */ +abstract class KmValueParameterVisitor @JvmOverloads constructor(private val delegate: KmValueParameterVisitor? = null) { + /** + * Visits the type of the value parameter, if this is **not** a `vararg` parameter. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitType(flags: Flags): KmTypeVisitor? = + delegate?.visitType(flags) + + /** + * Visits the type of the value parameter, if this is a `vararg` parameter. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitVarargElementType(flags: Flags): KmTypeVisitor? = + delegate?.visitVarargElementType(flags) + + /** + * Visits the extensions of the given type on the value parameter. + * + * @param type the type of extension visitor to be returned + */ + open fun visitExtensions(type: KmExtensionType): KmValueParameterExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the value parameter. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit a type parameter of a Kotlin class, function, property or type alias. + * + * When using this class, zero or more [visitUpperBound] calls must be done first, followed by [visitEnd]. + */ +abstract class KmTypeParameterVisitor @JvmOverloads constructor(private val delegate: KmTypeParameterVisitor? = null) { + /** + * Visits the upper bound of the type parameter. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitUpperBound(flags: Flags): KmTypeVisitor? = + delegate?.visitUpperBound(flags) + + /** + * Visits the extensions of the given type on the type parameter. + * + * @param type the type of extension visitor to be returned + */ + open fun visitExtensions(type: KmExtensionType): KmTypeParameterExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the type parameter. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit a type. The type must have a classifier which is one of: a class [visitClass], type parameter [visitTypeParameter] + * or type alias [visitTypeAlias]. If the type's classifier is a class or a type alias, it can have type arguments ([visitArgument] and + * [visitStarProjection]). If the type's classifier is an inner class, it can have the outer type ([visitOuterType]), which captures + * the generic type arguments of the outer class. Also, each type can have an abbreviation ([visitAbbreviatedType]) in case a type alias + * was used originally at this site in the declaration (all types are expanded by default for metadata produced by the Kotlin compiler). + * If [visitFlexibleTypeUpperBound] is called, this type is regarded as a flexible type, and its contents represent the lower bound, + * and the result of the call represents the upper bound. + * + * When using this class, [visitEnd] must be called exactly once and after calls to all other visit* methods. + */ +abstract class KmTypeVisitor @JvmOverloads constructor(private val delegate: KmTypeVisitor? = null) { + /** + * Visits the name of the class, if this type's classifier is a class. + * + * @param name the name of the class + */ + open fun visitClass(name: ClassName) { + delegate?.visitClass(name) + } + + /** + * Visits the name of the type alias, if this type's classifier is a type alias. Note that all types are expanded for metadata produced + * by the Kotlin compiler, so the type with a type alias classifier may only appear in a call to [visitAbbreviatedType]. + * + * @param name the name of the type alias + */ + open fun visitTypeAlias(name: ClassName) { + delegate?.visitTypeAlias(name) + } + + /** + * Visits the id of the type parameter, if this type's classifier is a type parameter. + * + * @param id id of the type parameter + */ + open fun visitTypeParameter(id: Int) { + delegate?.visitTypeParameter(id) + } + + /** + * Visits the type projection used in a type argument of the type based on a class or on a type alias. + * For example, in `MutableMap`, `in String?` is the type projection which is the first type argument of the type. + * + * @param flags type flags, consisting of [Flag.Type] flags + * @param variance the variance of the type projection + */ + open fun visitArgument(flags: Flags, variance: KmVariance): KmTypeVisitor? = + delegate?.visitArgument(flags, variance) + + /** + * Visits the star (`*`) projection used in a type argument of the type based on a class or on a type alias. + * For example, in `MutableMap`, `*` is the star projection which is the second type argument of the type. + */ + open fun visitStarProjection() { + delegate?.visitStarProjection() + } + + /** + * Visits the abbreviation of this type. Note that all types are expanded for metadata produced by the Kotlin compiler. For example: + * + * typealias A = MutableList + * + * fun foo(a: A) {} + * + * The type of the `foo`'s parameter in the metadata is actually `MutableList`, and its abbreviation is `A`. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitAbbreviatedType(flags: Flags): KmTypeVisitor? = + delegate?.visitAbbreviatedType(flags) + + /** + * Visits the outer type, if this type's classifier is an inner class. For example: + * + * class A { inner class B } + * + * fun foo(a: A<*>.B) {} + * + * The type of the `foo`'s parameter in the metadata is `B` (a type whose classifier is class `B`, and it has one type argument, + * type `Byte?`), and its outer type is `A<*>` (a type whose classifier is class `A`, and it has one type argument, star projection). + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitOuterType(flags: Flags): KmTypeVisitor? = + delegate?.visitOuterType(flags) + + /** + * Visits the upper bound of the type, marking it as flexible and its contents as the lower bound. Flexible types in Kotlin include + * platform types in Kotlin/JVM and `dynamic` type in Kotlin/JS. + * + * @param flags type flags, consisting of [Flag.Type] flags + * @param typeFlexibilityId id of the kind of flexibility this type has. For example, "kotlin.jvm.PlatformType" for JVM platform types, + * or "kotlin.DynamicType" for JS dynamic type + */ + open fun visitFlexibleTypeUpperBound(flags: Flags, typeFlexibilityId: String?): KmTypeVisitor? = + delegate?.visitFlexibleTypeUpperBound(flags, typeFlexibilityId) + + /** + * Visits the extensions of the given type on the type. + * + * @param type the type of extension visitor to be returned + */ + open fun visitExtensions(type: KmExtensionType): KmTypeExtensionVisitor? = + delegate?.visitExtensions(type) + + /** + * Visits the end of the type. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit the contents of a version requirement on a Kotlin declaration. + * + * Version requirement is an internal feature of the Kotlin compiler and the standard Kotlin library, + * enabled for example with the internal [kotlin.internal.RequireKotlin] annotation. + * + * When using this class, [visit] must be called first, followed by [visitVersion], followed by [visitEnd]. + */ +abstract class KmVersionRequirementVisitor @JvmOverloads constructor(private val delegate: KmVersionRequirementVisitor? = null) { + /** + * Visits the description of this version requirement. + * + * @param kind the kind of the version that this declaration requires: compiler, language or API version + * @param level the level of the diagnostic that must be reported on the usages of the declaration in case + * the version requirement is not satisfied + * @param errorCode optional error code to be displayed in the diagnostic + * @param message optional message to be displayed in the diagnostic + */ + open fun visit(kind: KmVersionRequirementVersionKind, level: KmVersionRequirementLevel, errorCode: Int?, message: String?) { + delegate?.visit(kind, level, errorCode, message) + } + + /** + * Visits the version required by this requirement. + * + * @param major the major component of the version (e.g. "1" in "1.2.3") + * @param minor the minor component of the version (e.g. "2" in "1.2.3") + * @param patch the patch component of the version (e.g. "3" in "1.2.3") + */ + open fun visitVersion(major: Int, minor: Int, patch: Int) { + delegate?.visitVersion(major, minor, patch) + } + + /** + * Visits the end of the version requirement. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit the contents of the contract of a Kotlin function. + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + * + * When using this class, zero or more calls to [visitEffect] must be done first, followed by [visitEnd]. + */ +abstract class KmContractVisitor @JvmOverloads constructor(private val delegate: KmContractVisitor? = null) { + /** + * Visits an effect of this contract. + * + * @param type type of the effect + * @param invocationKind optional number of invocations of the lambda parameter of this function, + * specified further in the effect expression + */ + open fun visitEffect(type: KmEffectType, invocationKind: KmEffectInvocationKind?): KmEffectVisitor? = + delegate?.visitEffect(type, invocationKind) + + /** + * Visits the end of the contract. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit an effect (a part of the contract of a Kotlin function). + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + * + * When using this class, zero or more calls to [visitConstructorArgument] or [visitConclusionOfConditionalEffect] must be done first, + * followed by [visitEnd]. + */ +abstract class KmEffectVisitor @JvmOverloads constructor(private val delegate: KmEffectVisitor? = null) { + /** + * Visits the optional argument of the effect constructor, i.e. the constant value for the [KmEffectType.RETURNS_CONSTANT] effect, + * or the parameter reference for the [KmEffectType.CALLS] effect. + */ + open fun visitConstructorArgument(): KmEffectExpressionVisitor? = + delegate?.visitConstructorArgument() + + /** + * Visits the optional conclusion of the effect. If this method is called, the effect represents an implication with the + * right-hand side handled by the returned visitor. + */ + open fun visitConclusionOfConditionalEffect(): KmEffectExpressionVisitor? = + delegate?.visitConclusionOfConditionalEffect() + + /** + * Visits the end of the effect. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * A visitor to visit the effect expression, the contents of an effect (a part of the contract of a Kotlin function). + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + * + * When using this class, [visit] must be called first, followed by zero or more calls to other visit* methods, followed by [visitEnd]. + */ +abstract class KmEffectExpressionVisitor @JvmOverloads constructor(private val delegate: KmEffectExpressionVisitor? = null) { + /** + * Visits the basic information of the effect expression. + * + * @param flags effect expression flags, consisting of [Flag.EffectExpression] flags + * @param parameterIndex optional 1-based index of the value parameter of the function, for effects which assert something about + * the function parameters. The index 0 means the extension receiver parameter + */ + open fun visit(flags: Flags, parameterIndex: Int?) { + delegate?.visit(flags, parameterIndex) + } + + /** + * Visits the constant value used in the effect expression. May be `true`, `false` or `null`. + * + * @param value the constant value + */ + open fun visitConstantValue(value: Any?) { + delegate?.visitConstantValue(value) + } + + /** + * Visits the type used as the target of an `is`-expression in the effect expression. + * + * @param flags type flags, consisting of [Flag.Type] flags + */ + open fun visitIsInstanceType(flags: Flags): KmTypeVisitor? = + delegate?.visitIsInstanceType(flags) + + /** + * Visits the argument of an `&&`-expression. If this method is called, the expression represents the left-hand side and + * the returned visitor handles the right-hand side. + */ + open fun visitAndArgument(): KmEffectExpressionVisitor? = + delegate?.visitAndArgument() + + /** + * Visits the argument of an `||`-expression. If this method is called, the expression represents the left-hand side and + * the returned visitor handles the right-hand side. + */ + open fun visitOrArgument(): KmEffectExpressionVisitor? = + delegate?.visitOrArgument() + + /** + * Visits the end of the effect expression. + */ + open fun visitEnd() { + delegate?.visitEnd() + } +} + +/** + * Variance applied to a type parameter on the declaration site (*declaration-site variance*), + * or to a type in a projection (*use-site variance*). + */ +enum class KmVariance { + /** + * The affected type parameter or type is *invariant*, which means it has no variance applied to it. + */ + INVARIANT, + + /** + * The affected type parameter or type is *contravariant*. Denoted by the `in` modifier in the source code. + */ + IN, + + /** + * The affected type parameter or type is *covariant*. Denoted by the `out` modifier in the source code. + */ + OUT, +} + +/** + * Type of an effect (a part of the contract of a Kotlin function). + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + */ +enum class KmEffectType { + RETURNS_CONSTANT, + CALLS, + RETURNS_NOT_NULL, +} + +/** + * Number of invocations of a lambda parameter specified by an effect (a part of the contract of a Kotlin function). + * + * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format + * may change in a subsequent release. + */ +enum class KmEffectInvocationKind { + AT_MOST_ONCE, + EXACTLY_ONCE, + AT_LEAST_ONCE, +} + +/** + * Severity of the diagnostic reported by the compiler when a version requirement is not satisfied. + */ +enum class KmVersionRequirementLevel { + WARNING, + ERROR, + HIDDEN, +} + +/** + * The kind of the version that is required by a version requirement. + */ +enum class KmVersionRequirementVersionKind { + LANGUAGE_VERSION, + COMPILER_VERSION, + API_VERSION, +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/Interner.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/Interner.kt new file mode 100644 index 0000000000..cc8faf86b6 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/Interner.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.serialization + +class Interner(private val parent: Interner? = null) { + private val firstIndex: Int = parent?.run { interned.size + firstIndex } ?: 0 + private val interned = hashMapOf() + + val allInternedObjects: List + get() = interned.keys.sortedBy(interned::get) + + val isEmpty: Boolean + get() = interned.isEmpty() && parent?.isEmpty != false + + private fun find(obj: T): Int? { + assert(parent == null || parent.interned.size + parent.firstIndex == firstIndex) { + "Parent changed in parallel with child: indexes will be wrong" + } + return parent?.find(obj) ?: interned[obj] + } + + fun intern(obj: T): Int = + find(obj) ?: (firstIndex + interned.size).also { + interned[obj] = it + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/MutableTable.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/MutableTable.kt new file mode 100644 index 0000000000..f2ac8becd0 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/MutableTable.kt @@ -0,0 +1,62 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("FINITE_BOUNDS_VIOLATION_IN_JAVA") + +package org.jetbrains.kotlin.metadata.serialization + +import com.google.protobuf.GeneratedMessageLite +import org.jetbrains.kotlin.metadata.ProtoBuf + +private class TableElementWrapper>(val builder: Element) { + // If you'll try to optimize it using structured equals/hashCode, pay attention to extensions present in proto messages + private val bytes: ByteArray = builder.build().toByteArray() + private val hashCode: Int = bytes.contentHashCode() + + override fun hashCode() = hashCode + + override fun equals(other: Any?) = other is TableElementWrapper<*> && bytes.contentEquals(other.bytes) +} + +abstract class MutableTable + where Element : GeneratedMessageLite.Builder<*, Element>, + Table : GeneratedMessageLite, + TableBuilder : GeneratedMessageLite.Builder { + + private val interner = Interner>() + + protected abstract fun createTableBuilder(): TableBuilder + + protected abstract fun addElement(builder: TableBuilder, element: Element) + + operator fun get(type: Element): Int = + interner.intern(TableElementWrapper(type)) + + @Suppress("UNCHECKED_CAST") + fun serialize(): Table? = + if (interner.isEmpty) null + else createTableBuilder().apply { + for (obj in interner.allInternedObjects) { + addElement(this, obj.builder) + } + }.build() as Table +} + +class MutableTypeTable : MutableTable() { + override fun createTableBuilder(): ProtoBuf.TypeTable.Builder = ProtoBuf.TypeTable.newBuilder() + + override fun addElement(builder: ProtoBuf.TypeTable.Builder, element: ProtoBuf.Type.Builder) { + builder.addType(element) + } +} + +class MutableVersionRequirementTable : + MutableTable() { + override fun createTableBuilder(): ProtoBuf.VersionRequirementTable.Builder = ProtoBuf.VersionRequirementTable.newBuilder() + + override fun addElement(builder: ProtoBuf.VersionRequirementTable.Builder, element: ProtoBuf.VersionRequirement.Builder) { + builder.addRequirement(element) + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/StringTable.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/StringTable.kt new file mode 100644 index 0000000000..26abfdded3 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/StringTable.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.serialization + +interface StringTable { + fun getStringIndex(string: String): Int + + /** + * @param className the fully qualified name of some class in the format: `org/foo/bar/Test.Inner` + */ + fun getQualifiedClassNameIndex(className: String, isLocal: Boolean): Int +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java new file mode 100644 index 0000000000..7527b5e982 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java @@ -0,0 +1,26745 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/metadata/src/metadata.proto + +package org.jetbrains.kotlin.metadata; + +public final class ProtoBuf { + private ProtoBuf() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.Modality} + */ + public enum Modality + implements com.google.protobuf.Internal.EnumLite { + /** + * FINAL = 0; + * + *

+     * 2 bits
+     * 
+ */ + FINAL(0, 0), + /** + * OPEN = 1; + */ + OPEN(1, 1), + /** + * ABSTRACT = 2; + */ + ABSTRACT(2, 2), + /** + * SEALED = 3; + */ + SEALED(3, 3), + ; + + /** + * FINAL = 0; + * + *
+     * 2 bits
+     * 
+ */ + public static final int FINAL_VALUE = 0; + /** + * OPEN = 1; + */ + public static final int OPEN_VALUE = 1; + /** + * ABSTRACT = 2; + */ + public static final int ABSTRACT_VALUE = 2; + /** + * SEALED = 3; + */ + public static final int SEALED_VALUE = 3; + + + @Override public final int getNumber() { return value; } + + public static Modality valueOf(int value) { + switch (value) { + case 0: return FINAL; + case 1: return OPEN; + case 2: return ABSTRACT; + case 3: return SEALED; + 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() { + @Override public Modality findValueByNumber(int number) { + return Modality.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Modality(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Modality) + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.Visibility} + */ + public enum Visibility + implements com.google.protobuf.Internal.EnumLite { + /** + * INTERNAL = 0; + * + *
+     * 3 bits
+     * 
+ */ + INTERNAL(0, 0), + /** + * PRIVATE = 1; + */ + PRIVATE(1, 1), + /** + * PROTECTED = 2; + */ + PROTECTED(2, 2), + /** + * PUBLIC = 3; + */ + PUBLIC(3, 3), + /** + * PRIVATE_TO_THIS = 4; + */ + PRIVATE_TO_THIS(4, 4), + /** + * LOCAL = 5; + */ + LOCAL(5, 5), + ; + + /** + * INTERNAL = 0; + * + *
+     * 3 bits
+     * 
+ */ + public static final int INTERNAL_VALUE = 0; + /** + * PRIVATE = 1; + */ + public static final int PRIVATE_VALUE = 1; + /** + * PROTECTED = 2; + */ + public static final int PROTECTED_VALUE = 2; + /** + * PUBLIC = 3; + */ + public static final int PUBLIC_VALUE = 3; + /** + * PRIVATE_TO_THIS = 4; + */ + public static final int PRIVATE_TO_THIS_VALUE = 4; + /** + * LOCAL = 5; + */ + public static final int LOCAL_VALUE = 5; + + + @Override public final int getNumber() { return value; } + + public static Visibility valueOf(int value) { + switch (value) { + case 0: return INTERNAL; + case 1: return PRIVATE; + case 2: return PROTECTED; + case 3: return PUBLIC; + case 4: return PRIVATE_TO_THIS; + case 5: return LOCAL; + 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() { + @Override public Visibility findValueByNumber(int number) { + return Visibility.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Visibility(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Visibility) + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.MemberKind} + */ + public enum MemberKind + implements com.google.protobuf.Internal.EnumLite { + /** + * DECLARATION = 0; + * + *
+     * 2 bits
+     * 
+ */ + DECLARATION(0, 0), + /** + * FAKE_OVERRIDE = 1; + */ + FAKE_OVERRIDE(1, 1), + /** + * DELEGATION = 2; + */ + DELEGATION(2, 2), + /** + * SYNTHESIZED = 3; + */ + SYNTHESIZED(3, 3), + ; + + /** + * DECLARATION = 0; + * + *
+     * 2 bits
+     * 
+ */ + public static final int DECLARATION_VALUE = 0; + /** + * FAKE_OVERRIDE = 1; + */ + public static final int FAKE_OVERRIDE_VALUE = 1; + /** + * DELEGATION = 2; + */ + public static final int DELEGATION_VALUE = 2; + /** + * SYNTHESIZED = 3; + */ + public static final int SYNTHESIZED_VALUE = 3; + + + @Override public final int getNumber() { return value; } + + public static MemberKind valueOf(int value) { + switch (value) { + case 0: return DECLARATION; + case 1: return FAKE_OVERRIDE; + case 2: return DELEGATION; + case 3: return SYNTHESIZED; + 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() { + @Override public MemberKind findValueByNumber(int number) { + return MemberKind.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private MemberKind(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.MemberKind) + } + + public interface StringTableOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.StringTable) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated string string = 1; + */ + com.google.protobuf.ProtocolStringList + getStringList(); + /** + * repeated string string = 1; + */ + int getStringCount(); + /** + * repeated string string = 1; + */ + java.lang.String getString(int index); + /** + * repeated string string = 1; + */ + com.google.protobuf.ByteString + getStringBytes(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.StringTable} + */ + public static final class StringTable extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.StringTable) + StringTableOrBuilder { + // Use StringTable.newBuilder() to construct. + private StringTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private StringTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final StringTable defaultInstance; + public static StringTable getDefaultInstance() { + return defaultInstance; + } + + @Override public StringTable getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private StringTable( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + string_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + string_.add(bs); + 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)) { + string_ = string_.getUnmodifiableView(); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override public StringTable parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StringTable(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public static final int STRING_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList string_; + /** + * repeated string string = 1; + */ + @Override public com.google.protobuf.ProtocolStringList + getStringList() { + return string_; + } + /** + * repeated string string = 1; + */ + @Override public int getStringCount() { + return string_.size(); + } + /** + * repeated string string = 1; + */ + @Override public java.lang.String getString(int index) { + return string_.get(index); + } + /** + * repeated string string = 1; + */ + @Override public com.google.protobuf.ByteString + getStringBytes(int index) { + return string_.getByteString(index); + } + + private void initFields() { + string_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + private byte memoizedIsInitialized = -1; + @Override public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < string_.size(); i++) { + output.writeBytes(1, string_.getByteString(i)); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < string_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(string_.getByteString(i)); + } + size += dataSize; + size += 1 * getStringList().size(); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.StringTable parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable 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.metadata.ProtoBuf.StringTable parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable 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(); } + @Override public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable prototype) { + return newBuilder().mergeFrom(prototype); + } + @Override public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.StringTable} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.StringTable, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.StringTable) + org.jetbrains.kotlin.metadata.ProtoBuf.StringTableOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override public Builder clear() { + super.clear(); + string_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @Override public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable build() { + org.jetbrains.kotlin.metadata.ProtoBuf.StringTable result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.StringTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.StringTable(this); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + string_ = string_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.string_ = string_; + return result; + } + + @Override public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance()) return this; + if (!other.string_.isEmpty()) { + if (string_.isEmpty()) { + string_ = other.string_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStringIsMutable(); + string_.addAll(other.string_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override public final boolean isInitialized() { + return true; + } + + @Override public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.StringTable) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList string_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureStringIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + string_ = new com.google.protobuf.LazyStringArrayList(string_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated string string = 1; + */ + @Override public com.google.protobuf.ProtocolStringList + getStringList() { + return string_.getUnmodifiableView(); + } + /** + * repeated string string = 1; + */ + @Override public int getStringCount() { + return string_.size(); + } + /** + * repeated string string = 1; + */ + @Override public java.lang.String getString(int index) { + return string_.get(index); + } + /** + * repeated string string = 1; + */ + @Override public com.google.protobuf.ByteString + getStringBytes(int index) { + return string_.getByteString(index); + } + /** + * repeated string string = 1; + */ + public Builder setString( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStringIsMutable(); + string_.set(index, value); + + return this; + } + /** + * repeated string string = 1; + */ + public Builder addString( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStringIsMutable(); + string_.add(value); + + return this; + } + /** + * repeated string string = 1; + */ + public Builder addAllString( + java.lang.Iterable values) { + ensureStringIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, string_); + + return this; + } + /** + * repeated string string = 1; + */ + public Builder clearString() { + string_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated string string = 1; + */ + public Builder addStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStringIsMutable(); + string_.add(value); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.StringTable) + } + + static { + defaultInstance = new StringTable(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.StringTable) + } + + public interface QualifiedNameTableOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.QualifiedNameTable) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + java.util.List + getQualifiedNameList(); + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + int getQualifiedNameCount(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable} + */ + public static final class QualifiedNameTable extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable) + QualifiedNameTableOrBuilder { + // Use QualifiedNameTable.newBuilder() to construct. + private QualifiedNameTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private QualifiedNameTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final QualifiedNameTable defaultInstance; + public static QualifiedNameTable getDefaultInstance() { + return defaultInstance; + } + + @Override public QualifiedNameTable getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private QualifiedNameTable( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + qualifiedName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + qualifiedName_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.PARSER, extensionRegistry)); + 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)) { + qualifiedName_ = java.util.Collections.unmodifiableList(qualifiedName_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override public QualifiedNameTable parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QualifiedNameTable(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface QualifiedNameOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional int32 parent_qualified_name = 1 [default = -1]; + */ + boolean hasParentQualifiedName(); + /** + * optional int32 parent_qualified_name = 1 [default = -1]; + */ + int getParentQualifiedName(); + + /** + * required int32 short_name = 2; + * + *
+       * id in the StringTable
+       * 
+ */ + boolean hasShortName(); + /** + * required int32 short_name = 2; + * + *
+       * id in the StringTable
+       * 
+ */ + int getShortName(); + + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; + */ + boolean hasKind(); + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName} + */ + public static final class QualifiedName extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) + QualifiedNameOrBuilder { + // Use QualifiedName.newBuilder() to construct. + private QualifiedName(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private QualifiedName(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final QualifiedName defaultInstance; + public static QualifiedName getDefaultInstance() { + return defaultInstance; + } + + @Override public QualifiedName getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private QualifiedName( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + parentQualifiedName_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + shortName_ = input.readInt32(); + break; + } + case 24: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind value = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000004; + kind_ = value; + } + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override public QualifiedName parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QualifiedName(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind} + */ + public enum Kind + implements com.google.protobuf.Internal.EnumLite { + /** + * CLASS = 0; + */ + CLASS(0, 0), + /** + * PACKAGE = 1; + */ + PACKAGE(1, 1), + /** + * LOCAL = 2; + */ + LOCAL(2, 2), + ; + + /** + * CLASS = 0; + */ + public static final int CLASS_VALUE = 0; + /** + * PACKAGE = 1; + */ + public static final int PACKAGE_VALUE = 1; + /** + * LOCAL = 2; + */ + public static final int LOCAL_VALUE = 2; + + + @Override public final int getNumber() { return value; } + + public static Kind valueOf(int value) { + switch (value) { + case 0: return CLASS; + case 1: return PACKAGE; + case 2: return LOCAL; + 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() { + @Override public Kind findValueByNumber(int number) { + return Kind.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Kind(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind) + } + + private int bitField0_; + public static final int PARENT_QUALIFIED_NAME_FIELD_NUMBER = 1; + private int parentQualifiedName_; + /** + * optional int32 parent_qualified_name = 1 [default = -1]; + */ + @Override public boolean hasParentQualifiedName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 parent_qualified_name = 1 [default = -1]; + */ + @Override public int getParentQualifiedName() { + return parentQualifiedName_; + } + + public static final int SHORT_NAME_FIELD_NUMBER = 2; + private int shortName_; + /** + * required int32 short_name = 2; + * + *
+       * id in the StringTable
+       * 
+ */ + @Override public boolean hasShortName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 short_name = 2; + * + *
+       * id in the StringTable
+       * 
+ */ + @Override public int getShortName() { + return shortName_; + } + + public static final int KIND_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind kind_; + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; + */ + @Override public boolean hasKind() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind() { + return kind_; + } + + private void initFields() { + parentQualifiedName_ = -1; + shortName_ = 0; + kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; + } + private byte memoizedIsInitialized = -1; + @Override public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasShortName()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, parentQualifiedName_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, shortName_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, kind_.getNumber()); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, parentQualifiedName_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, shortName_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, kind_.getNumber()); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName 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.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName 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(); } + @Override public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName prototype) { + return newBuilder().mergeFrom(prototype); + } + @Override public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedNameOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override public Builder clear() { + super.clear(); + parentQualifiedName_ = -1; + bitField0_ = (bitField0_ & ~0x00000001); + shortName_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @Override public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.getDefaultInstance(); + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName build() { + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName result = new org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.parentQualifiedName_ = parentQualifiedName_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.shortName_ = shortName_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.kind_ = kind_; + result.bitField0_ = to_bitField0_; + return result; + } + + @Override public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.getDefaultInstance()) return this; + if (other.hasParentQualifiedName()) { + setParentQualifiedName(other.getParentQualifiedName()); + } + if (other.hasShortName()) { + setShortName(other.getShortName()); + } + if (other.hasKind()) { + setKind(other.getKind()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override public final boolean isInitialized() { + if (!hasShortName()) { + + return false; + } + return true; + } + + @Override public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int parentQualifiedName_ = -1; + /** + * optional int32 parent_qualified_name = 1 [default = -1]; + */ + @Override public boolean hasParentQualifiedName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 parent_qualified_name = 1 [default = -1]; + */ + @Override public int getParentQualifiedName() { + return parentQualifiedName_; + } + /** + * optional int32 parent_qualified_name = 1 [default = -1]; + */ + public Builder setParentQualifiedName(int value) { + bitField0_ |= 0x00000001; + parentQualifiedName_ = value; + + return this; + } + /** + * optional int32 parent_qualified_name = 1 [default = -1]; + */ + public Builder clearParentQualifiedName() { + bitField0_ = (bitField0_ & ~0x00000001); + parentQualifiedName_ = -1; + + return this; + } + + private int shortName_ ; + /** + * required int32 short_name = 2; + * + *
+         * id in the StringTable
+         * 
+ */ + @Override public boolean hasShortName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 short_name = 2; + * + *
+         * id in the StringTable
+         * 
+ */ + @Override public int getShortName() { + return shortName_; + } + /** + * required int32 short_name = 2; + * + *
+         * id in the StringTable
+         * 
+ */ + public Builder setShortName(int value) { + bitField0_ |= 0x00000002; + shortName_ = value; + + return this; + } + /** + * required int32 short_name = 2; + * + *
+         * id in the StringTable
+         * 
+ */ + public Builder clearShortName() { + bitField0_ = (bitField0_ & ~0x00000002); + shortName_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; + */ + @Override public boolean hasKind() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind() { + return kind_; + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; + */ + public Builder setKind(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + kind_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; + */ + public Builder clearKind() { + bitField0_ = (bitField0_ & ~0x00000004); + kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) + } + + static { + defaultInstance = new QualifiedName(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) + } + + public static final int QUALIFIED_NAME_FIELD_NUMBER = 1; + private java.util.List qualifiedName_; + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + @Override public java.util.List getQualifiedNameList() { + return qualifiedName_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public java.util.List + getQualifiedNameOrBuilderList() { + return qualifiedName_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + @Override public int getQualifiedNameCount() { + return qualifiedName_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index) { + return qualifiedName_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedNameOrBuilder getQualifiedNameOrBuilder( + int index) { + return qualifiedName_.get(index); + } + + private void initFields() { + qualifiedName_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + @Override public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getQualifiedNameCount(); i++) { + if (!getQualifiedName(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < qualifiedName_.size(); i++) { + output.writeMessage(1, qualifiedName_.get(i)); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < qualifiedName_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, qualifiedName_.get(i)); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.QualifiedNameTable parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable 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.metadata.ProtoBuf.QualifiedNameTable parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable 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(); } + @Override public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable prototype) { + return newBuilder().mergeFrom(prototype); + } + @Override public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable) + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTableOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override public Builder clear() { + super.clear(); + qualifiedName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @Override public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable build() { + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable(this); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + qualifiedName_ = java.util.Collections.unmodifiableList(qualifiedName_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.qualifiedName_ = qualifiedName_; + return result; + } + + @Override public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance()) return this; + if (!other.qualifiedName_.isEmpty()) { + if (qualifiedName_.isEmpty()) { + qualifiedName_ = other.qualifiedName_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQualifiedNameIsMutable(); + qualifiedName_.addAll(other.qualifiedName_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override public final boolean isInitialized() { + for (int i = 0; i < getQualifiedNameCount(); i++) { + if (!getQualifiedName(i).isInitialized()) { + + return false; + } + } + return true; + } + + @Override public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List qualifiedName_ = + java.util.Collections.emptyList(); + private void ensureQualifiedNameIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + qualifiedName_ = new java.util.ArrayList(qualifiedName_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + @Override public java.util.List getQualifiedNameList() { + return java.util.Collections.unmodifiableList(qualifiedName_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + @Override public int getQualifiedNameCount() { + return qualifiedName_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index) { + return qualifiedName_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder setQualifiedName( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQualifiedNameIsMutable(); + qualifiedName_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder setQualifiedName( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { + ensureQualifiedNameIsMutable(); + qualifiedName_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder addQualifiedName(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQualifiedNameIsMutable(); + qualifiedName_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder addQualifiedName( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQualifiedNameIsMutable(); + qualifiedName_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder addQualifiedName( + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { + ensureQualifiedNameIsMutable(); + qualifiedName_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder addQualifiedName( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { + ensureQualifiedNameIsMutable(); + qualifiedName_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder addAllQualifiedName( + java.lang.Iterable values) { + ensureQualifiedNameIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, qualifiedName_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder clearQualifiedName() { + qualifiedName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; + */ + public Builder removeQualifiedName(int index) { + ensureQualifiedNameIsMutable(); + qualifiedName_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable) + } + + static { + defaultInstance = new QualifiedNameTable(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable) + } + + public interface AnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * required int32 id = 1; + */ + boolean hasId(); + /** + * required int32 id = 1; + */ + int getId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + java.util.List + getArgumentList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument getArgument(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + int getArgumentCount(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation} + */ + public static final class Annotation extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation) + AnnotationOrBuilder { + // Use Annotation.newBuilder() to construct. + private Annotation(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Annotation(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Annotation defaultInstance; + public static Annotation getDefaultInstance() { + return defaultInstance; + } + + @Override public Annotation getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Annotation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + id_ = input.readInt32(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + argument_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + argument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.PARSER, extensionRegistry)); + 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_ & 0x00000002) == 0x00000002)) { + argument_ = java.util.Collections.unmodifiableList(argument_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override public Annotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Annotation(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface ArgumentOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation.Argument) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * required int32 name_id = 1; + */ + boolean hasNameId(); + /** + * required int32 name_id = 1; + */ + int getNameId(); + + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + boolean hasValue(); + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getValue(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument} + */ + public static final class Argument extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation.Argument) + ArgumentOrBuilder { + // Use Argument.newBuilder() to construct. + private Argument(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Argument(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Argument defaultInstance; + public static Argument getDefaultInstance() { + return defaultInstance; + } + + @Override public Argument getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Argument( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + nameId_ = input.readInt32(); + break; + } + case 18: { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = value_.toBuilder(); + } + value_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(value_); + value_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override public Argument parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Argument(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface ValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; + * + *
+         * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
+         * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
+         * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
+         * 
+ */ + boolean hasType(); + /** + * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; + * + *
+         * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
+         * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
+         * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
+         * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type getType(); + + /** + * optional sint64 int_value = 2; + */ + boolean hasIntValue(); + /** + * optional sint64 int_value = 2; + */ + long getIntValue(); + + /** + * optional float float_value = 3; + */ + boolean hasFloatValue(); + /** + * optional float float_value = 3; + */ + float getFloatValue(); + + /** + * optional double double_value = 4; + */ + boolean hasDoubleValue(); + /** + * optional double double_value = 4; + */ + double getDoubleValue(); + + /** + * optional int32 string_value = 5; + */ + boolean hasStringValue(); + /** + * optional int32 string_value = 5; + */ + int getStringValue(); + + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
+         * 
+ */ + boolean hasClassId(); + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
+         * 
+ */ + int getClassId(); + + /** + * optional int32 enum_value_id = 7; + */ + boolean hasEnumValueId(); + /** + * optional int32 enum_value_id = 7; + */ + int getEnumValueId(); + + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + boolean hasAnnotation(); + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + java.util.List + getArrayElementList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getArrayElement(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + int getArrayElementCount(); + + /** + * optional int32 array_dimension_count = 11 [default = 0]; + * + *
+         * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
+         * E.g. if class_id = kotlin/String, this annotation argument value denotes:
+         * - String::class, if array_dimension_count = 0
+         * - Array<String>::class, if array_dimension_count = 1
+         * - Array<Array<String>>::class, if array_dimension_count = 2
+         * - etc.
+         * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
+         * in class literals on JVM, we don't bother to do represent this in our format as well.
+         * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
+         * 
+ */ + boolean hasArrayDimensionCount(); + /** + * optional int32 array_dimension_count = 11 [default = 0]; + * + *
+         * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
+         * E.g. if class_id = kotlin/String, this annotation argument value denotes:
+         * - String::class, if array_dimension_count = 0
+         * - Array<String>::class, if array_dimension_count = 1
+         * - Array<Array<String>>::class, if array_dimension_count = 2
+         * - etc.
+         * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
+         * in class literals on JVM, we don't bother to do represent this in our format as well.
+         * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
+         * 
+ */ + int getArrayDimensionCount(); + + /** + * optional int32 flags = 10 [default = 0]; + * + *
+         *isUnsigned
+         * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 10 [default = 0]; + * + *
+         *isUnsigned
+         * 
+ */ + int getFlags(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value} + */ + public static final class Value extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) + ValueOrBuilder { + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Value(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Value defaultInstance; + public static Value getDefaultInstance() { + return defaultInstance; + } + + @Override public Value getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Value( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type value = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = value; + } + break; + } + case 16: { + bitField0_ |= 0x00000002; + intValue_ = input.readSInt64(); + break; + } + case 29: { + bitField0_ |= 0x00000004; + floatValue_ = input.readFloat(); + break; + } + case 33: { + bitField0_ |= 0x00000008; + doubleValue_ = input.readDouble(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + stringValue_ = input.readInt32(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + classId_ = input.readInt32(); + break; + } + case 56: { + bitField0_ |= 0x00000040; + enumValueId_ = input.readInt32(); + break; + } + case 66: { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = annotation_.toBuilder(); + } + annotation_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(annotation_); + annotation_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + arrayElement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + arrayElement_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.PARSER, extensionRegistry)); + break; + } + case 80: { + bitField0_ |= 0x00000200; + flags_ = input.readInt32(); + break; + } + case 88: { + bitField0_ |= 0x00000100; + arrayDimensionCount_ = input.readInt32(); + 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_ & 0x00000100) == 0x00000100)) { + arrayElement_ = java.util.Collections.unmodifiableList(arrayElement_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override public Value parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Value(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type} + */ + public enum Type + implements com.google.protobuf.Internal.EnumLite { + /** + * BYTE = 0; + */ + BYTE(0, 0), + /** + * CHAR = 1; + */ + CHAR(1, 1), + /** + * SHORT = 2; + */ + SHORT(2, 2), + /** + * INT = 3; + */ + INT(3, 3), + /** + * LONG = 4; + */ + LONG(4, 4), + /** + * FLOAT = 5; + */ + FLOAT(5, 5), + /** + * DOUBLE = 6; + */ + DOUBLE(6, 6), + /** + * BOOLEAN = 7; + */ + BOOLEAN(7, 7), + /** + * STRING = 8; + */ + STRING(8, 8), + /** + * CLASS = 9; + */ + CLASS(9, 9), + /** + * ENUM = 10; + */ + ENUM(10, 10), + /** + * ANNOTATION = 11; + */ + ANNOTATION(11, 11), + /** + * ARRAY = 12; + */ + ARRAY(12, 12), + ; + + /** + * BYTE = 0; + */ + public static final int BYTE_VALUE = 0; + /** + * CHAR = 1; + */ + public static final int CHAR_VALUE = 1; + /** + * SHORT = 2; + */ + public static final int SHORT_VALUE = 2; + /** + * INT = 3; + */ + public static final int INT_VALUE = 3; + /** + * LONG = 4; + */ + public static final int LONG_VALUE = 4; + /** + * FLOAT = 5; + */ + public static final int FLOAT_VALUE = 5; + /** + * DOUBLE = 6; + */ + public static final int DOUBLE_VALUE = 6; + /** + * BOOLEAN = 7; + */ + public static final int BOOLEAN_VALUE = 7; + /** + * STRING = 8; + */ + public static final int STRING_VALUE = 8; + /** + * CLASS = 9; + */ + public static final int CLASS_VALUE = 9; + /** + * ENUM = 10; + */ + public static final int ENUM_VALUE = 10; + /** + * ANNOTATION = 11; + */ + public static final int ANNOTATION_VALUE = 11; + /** + * ARRAY = 12; + */ + public static final int ARRAY_VALUE = 12; + + + @Override public final int getNumber() { return value; } + + public static Type valueOf(int value) { + switch (value) { + case 0: return BYTE; + case 1: return CHAR; + case 2: return SHORT; + case 3: return INT; + case 4: return LONG; + case 5: return FLOAT; + case 6: return DOUBLE; + case 7: return BOOLEAN; + case 8: return STRING; + case 9: return CLASS; + case 10: return ENUM; + case 11: return ANNOTATION; + case 12: return ARRAY; + 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() { + @Override public Type findValueByNumber(int number) { + return Type.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Type(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type) + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type type_; + /** + * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; + * + *
+         * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
+         * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
+         * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
+         * 
+ */ + @Override public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; + * + *
+         * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
+         * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
+         * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
+         * 
+ */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type getType() { + return type_; + } + + public static final int INT_VALUE_FIELD_NUMBER = 2; + private long intValue_; + /** + * optional sint64 int_value = 2; + */ + @Override public boolean hasIntValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional sint64 int_value = 2; + */ + @Override public long getIntValue() { + return intValue_; + } + + public static final int FLOAT_VALUE_FIELD_NUMBER = 3; + private float floatValue_; + /** + * optional float float_value = 3; + */ + @Override public boolean hasFloatValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional float float_value = 3; + */ + @Override public float getFloatValue() { + return floatValue_; + } + + public static final int DOUBLE_VALUE_FIELD_NUMBER = 4; + private double doubleValue_; + /** + * optional double double_value = 4; + */ + @Override public boolean hasDoubleValue() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional double double_value = 4; + */ + @Override public double getDoubleValue() { + return doubleValue_; + } + + public static final int STRING_VALUE_FIELD_NUMBER = 5; + private int stringValue_; + /** + * optional int32 string_value = 5; + */ + @Override public boolean hasStringValue() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 string_value = 5; + */ + @Override public int getStringValue() { + return stringValue_; + } + + public static final int CLASS_ID_FIELD_NUMBER = 6; + private int classId_; + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
+         * 
+ */ + @Override public boolean hasClassId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
+         * 
+ */ + @Override public int getClassId() { + return classId_; + } + + public static final int ENUM_VALUE_ID_FIELD_NUMBER = 7; + private int enumValueId_; + /** + * optional int32 enum_value_id = 7; + */ + @Override public boolean hasEnumValueId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 enum_value_id = 7; + */ + @Override public int getEnumValueId() { + return enumValueId_; + } + + public static final int ANNOTATION_FIELD_NUMBER = 8; + private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation annotation_; + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + @Override public boolean hasAnnotation() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation() { + return annotation_; + } + + public static final int ARRAY_ELEMENT_FIELD_NUMBER = 9; + private java.util.List arrayElement_; + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + @Override public java.util.List getArrayElementList() { + return arrayElement_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public java.util.List + getArrayElementOrBuilderList() { + return arrayElement_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + @Override public int getArrayElementCount() { + return arrayElement_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { + return arrayElement_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.ValueOrBuilder getArrayElementOrBuilder( + int index) { + return arrayElement_.get(index); + } + + public static final int ARRAY_DIMENSION_COUNT_FIELD_NUMBER = 11; + private int arrayDimensionCount_; + /** + * optional int32 array_dimension_count = 11 [default = 0]; + * + *
+         * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
+         * E.g. if class_id = kotlin/String, this annotation argument value denotes:
+         * - String::class, if array_dimension_count = 0
+         * - Array<String>::class, if array_dimension_count = 1
+         * - Array<Array<String>>::class, if array_dimension_count = 2
+         * - etc.
+         * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
+         * in class literals on JVM, we don't bother to do represent this in our format as well.
+         * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
+         * 
+ */ + @Override public boolean hasArrayDimensionCount() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional int32 array_dimension_count = 11 [default = 0]; + * + *
+         * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
+         * E.g. if class_id = kotlin/String, this annotation argument value denotes:
+         * - String::class, if array_dimension_count = 0
+         * - Array<String>::class, if array_dimension_count = 1
+         * - Array<Array<String>>::class, if array_dimension_count = 2
+         * - etc.
+         * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
+         * in class literals on JVM, we don't bother to do represent this in our format as well.
+         * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
+         * 
+ */ + @Override public int getArrayDimensionCount() { + return arrayDimensionCount_; + } + + public static final int FLAGS_FIELD_NUMBER = 10; + private int flags_; + /** + * optional int32 flags = 10 [default = 0]; + * + *
+         *isUnsigned
+         * 
+ */ + @Override public boolean hasFlags() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional int32 flags = 10 [default = 0]; + * + *
+         *isUnsigned
+         * 
+ */ + @Override public int getFlags() { + return flags_; + } + + private void initFields() { + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + intValue_ = 0L; + floatValue_ = 0F; + doubleValue_ = 0D; + stringValue_ = 0; + classId_ = 0; + enumValueId_ = 0; + annotation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + arrayElement_ = java.util.Collections.emptyList(); + arrayDimensionCount_ = 0; + flags_ = 0; + } + private byte memoizedIsInitialized = -1; + @Override public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (hasAnnotation()) { + if (!getAnnotation().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getArrayElementCount(); i++) { + if (!getArrayElement(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, type_.getNumber()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeSInt64(2, intValue_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeFloat(3, floatValue_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeDouble(4, doubleValue_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, stringValue_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(6, classId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(7, enumValueId_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeMessage(8, annotation_); + } + for (int i = 0; i < arrayElement_.size(); i++) { + output.writeMessage(9, arrayElement_.get(i)); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeInt32(10, flags_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeInt32(11, arrayDimensionCount_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_.getNumber()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(2, intValue_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, floatValue_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, doubleValue_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, stringValue_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, classId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, enumValueId_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, annotation_); + } + for (int i = 0; i < arrayElement_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, arrayElement_.get(i)); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, flags_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, arrayDimensionCount_); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value 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.metadata.ProtoBuf.Annotation.Argument.Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value 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(); } + @Override public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value prototype) { + return newBuilder().mergeFrom(prototype); + } + @Override public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.ValueOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override public Builder clear() { + super.clear(); + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + bitField0_ = (bitField0_ & ~0x00000001); + intValue_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + floatValue_ = 0F; + bitField0_ = (bitField0_ & ~0x00000004); + doubleValue_ = 0D; + bitField0_ = (bitField0_ & ~0x00000008); + stringValue_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + classId_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + enumValueId_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + annotation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000080); + arrayElement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + arrayDimensionCount_ = 0; + bitField0_ = (bitField0_ & ~0x00000200); + flags_ = 0; + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + @Override public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value result = new org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.intValue_ = intValue_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.floatValue_ = floatValue_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.doubleValue_ = doubleValue_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.stringValue_ = stringValue_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.classId_ = classId_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.enumValueId_ = enumValueId_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.annotation_ = annotation_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + arrayElement_ = java.util.Collections.unmodifiableList(arrayElement_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.arrayElement_ = arrayElement_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000100; + } + result.arrayDimensionCount_ = arrayDimensionCount_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000200; + } + result.flags_ = flags_; + result.bitField0_ = to_bitField0_; + return result; + } + + @Override public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) return this; + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasIntValue()) { + setIntValue(other.getIntValue()); + } + if (other.hasFloatValue()) { + setFloatValue(other.getFloatValue()); + } + if (other.hasDoubleValue()) { + setDoubleValue(other.getDoubleValue()); + } + if (other.hasStringValue()) { + setStringValue(other.getStringValue()); + } + if (other.hasClassId()) { + setClassId(other.getClassId()); + } + if (other.hasEnumValueId()) { + setEnumValueId(other.getEnumValueId()); + } + if (other.hasAnnotation()) { + mergeAnnotation(other.getAnnotation()); + } + if (!other.arrayElement_.isEmpty()) { + if (arrayElement_.isEmpty()) { + arrayElement_ = other.arrayElement_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureArrayElementIsMutable(); + arrayElement_.addAll(other.arrayElement_); + } + + } + if (other.hasArrayDimensionCount()) { + setArrayDimensionCount(other.getArrayDimensionCount()); + } + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override public final boolean isInitialized() { + if (hasAnnotation()) { + if (!getAnnotation().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getArrayElementCount(); i++) { + if (!getArrayElement(i).isInitialized()) { + + return false; + } + } + return true; + } + + @Override public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + /** + * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; + * + *
+           * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
+           * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
+           * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
+           * 
+ */ + @Override public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; + * + *
+           * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
+           * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
+           * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
+           * 
+ */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type getType() { + return type_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; + * + *
+           * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
+           * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
+           * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
+           * 
+ */ + public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; + * + *
+           * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
+           * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
+           * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
+           * 
+ */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + + return this; + } + + private long intValue_ ; + /** + * optional sint64 int_value = 2; + */ + @Override public boolean hasIntValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional sint64 int_value = 2; + */ + @Override public long getIntValue() { + return intValue_; + } + /** + * optional sint64 int_value = 2; + */ + public Builder setIntValue(long value) { + bitField0_ |= 0x00000002; + intValue_ = value; + + return this; + } + /** + * optional sint64 int_value = 2; + */ + public Builder clearIntValue() { + bitField0_ = (bitField0_ & ~0x00000002); + intValue_ = 0L; + + return this; + } + + private float floatValue_ ; + /** + * optional float float_value = 3; + */ + @Override public boolean hasFloatValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional float float_value = 3; + */ + @Override public float getFloatValue() { + return floatValue_; + } + /** + * optional float float_value = 3; + */ + public Builder setFloatValue(float value) { + bitField0_ |= 0x00000004; + floatValue_ = value; + + return this; + } + /** + * optional float float_value = 3; + */ + public Builder clearFloatValue() { + bitField0_ = (bitField0_ & ~0x00000004); + floatValue_ = 0F; + + return this; + } + + private double doubleValue_ ; + /** + * optional double double_value = 4; + */ + @Override public boolean hasDoubleValue() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional double double_value = 4; + */ + @Override public double getDoubleValue() { + return doubleValue_; + } + /** + * optional double double_value = 4; + */ + public Builder setDoubleValue(double value) { + bitField0_ |= 0x00000008; + doubleValue_ = value; + + return this; + } + /** + * optional double double_value = 4; + */ + public Builder clearDoubleValue() { + bitField0_ = (bitField0_ & ~0x00000008); + doubleValue_ = 0D; + + return this; + } + + private int stringValue_ ; + /** + * optional int32 string_value = 5; + */ + @Override public boolean hasStringValue() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 string_value = 5; + */ + @Override public int getStringValue() { + return stringValue_; + } + /** + * optional int32 string_value = 5; + */ + public Builder setStringValue(int value) { + bitField0_ |= 0x00000010; + stringValue_ = value; + + return this; + } + /** + * optional int32 string_value = 5; + */ + public Builder clearStringValue() { + bitField0_ = (bitField0_ & ~0x00000010); + stringValue_ = 0; + + return this; + } + + private int classId_ ; + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
+           * 
+ */ + @Override public boolean hasClassId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
+           * 
+ */ + @Override public int getClassId() { + return classId_; + } + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
+           * 
+ */ + public Builder setClassId(int value) { + bitField0_ |= 0x00000020; + classId_ = value; + + return this; + } + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
+           * 
+ */ + public Builder clearClassId() { + bitField0_ = (bitField0_ & ~0x00000020); + classId_ = 0; + + return this; + } + + private int enumValueId_ ; + /** + * optional int32 enum_value_id = 7; + */ + @Override public boolean hasEnumValueId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 enum_value_id = 7; + */ + @Override public int getEnumValueId() { + return enumValueId_; + } + /** + * optional int32 enum_value_id = 7; + */ + public Builder setEnumValueId(int value) { + bitField0_ |= 0x00000040; + enumValueId_ = value; + + return this; + } + /** + * optional int32 enum_value_id = 7; + */ + public Builder clearEnumValueId() { + bitField0_ = (bitField0_ & ~0x00000040); + enumValueId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation annotation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + @Override public boolean hasAnnotation() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation() { + return annotation_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder setAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + if (value == null) { + throw new NullPointerException(); + } + annotation_ = value; + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder setAnnotation( + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + annotation_ = builderForValue.build(); + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder mergeAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + if (((bitField0_ & 0x00000080) == 0x00000080) && + annotation_ != org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance()) { + annotation_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.newBuilder(annotation_).mergeFrom(value).buildPartial(); + } else { + annotation_ = value; + } + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder clearAnnotation() { + annotation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + private java.util.List arrayElement_ = + java.util.Collections.emptyList(); + private void ensureArrayElementIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + arrayElement_ = new java.util.ArrayList(arrayElement_); + bitField0_ |= 0x00000100; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + @Override public java.util.List getArrayElementList() { + return java.util.Collections.unmodifiableList(arrayElement_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + @Override public int getArrayElementCount() { + return arrayElement_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { + return arrayElement_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder setArrayElement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder setArrayElement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + ensureArrayElementIsMutable(); + arrayElement_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + ensureArrayElementIsMutable(); + arrayElement_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + ensureArrayElementIsMutable(); + arrayElement_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder addAllArrayElement( + java.lang.Iterable values) { + ensureArrayElementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, arrayElement_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder clearArrayElement() { + arrayElement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; + */ + public Builder removeArrayElement(int index) { + ensureArrayElementIsMutable(); + arrayElement_.remove(index); + + return this; + } + + private int arrayDimensionCount_ ; + /** + * optional int32 array_dimension_count = 11 [default = 0]; + * + *
+           * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
+           * E.g. if class_id = kotlin/String, this annotation argument value denotes:
+           * - String::class, if array_dimension_count = 0
+           * - Array<String>::class, if array_dimension_count = 1
+           * - Array<Array<String>>::class, if array_dimension_count = 2
+           * - etc.
+           * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
+           * in class literals on JVM, we don't bother to do represent this in our format as well.
+           * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
+           * 
+ */ + @Override public boolean hasArrayDimensionCount() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional int32 array_dimension_count = 11 [default = 0]; + * + *
+           * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
+           * E.g. if class_id = kotlin/String, this annotation argument value denotes:
+           * - String::class, if array_dimension_count = 0
+           * - Array<String>::class, if array_dimension_count = 1
+           * - Array<Array<String>>::class, if array_dimension_count = 2
+           * - etc.
+           * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
+           * in class literals on JVM, we don't bother to do represent this in our format as well.
+           * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
+           * 
+ */ + @Override public int getArrayDimensionCount() { + return arrayDimensionCount_; + } + /** + * optional int32 array_dimension_count = 11 [default = 0]; + * + *
+           * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
+           * E.g. if class_id = kotlin/String, this annotation argument value denotes:
+           * - String::class, if array_dimension_count = 0
+           * - Array<String>::class, if array_dimension_count = 1
+           * - Array<Array<String>>::class, if array_dimension_count = 2
+           * - etc.
+           * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
+           * in class literals on JVM, we don't bother to do represent this in our format as well.
+           * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
+           * 
+ */ + public Builder setArrayDimensionCount(int value) { + bitField0_ |= 0x00000200; + arrayDimensionCount_ = value; + + return this; + } + /** + * optional int32 array_dimension_count = 11 [default = 0]; + * + *
+           * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
+           * E.g. if class_id = kotlin/String, this annotation argument value denotes:
+           * - String::class, if array_dimension_count = 0
+           * - Array<String>::class, if array_dimension_count = 1
+           * - Array<Array<String>>::class, if array_dimension_count = 2
+           * - etc.
+           * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
+           * in class literals on JVM, we don't bother to do represent this in our format as well.
+           * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
+           * 
+ */ + public Builder clearArrayDimensionCount() { + bitField0_ = (bitField0_ & ~0x00000200); + arrayDimensionCount_ = 0; + + return this; + } + + private int flags_ ; + /** + * optional int32 flags = 10 [default = 0]; + * + *
+           *isUnsigned
+           * 
+ */ + @Override public boolean hasFlags() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional int32 flags = 10 [default = 0]; + * + *
+           *isUnsigned
+           * 
+ */ + @Override public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 10 [default = 0]; + * + *
+           *isUnsigned
+           * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000400; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 10 [default = 0]; + * + *
+           *isUnsigned
+           * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000400); + flags_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) + } + + static { + defaultInstance = new Value(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) + } + + private int bitField0_; + public static final int NAME_ID_FIELD_NUMBER = 1; + private int nameId_; + /** + * required int32 name_id = 1; + */ + @Override public boolean hasNameId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 name_id = 1; + */ + @Override public int getNameId() { + return nameId_; + } + + public static final int VALUE_FIELD_NUMBER = 2; + private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value_; + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + @Override public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getValue() { + return value_; + } + + private void initFields() { + nameId_ = 0; + value_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + @Override public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasNameId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasValue()) { + memoizedIsInitialized = 0; + return false; + } + if (!getValue().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, nameId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, value_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, nameId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, value_); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.Annotation.Argument parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument 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.metadata.ProtoBuf.Annotation.Argument parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument 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.metadata.ProtoBuf.Annotation.Argument prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation.Argument) + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.ArgumentOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + nameId_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + value_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument result = new org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.nameId_ = nameId_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.value_ = value_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.getDefaultInstance()) return this; + if (other.hasNameId()) { + setNameId(other.getNameId()); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasNameId()) { + + return false; + } + if (!hasValue()) { + + return false; + } + if (!getValue().isInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int nameId_ ; + /** + * required int32 name_id = 1; + */ + public boolean hasNameId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 name_id = 1; + */ + public int getNameId() { + return nameId_; + } + /** + * required int32 name_id = 1; + */ + public Builder setNameId(int value) { + bitField0_ |= 0x00000001; + nameId_ = value; + + return this; + } + /** + * required int32 name_id = 1; + */ + public Builder clearNameId() { + bitField0_ = (bitField0_ & ~0x00000001); + nameId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getValue() { + return value_; + } + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + public Builder setValue(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + public Builder setValue( + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + value_ = builderForValue.build(); + + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + public Builder mergeValue(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + value_ != org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) { + value_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.newBuilder(value_).mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; + */ + public Builder clearValue() { + value_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Annotation.Argument) + } + + static { + defaultInstance = new Argument(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Annotation.Argument) + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private int id_; + /** + * required int32 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 id = 1; + */ + public int getId() { + return id_; + } + + public static final int ARGUMENT_FIELD_NUMBER = 2; + private java.util.List argument_; + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public java.util.List getArgumentList() { + return argument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public java.util.List + getArgumentOrBuilderList() { + return argument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument getArgument(int index) { + return argument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.ArgumentOrBuilder getArgumentOrBuilder( + int index) { + return argument_.get(index); + } + + private void initFields() { + id_ = 0; + argument_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getArgumentCount(); i++) { + if (!getArgument(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, id_); + } + for (int i = 0; i < argument_.size(); i++) { + output.writeMessage(2, argument_.get(i)); + } + output.writeRawBytes(unknownFields); + } + + 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, id_); + } + for (int i = 0; i < argument_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, argument_.get(i)); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.Annotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation 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.metadata.ProtoBuf.Annotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation 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.metadata.ProtoBuf.Annotation prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation) + org.jetbrains.kotlin.metadata.ProtoBuf.AnnotationOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + id_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + argument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation result = new org.jetbrains.kotlin.metadata.ProtoBuf.Annotation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + argument_ = java.util.Collections.unmodifiableList(argument_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.argument_ = argument_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (!other.argument_.isEmpty()) { + if (argument_.isEmpty()) { + argument_ = other.argument_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureArgumentIsMutable(); + argument_.addAll(other.argument_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + + return false; + } + for (int i = 0; i < getArgumentCount(); i++) { + if (!getArgument(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Annotation) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int id_ ; + /** + * required int32 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 id = 1; + */ + public int getId() { + return id_; + } + /** + * required int32 id = 1; + */ + public Builder setId(int value) { + bitField0_ |= 0x00000001; + id_ = value; + + return this; + } + /** + * required int32 id = 1; + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0; + + return this; + } + + private java.util.List argument_ = + java.util.Collections.emptyList(); + private void ensureArgumentIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + argument_ = new java.util.ArrayList(argument_); + bitField0_ |= 0x00000002; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public java.util.List getArgumentList() { + return java.util.Collections.unmodifiableList(argument_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument getArgument(int index) { + return argument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder setArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder setArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder addArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder addArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder addArgument( + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder addArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder addAllArgument( + java.lang.Iterable values) { + ensureArgumentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, argument_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder clearArgument() { + argument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; + */ + public Builder removeArgument(int index) { + ensureArgumentIsMutable(); + argument_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Annotation) + } + + static { + defaultInstance = new Annotation(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Annotation) + } + + public interface TypeOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Type) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + java.util.List + getArgumentList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument getArgument(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + int getArgumentCount(); + + /** + * optional bool nullable = 3 [default = false]; + */ + boolean hasNullable(); + /** + * optional bool nullable = 3 [default = false]; + */ + boolean getNullable(); + + /** + * optional int32 flexible_type_capabilities_id = 4; + * + *
+     * If this field is set, the type is flexible.
+     * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
+     * 
+ */ + boolean hasFlexibleTypeCapabilitiesId(); + /** + * optional int32 flexible_type_capabilities_id = 4; + * + *
+     * If this field is set, the type is flexible.
+     * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
+     * 
+ */ + int getFlexibleTypeCapabilitiesId(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + boolean hasFlexibleUpperBound(); + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getFlexibleUpperBound(); + + /** + * optional int32 flexible_upper_bound_id = 8; + */ + boolean hasFlexibleUpperBoundId(); + /** + * optional int32 flexible_upper_bound_id = 8; + */ + int getFlexibleUpperBoundId(); + + /** + * optional int32 class_name = 6; + */ + boolean hasClassName(); + /** + * optional int32 class_name = 6; + */ + int getClassName(); + + /** + * optional int32 type_parameter = 7; + * + *
+     * id of the type parameter
+     * 
+ */ + boolean hasTypeParameter(); + /** + * optional int32 type_parameter = 7; + * + *
+     * id of the type parameter
+     * 
+ */ + int getTypeParameter(); + + /** + * optional int32 type_parameter_name = 9; + * + *
+     * Name of the type parameter in the immediate owner
+     * 
+ */ + boolean hasTypeParameterName(); + /** + * optional int32 type_parameter_name = 9; + * + *
+     * Name of the type parameter in the immediate owner
+     * 
+ */ + int getTypeParameterName(); + + /** + * optional int32 type_alias_name = 12; + * + *
+     * Note that this may be present only for abbreviated_type
+     * Top level types are always fully expanded
+     * 
+ */ + boolean hasTypeAliasName(); + /** + * optional int32 type_alias_name = 12; + * + *
+     * Note that this may be present only for abbreviated_type
+     * Top level types are always fully expanded
+     * 
+ */ + int getTypeAliasName(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+     * Outer type may be present only if class_name or type_alias_name is present
+     * 
+ */ + boolean hasOuterType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+     * Outer type may be present only if class_name or type_alias_name is present
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getOuterType(); + + /** + * optional int32 outer_type_id = 11; + */ + boolean hasOuterTypeId(); + /** + * optional int32 outer_type_id = 11; + */ + int getOuterTypeId(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + boolean hasAbbreviatedType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getAbbreviatedType(); + + /** + * optional int32 abbreviated_type_id = 14; + */ + boolean hasAbbreviatedTypeId(); + /** + * optional int32 abbreviated_type_id = 14; + */ + int getAbbreviatedTypeId(); + + /** + * optional int32 flags = 1; + * + *
+     *suspend
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 1; + * + *
+     *suspend
+     * 
+ */ + int getFlags(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Type} + */ + public static final class Type extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Type> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Type) + TypeOrBuilder { + // Use Type.newBuilder() to construct. + private Type(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Type(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Type defaultInstance; + public static Type getDefaultInstance() { + return defaultInstance; + } + + public Type getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Type( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00001000; + flags_ = input.readInt32(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + argument_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + argument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.PARSER, extensionRegistry)); + break; + } + case 24: { + bitField0_ |= 0x00000001; + nullable_ = input.readBool(); + break; + } + case 32: { + bitField0_ |= 0x00000002; + flexibleTypeCapabilitiesId_ = input.readInt32(); + break; + } + case 42: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = flexibleUpperBound_.toBuilder(); + } + flexibleUpperBound_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(flexibleUpperBound_); + flexibleUpperBound_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 48: { + bitField0_ |= 0x00000010; + className_ = input.readInt32(); + break; + } + case 56: { + bitField0_ |= 0x00000020; + typeParameter_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000008; + flexibleUpperBoundId_ = input.readInt32(); + break; + } + case 72: { + bitField0_ |= 0x00000040; + typeParameterName_ = input.readInt32(); + break; + } + case 82: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = outerType_.toBuilder(); + } + outerType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outerType_); + outerType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } + case 88: { + bitField0_ |= 0x00000200; + outerTypeId_ = input.readInt32(); + break; + } + case 96: { + bitField0_ |= 0x00000080; + typeAliasName_ = input.readInt32(); + break; + } + case 106: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000400) == 0x00000400)) { + subBuilder = abbreviatedType_.toBuilder(); + } + abbreviatedType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(abbreviatedType_); + abbreviatedType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000400; + break; + } + case 112: { + bitField0_ |= 0x00000800; + abbreviatedTypeId_ = input.readInt32(); + 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)) { + argument_ = java.util.Collections.unmodifiableList(argument_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Type parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Type(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface ArgumentOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Type.Argument) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; + */ + boolean hasProjection(); + /** + * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection getProjection(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+       * When projection is STAR, no type is written, otherwise type must be specified
+       * 
+ */ + boolean hasType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+       * When projection is STAR, no type is written, otherwise type must be specified
+       * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(); + + /** + * optional int32 type_id = 3; + */ + boolean hasTypeId(); + /** + * optional int32 type_id = 3; + */ + int getTypeId(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Type.Argument} + */ + public static final class Argument extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Type.Argument) + ArgumentOrBuilder { + // Use Argument.newBuilder() to construct. + private Argument(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Argument(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Argument defaultInstance; + public static Argument getDefaultInstance() { + return defaultInstance; + } + + public Argument getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Argument( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection value = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000001; + projection_ = value; + } + break; + } + case 18: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = type_.toBuilder(); + } + type_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(type_); + type_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 24: { + bitField0_ |= 0x00000004; + typeId_ = input.readInt32(); + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Argument parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Argument(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.Type.Argument.Projection} + */ + public enum Projection + implements com.google.protobuf.Internal.EnumLite { + /** + * IN = 0; + */ + IN(0, 0), + /** + * OUT = 1; + */ + OUT(1, 1), + /** + * INV = 2; + */ + INV(2, 2), + /** + * STAR = 3; + */ + STAR(3, 3), + ; + + /** + * IN = 0; + */ + public static final int IN_VALUE = 0; + /** + * OUT = 1; + */ + public static final int OUT_VALUE = 1; + /** + * INV = 2; + */ + public static final int INV_VALUE = 2; + /** + * STAR = 3; + */ + public static final int STAR_VALUE = 3; + + + public final int getNumber() { return value; } + + public static Projection valueOf(int value) { + switch (value) { + case 0: return IN; + case 1: return OUT; + case 2: return INV; + case 3: return STAR; + 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 Projection findValueByNumber(int number) { + return Projection.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Projection(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Type.Argument.Projection) + } + + private int bitField0_; + public static final int PROJECTION_FIELD_NUMBER = 1; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection projection_; + /** + * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; + */ + public boolean hasProjection() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection getProjection() { + return projection_; + } + + public static final int TYPE_FIELD_NUMBER = 2; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_; + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+       * When projection is STAR, no type is written, otherwise type must be specified
+       * 
+ */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+       * When projection is STAR, no type is written, otherwise type must be specified
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + return type_; + } + + public static final int TYPE_ID_FIELD_NUMBER = 3; + private int typeId_; + /** + * optional int32 type_id = 3; + */ + public boolean hasTypeId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 type_id = 3; + */ + public int getTypeId() { + return typeId_; + } + + private void initFields() { + projection_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.INV; + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + typeId_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (hasType()) { + if (!getType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, projection_.getNumber()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, type_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, typeId_); + } + output.writeRawBytes(unknownFields); + } + + 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 + .computeEnumSize(1, projection_.getNumber()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, type_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, typeId_); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.Type.Argument parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument 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.metadata.ProtoBuf.Type.Argument parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument 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.metadata.ProtoBuf.Type.Argument prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Type.Argument} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Type.Argument) + org.jetbrains.kotlin.metadata.ProtoBuf.Type.ArgumentOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + projection_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.INV; + bitField0_ = (bitField0_ & ~0x00000001); + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + typeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument result = new org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.projection_ = projection_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.typeId_ = typeId_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.getDefaultInstance()) return this; + if (other.hasProjection()) { + setProjection(other.getProjection()); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (other.hasTypeId()) { + setTypeId(other.getTypeId()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (hasType()) { + if (!getType().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection projection_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.INV; + /** + * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; + */ + public boolean hasProjection() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection getProjection() { + return projection_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; + */ + public Builder setProjection(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + projection_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; + */ + public Builder clearProjection() { + bitField0_ = (bitField0_ & ~0x00000001); + projection_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.INV; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+         * When projection is STAR, no type is written, otherwise type must be specified
+         * 
+ */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+         * When projection is STAR, no type is written, otherwise type must be specified
+         * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + return type_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+         * When projection is STAR, no type is written, otherwise type must be specified
+         * 
+ */ + public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+         * When projection is STAR, no type is written, otherwise type must be specified
+         * 
+ */ + public Builder setType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + type_ = builderForValue.build(); + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+         * When projection is STAR, no type is written, otherwise type must be specified
+         * 
+ */ + public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + type_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + type_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 2; + * + *
+         * When projection is STAR, no type is written, otherwise type must be specified
+         * 
+ */ + public Builder clearType() { + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + private int typeId_ ; + /** + * optional int32 type_id = 3; + */ + public boolean hasTypeId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 type_id = 3; + */ + public int getTypeId() { + return typeId_; + } + /** + * optional int32 type_id = 3; + */ + public Builder setTypeId(int value) { + bitField0_ |= 0x00000004; + typeId_ = value; + + return this; + } + /** + * optional int32 type_id = 3; + */ + public Builder clearTypeId() { + bitField0_ = (bitField0_ & ~0x00000004); + typeId_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Type.Argument) + } + + static { + defaultInstance = new Argument(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Type.Argument) + } + + private int bitField0_; + public static final int ARGUMENT_FIELD_NUMBER = 2; + private java.util.List argument_; + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public java.util.List getArgumentList() { + return argument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public java.util.List + getArgumentOrBuilderList() { + return argument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument getArgument(int index) { + return argument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type.ArgumentOrBuilder getArgumentOrBuilder( + int index) { + return argument_.get(index); + } + + public static final int NULLABLE_FIELD_NUMBER = 3; + private boolean nullable_; + /** + * optional bool nullable = 3 [default = false]; + */ + public boolean hasNullable() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional bool nullable = 3 [default = false]; + */ + public boolean getNullable() { + return nullable_; + } + + public static final int FLEXIBLE_TYPE_CAPABILITIES_ID_FIELD_NUMBER = 4; + private int flexibleTypeCapabilitiesId_; + /** + * optional int32 flexible_type_capabilities_id = 4; + * + *
+     * If this field is set, the type is flexible.
+     * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
+     * 
+ */ + public boolean hasFlexibleTypeCapabilitiesId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 flexible_type_capabilities_id = 4; + * + *
+     * If this field is set, the type is flexible.
+     * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
+     * 
+ */ + public int getFlexibleTypeCapabilitiesId() { + return flexibleTypeCapabilitiesId_; + } + + public static final int FLEXIBLE_UPPER_BOUND_FIELD_NUMBER = 5; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type flexibleUpperBound_; + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + public boolean hasFlexibleUpperBound() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getFlexibleUpperBound() { + return flexibleUpperBound_; + } + + public static final int FLEXIBLE_UPPER_BOUND_ID_FIELD_NUMBER = 8; + private int flexibleUpperBoundId_; + /** + * optional int32 flexible_upper_bound_id = 8; + */ + public boolean hasFlexibleUpperBoundId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 flexible_upper_bound_id = 8; + */ + public int getFlexibleUpperBoundId() { + return flexibleUpperBoundId_; + } + + public static final int CLASS_NAME_FIELD_NUMBER = 6; + private int className_; + /** + * optional int32 class_name = 6; + */ + public boolean hasClassName() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 class_name = 6; + */ + public int getClassName() { + return className_; + } + + public static final int TYPE_PARAMETER_FIELD_NUMBER = 7; + private int typeParameter_; + /** + * optional int32 type_parameter = 7; + * + *
+     * id of the type parameter
+     * 
+ */ + public boolean hasTypeParameter() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 type_parameter = 7; + * + *
+     * id of the type parameter
+     * 
+ */ + public int getTypeParameter() { + return typeParameter_; + } + + public static final int TYPE_PARAMETER_NAME_FIELD_NUMBER = 9; + private int typeParameterName_; + /** + * optional int32 type_parameter_name = 9; + * + *
+     * Name of the type parameter in the immediate owner
+     * 
+ */ + public boolean hasTypeParameterName() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 type_parameter_name = 9; + * + *
+     * Name of the type parameter in the immediate owner
+     * 
+ */ + public int getTypeParameterName() { + return typeParameterName_; + } + + public static final int TYPE_ALIAS_NAME_FIELD_NUMBER = 12; + private int typeAliasName_; + /** + * optional int32 type_alias_name = 12; + * + *
+     * Note that this may be present only for abbreviated_type
+     * Top level types are always fully expanded
+     * 
+ */ + public boolean hasTypeAliasName() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int32 type_alias_name = 12; + * + *
+     * Note that this may be present only for abbreviated_type
+     * Top level types are always fully expanded
+     * 
+ */ + public int getTypeAliasName() { + return typeAliasName_; + } + + public static final int OUTER_TYPE_FIELD_NUMBER = 10; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type outerType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+     * Outer type may be present only if class_name or type_alias_name is present
+     * 
+ */ + public boolean hasOuterType() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+     * Outer type may be present only if class_name or type_alias_name is present
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getOuterType() { + return outerType_; + } + + public static final int OUTER_TYPE_ID_FIELD_NUMBER = 11; + private int outerTypeId_; + /** + * optional int32 outer_type_id = 11; + */ + public boolean hasOuterTypeId() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional int32 outer_type_id = 11; + */ + public int getOuterTypeId() { + return outerTypeId_; + } + + public static final int ABBREVIATED_TYPE_FIELD_NUMBER = 13; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type abbreviatedType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + public boolean hasAbbreviatedType() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getAbbreviatedType() { + return abbreviatedType_; + } + + public static final int ABBREVIATED_TYPE_ID_FIELD_NUMBER = 14; + private int abbreviatedTypeId_; + /** + * optional int32 abbreviated_type_id = 14; + */ + public boolean hasAbbreviatedTypeId() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional int32 abbreviated_type_id = 14; + */ + public int getAbbreviatedTypeId() { + return abbreviatedTypeId_; + } + + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; + /** + * optional int32 flags = 1; + * + *
+     *suspend
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00001000) == 0x00001000); + } + /** + * optional int32 flags = 1; + * + *
+     *suspend
+     * 
+ */ + public int getFlags() { + return flags_; + } + + private void initFields() { + argument_ = java.util.Collections.emptyList(); + nullable_ = false; + flexibleTypeCapabilitiesId_ = 0; + flexibleUpperBound_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + flexibleUpperBoundId_ = 0; + className_ = 0; + typeParameter_ = 0; + typeParameterName_ = 0; + typeAliasName_ = 0; + outerType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + outerTypeId_ = 0; + abbreviatedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + abbreviatedTypeId_ = 0; + flags_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getArgumentCount(); i++) { + if (!getArgument(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasFlexibleUpperBound()) { + if (!getFlexibleUpperBound().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasOuterType()) { + if (!getOuterType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasAbbreviatedType()) { + if (!getAbbreviatedType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00001000) == 0x00001000)) { + output.writeInt32(1, flags_); + } + for (int i = 0; i < argument_.size(); i++) { + output.writeMessage(2, argument_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(3, nullable_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(4, flexibleTypeCapabilitiesId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(5, flexibleUpperBound_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(6, className_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(7, typeParameter_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(8, flexibleUpperBoundId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(9, typeParameterName_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeMessage(10, outerType_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeInt32(11, outerTypeId_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeInt32(12, typeAliasName_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeMessage(13, abbreviatedType_); + } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + output.writeInt32(14, abbreviatedTypeId_); + } + extensionWriter.writeUntil(200, output); + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00001000) == 0x00001000)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, flags_); + } + for (int i = 0; i < argument_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, argument_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, nullable_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, flexibleTypeCapabilitiesId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, flexibleUpperBound_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, className_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, typeParameter_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, flexibleUpperBoundId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, typeParameterName_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, outerType_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, outerTypeId_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(12, typeAliasName_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, abbreviatedType_); + } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(14, abbreviatedTypeId_); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.Type parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type 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.metadata.ProtoBuf.Type parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Type 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.metadata.ProtoBuf.Type prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Type} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.Type, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Type) + org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + argument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + nullable_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + flexibleTypeCapabilitiesId_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + flexibleUpperBound_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + flexibleUpperBoundId_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + className_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + typeParameter_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + typeParameterName_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + typeAliasName_ = 0; + bitField0_ = (bitField0_ & ~0x00000100); + outerType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000200); + outerTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000400); + abbreviatedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000800); + abbreviatedTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00001000); + flags_ = 0; + bitField0_ = (bitField0_ & ~0x00002000); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Type build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Type result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Type buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Type result = new org.jetbrains.kotlin.metadata.ProtoBuf.Type(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + argument_ = java.util.Collections.unmodifiableList(argument_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.argument_ = argument_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000001; + } + result.nullable_ = nullable_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.flexibleTypeCapabilitiesId_ = flexibleTypeCapabilitiesId_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.flexibleUpperBound_ = flexibleUpperBound_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + result.flexibleUpperBoundId_ = flexibleUpperBoundId_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000010; + } + result.className_ = className_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; + } + result.typeParameter_ = typeParameter_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000040; + } + result.typeParameterName_ = typeParameterName_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000080; + } + result.typeAliasName_ = typeAliasName_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000100; + } + result.outerType_ = outerType_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000200; + } + result.outerTypeId_ = outerTypeId_; + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000400; + } + result.abbreviatedType_ = abbreviatedType_; + if (((from_bitField0_ & 0x00001000) == 0x00001000)) { + to_bitField0_ |= 0x00000800; + } + result.abbreviatedTypeId_ = abbreviatedTypeId_; + if (((from_bitField0_ & 0x00002000) == 0x00002000)) { + to_bitField0_ |= 0x00001000; + } + result.flags_ = flags_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Type other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) return this; + if (!other.argument_.isEmpty()) { + if (argument_.isEmpty()) { + argument_ = other.argument_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureArgumentIsMutable(); + argument_.addAll(other.argument_); + } + + } + if (other.hasNullable()) { + setNullable(other.getNullable()); + } + if (other.hasFlexibleTypeCapabilitiesId()) { + setFlexibleTypeCapabilitiesId(other.getFlexibleTypeCapabilitiesId()); + } + if (other.hasFlexibleUpperBound()) { + mergeFlexibleUpperBound(other.getFlexibleUpperBound()); + } + if (other.hasFlexibleUpperBoundId()) { + setFlexibleUpperBoundId(other.getFlexibleUpperBoundId()); + } + if (other.hasClassName()) { + setClassName(other.getClassName()); + } + if (other.hasTypeParameter()) { + setTypeParameter(other.getTypeParameter()); + } + if (other.hasTypeParameterName()) { + setTypeParameterName(other.getTypeParameterName()); + } + if (other.hasTypeAliasName()) { + setTypeAliasName(other.getTypeAliasName()); + } + if (other.hasOuterType()) { + mergeOuterType(other.getOuterType()); + } + if (other.hasOuterTypeId()) { + setOuterTypeId(other.getOuterTypeId()); + } + if (other.hasAbbreviatedType()) { + mergeAbbreviatedType(other.getAbbreviatedType()); + } + if (other.hasAbbreviatedTypeId()) { + setAbbreviatedTypeId(other.getAbbreviatedTypeId()); + } + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getArgumentCount(); i++) { + if (!getArgument(i).isInitialized()) { + + return false; + } + } + if (hasFlexibleUpperBound()) { + if (!getFlexibleUpperBound().isInitialized()) { + + return false; + } + } + if (hasOuterType()) { + if (!getOuterType().isInitialized()) { + + return false; + } + } + if (hasAbbreviatedType()) { + if (!getAbbreviatedType().isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Type parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Type) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List argument_ = + java.util.Collections.emptyList(); + private void ensureArgumentIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + argument_ = new java.util.ArrayList(argument_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public java.util.List getArgumentList() { + return java.util.Collections.unmodifiableList(argument_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument getArgument(int index) { + return argument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder setArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder setArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder addArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder addArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder addArgument( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder addArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder addAllArgument( + java.lang.Iterable values) { + ensureArgumentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, argument_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder clearArgument() { + argument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; + */ + public Builder removeArgument(int index) { + ensureArgumentIsMutable(); + argument_.remove(index); + + return this; + } + + private boolean nullable_ ; + /** + * optional bool nullable = 3 [default = false]; + */ + public boolean hasNullable() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional bool nullable = 3 [default = false]; + */ + public boolean getNullable() { + return nullable_; + } + /** + * optional bool nullable = 3 [default = false]; + */ + public Builder setNullable(boolean value) { + bitField0_ |= 0x00000002; + nullable_ = value; + + return this; + } + /** + * optional bool nullable = 3 [default = false]; + */ + public Builder clearNullable() { + bitField0_ = (bitField0_ & ~0x00000002); + nullable_ = false; + + return this; + } + + private int flexibleTypeCapabilitiesId_ ; + /** + * optional int32 flexible_type_capabilities_id = 4; + * + *
+       * If this field is set, the type is flexible.
+       * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
+       * 
+ */ + public boolean hasFlexibleTypeCapabilitiesId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 flexible_type_capabilities_id = 4; + * + *
+       * If this field is set, the type is flexible.
+       * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
+       * 
+ */ + public int getFlexibleTypeCapabilitiesId() { + return flexibleTypeCapabilitiesId_; + } + /** + * optional int32 flexible_type_capabilities_id = 4; + * + *
+       * If this field is set, the type is flexible.
+       * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
+       * 
+ */ + public Builder setFlexibleTypeCapabilitiesId(int value) { + bitField0_ |= 0x00000004; + flexibleTypeCapabilitiesId_ = value; + + return this; + } + /** + * optional int32 flexible_type_capabilities_id = 4; + * + *
+       * If this field is set, the type is flexible.
+       * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
+       * 
+ */ + public Builder clearFlexibleTypeCapabilitiesId() { + bitField0_ = (bitField0_ & ~0x00000004); + flexibleTypeCapabilitiesId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type flexibleUpperBound_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + public boolean hasFlexibleUpperBound() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getFlexibleUpperBound() { + return flexibleUpperBound_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + public Builder setFlexibleUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + flexibleUpperBound_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + public Builder setFlexibleUpperBound( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + flexibleUpperBound_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + public Builder mergeFlexibleUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + flexibleUpperBound_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + flexibleUpperBound_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(flexibleUpperBound_).mergeFrom(value).buildPartial(); + } else { + flexibleUpperBound_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; + */ + public Builder clearFlexibleUpperBound() { + flexibleUpperBound_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + private int flexibleUpperBoundId_ ; + /** + * optional int32 flexible_upper_bound_id = 8; + */ + public boolean hasFlexibleUpperBoundId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 flexible_upper_bound_id = 8; + */ + public int getFlexibleUpperBoundId() { + return flexibleUpperBoundId_; + } + /** + * optional int32 flexible_upper_bound_id = 8; + */ + public Builder setFlexibleUpperBoundId(int value) { + bitField0_ |= 0x00000010; + flexibleUpperBoundId_ = value; + + return this; + } + /** + * optional int32 flexible_upper_bound_id = 8; + */ + public Builder clearFlexibleUpperBoundId() { + bitField0_ = (bitField0_ & ~0x00000010); + flexibleUpperBoundId_ = 0; + + return this; + } + + private int className_ ; + /** + * optional int32 class_name = 6; + */ + public boolean hasClassName() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 class_name = 6; + */ + public int getClassName() { + return className_; + } + /** + * optional int32 class_name = 6; + */ + public Builder setClassName(int value) { + bitField0_ |= 0x00000020; + className_ = value; + + return this; + } + /** + * optional int32 class_name = 6; + */ + public Builder clearClassName() { + bitField0_ = (bitField0_ & ~0x00000020); + className_ = 0; + + return this; + } + + private int typeParameter_ ; + /** + * optional int32 type_parameter = 7; + * + *
+       * id of the type parameter
+       * 
+ */ + public boolean hasTypeParameter() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 type_parameter = 7; + * + *
+       * id of the type parameter
+       * 
+ */ + public int getTypeParameter() { + return typeParameter_; + } + /** + * optional int32 type_parameter = 7; + * + *
+       * id of the type parameter
+       * 
+ */ + public Builder setTypeParameter(int value) { + bitField0_ |= 0x00000040; + typeParameter_ = value; + + return this; + } + /** + * optional int32 type_parameter = 7; + * + *
+       * id of the type parameter
+       * 
+ */ + public Builder clearTypeParameter() { + bitField0_ = (bitField0_ & ~0x00000040); + typeParameter_ = 0; + + return this; + } + + private int typeParameterName_ ; + /** + * optional int32 type_parameter_name = 9; + * + *
+       * Name of the type parameter in the immediate owner
+       * 
+ */ + public boolean hasTypeParameterName() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int32 type_parameter_name = 9; + * + *
+       * Name of the type parameter in the immediate owner
+       * 
+ */ + public int getTypeParameterName() { + return typeParameterName_; + } + /** + * optional int32 type_parameter_name = 9; + * + *
+       * Name of the type parameter in the immediate owner
+       * 
+ */ + public Builder setTypeParameterName(int value) { + bitField0_ |= 0x00000080; + typeParameterName_ = value; + + return this; + } + /** + * optional int32 type_parameter_name = 9; + * + *
+       * Name of the type parameter in the immediate owner
+       * 
+ */ + public Builder clearTypeParameterName() { + bitField0_ = (bitField0_ & ~0x00000080); + typeParameterName_ = 0; + + return this; + } + + private int typeAliasName_ ; + /** + * optional int32 type_alias_name = 12; + * + *
+       * Note that this may be present only for abbreviated_type
+       * Top level types are always fully expanded
+       * 
+ */ + public boolean hasTypeAliasName() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional int32 type_alias_name = 12; + * + *
+       * Note that this may be present only for abbreviated_type
+       * Top level types are always fully expanded
+       * 
+ */ + public int getTypeAliasName() { + return typeAliasName_; + } + /** + * optional int32 type_alias_name = 12; + * + *
+       * Note that this may be present only for abbreviated_type
+       * Top level types are always fully expanded
+       * 
+ */ + public Builder setTypeAliasName(int value) { + bitField0_ |= 0x00000100; + typeAliasName_ = value; + + return this; + } + /** + * optional int32 type_alias_name = 12; + * + *
+       * Note that this may be present only for abbreviated_type
+       * Top level types are always fully expanded
+       * 
+ */ + public Builder clearTypeAliasName() { + bitField0_ = (bitField0_ & ~0x00000100); + typeAliasName_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type outerType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+       * Outer type may be present only if class_name or type_alias_name is present
+       * 
+ */ + public boolean hasOuterType() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+       * Outer type may be present only if class_name or type_alias_name is present
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getOuterType() { + return outerType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+       * Outer type may be present only if class_name or type_alias_name is present
+       * 
+ */ + public Builder setOuterType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + outerType_ = value; + + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+       * Outer type may be present only if class_name or type_alias_name is present
+       * 
+ */ + public Builder setOuterType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + outerType_ = builderForValue.build(); + + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+       * Outer type may be present only if class_name or type_alias_name is present
+       * 
+ */ + public Builder mergeOuterType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000200) == 0x00000200) && + outerType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + outerType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(outerType_).mergeFrom(value).buildPartial(); + } else { + outerType_ = value; + } + + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; + * + *
+       * Outer type may be present only if class_name or type_alias_name is present
+       * 
+ */ + public Builder clearOuterType() { + outerType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + + private int outerTypeId_ ; + /** + * optional int32 outer_type_id = 11; + */ + public boolean hasOuterTypeId() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional int32 outer_type_id = 11; + */ + public int getOuterTypeId() { + return outerTypeId_; + } + /** + * optional int32 outer_type_id = 11; + */ + public Builder setOuterTypeId(int value) { + bitField0_ |= 0x00000400; + outerTypeId_ = value; + + return this; + } + /** + * optional int32 outer_type_id = 11; + */ + public Builder clearOuterTypeId() { + bitField0_ = (bitField0_ & ~0x00000400); + outerTypeId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type abbreviatedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + public boolean hasAbbreviatedType() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getAbbreviatedType() { + return abbreviatedType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + public Builder setAbbreviatedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + abbreviatedType_ = value; + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + public Builder setAbbreviatedType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + abbreviatedType_ = builderForValue.build(); + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + public Builder mergeAbbreviatedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000800) == 0x00000800) && + abbreviatedType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + abbreviatedType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(abbreviatedType_).mergeFrom(value).buildPartial(); + } else { + abbreviatedType_ = value; + } + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; + */ + public Builder clearAbbreviatedType() { + abbreviatedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + private int abbreviatedTypeId_ ; + /** + * optional int32 abbreviated_type_id = 14; + */ + public boolean hasAbbreviatedTypeId() { + return ((bitField0_ & 0x00001000) == 0x00001000); + } + /** + * optional int32 abbreviated_type_id = 14; + */ + public int getAbbreviatedTypeId() { + return abbreviatedTypeId_; + } + /** + * optional int32 abbreviated_type_id = 14; + */ + public Builder setAbbreviatedTypeId(int value) { + bitField0_ |= 0x00001000; + abbreviatedTypeId_ = value; + + return this; + } + /** + * optional int32 abbreviated_type_id = 14; + */ + public Builder clearAbbreviatedTypeId() { + bitField0_ = (bitField0_ & ~0x00001000); + abbreviatedTypeId_ = 0; + + return this; + } + + private int flags_ ; + /** + * optional int32 flags = 1; + * + *
+       *suspend
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00002000) == 0x00002000); + } + /** + * optional int32 flags = 1; + * + *
+       *suspend
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 1; + * + *
+       *suspend
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00002000; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 1; + * + *
+       *suspend
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00002000); + flags_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Type) + } + + static { + defaultInstance = new Type(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Type) + } + + public interface TypeParameterOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeParameter) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * required int32 id = 1; + */ + boolean hasId(); + /** + * required int32 id = 1; + */ + int getId(); + + /** + * required int32 name = 2; + */ + boolean hasName(); + /** + * required int32 name = 2; + */ + int getName(); + + /** + * optional bool reified = 3 [default = false]; + */ + boolean hasReified(); + /** + * optional bool reified = 3 [default = false]; + */ + boolean getReified(); + + /** + * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; + */ + boolean hasVariance(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance getVariance(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + java.util.List + getUpperBoundList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getUpperBound(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + int getUpperBoundCount(); + + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + java.util.List getUpperBoundIdList(); + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + int getUpperBoundIdCount(); + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + int getUpperBoundId(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeParameter} + */ + public static final class TypeParameter extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + TypeParameter> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeParameter) + TypeParameterOrBuilder { + // Use TypeParameter.newBuilder() to construct. + private TypeParameter(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private TypeParameter(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final TypeParameter defaultInstance; + public static TypeParameter getDefaultInstance() { + return defaultInstance; + } + + public TypeParameter getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private TypeParameter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + id_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + name_ = input.readInt32(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + reified_ = input.readBool(); + break; + } + case 32: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance value = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000008; + variance_ = value; + } + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + upperBound_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + upperBound_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); + break; + } + case 48: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + upperBoundId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + upperBoundId_.add(input.readInt32()); + break; + } + case 50: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) { + upperBoundId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + while (input.getBytesUntilLimit() > 0) { + upperBoundId_.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_ & 0x00000010) == 0x00000010)) { + upperBound_ = java.util.Collections.unmodifiableList(upperBound_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + upperBoundId_ = java.util.Collections.unmodifiableList(upperBoundId_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TypeParameter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TypeParameter(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.TypeParameter.Variance} + */ + public enum Variance + implements com.google.protobuf.Internal.EnumLite { + /** + * IN = 0; + */ + IN(0, 0), + /** + * OUT = 1; + */ + OUT(1, 1), + /** + * INV = 2; + */ + INV(2, 2), + ; + + /** + * IN = 0; + */ + public static final int IN_VALUE = 0; + /** + * OUT = 1; + */ + public static final int OUT_VALUE = 1; + /** + * INV = 2; + */ + public static final int INV_VALUE = 2; + + + public final int getNumber() { return value; } + + public static Variance valueOf(int value) { + switch (value) { + case 0: return IN; + case 1: return OUT; + case 2: return INV; + 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 Variance findValueByNumber(int number) { + return Variance.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Variance(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.TypeParameter.Variance) + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private int id_; + /** + * required int32 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 id = 1; + */ + public int getId() { + return id_; + } + + public static final int NAME_FIELD_NUMBER = 2; + private int name_; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + + public static final int REIFIED_FIELD_NUMBER = 3; + private boolean reified_; + /** + * optional bool reified = 3 [default = false]; + */ + public boolean hasReified() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bool reified = 3 [default = false]; + */ + public boolean getReified() { + return reified_; + } + + public static final int VARIANCE_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance variance_; + /** + * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; + */ + public boolean hasVariance() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance getVariance() { + return variance_; + } + + public static final int UPPER_BOUND_FIELD_NUMBER = 5; + private java.util.List upperBound_; + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public java.util.List getUpperBoundList() { + return upperBound_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public java.util.List + getUpperBoundOrBuilderList() { + return upperBound_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public int getUpperBoundCount() { + return upperBound_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUpperBound(int index) { + return upperBound_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getUpperBoundOrBuilder( + int index) { + return upperBound_.get(index); + } + + public static final int UPPER_BOUND_ID_FIELD_NUMBER = 6; + private java.util.List upperBoundId_; + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public java.util.List + getUpperBoundIdList() { + return upperBoundId_; + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public int getUpperBoundIdCount() { + return upperBoundId_.size(); + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public int getUpperBoundId(int index) { + return upperBoundId_.get(index); + } + private int upperBoundIdMemoizedSerializedSize = -1; + + private void initFields() { + id_ = 0; + name_ = 0; + reified_ = false; + variance_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.INV; + upperBound_ = java.util.Collections.emptyList(); + upperBoundId_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getUpperBoundCount(); i++) { + if (!getUpperBound(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, name_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, reified_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeEnum(4, variance_.getNumber()); + } + for (int i = 0; i < upperBound_.size(); i++) { + output.writeMessage(5, upperBound_.get(i)); + } + if (getUpperBoundIdList().size() > 0) { + output.writeRawVarint32(50); + output.writeRawVarint32(upperBoundIdMemoizedSerializedSize); + } + for (int i = 0; i < upperBoundId_.size(); i++) { + output.writeInt32NoTag(upperBoundId_.get(i)); + } + extensionWriter.writeUntil(1000, output); + output.writeRawBytes(unknownFields); + } + + 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, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, name_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, reified_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, variance_.getNumber()); + } + for (int i = 0; i < upperBound_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, upperBound_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < upperBoundId_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(upperBoundId_.get(i)); + } + size += dataSize; + if (!getUpperBoundIdList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + upperBoundIdMemoizedSerializedSize = dataSize; + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.TypeParameter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter 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.metadata.ProtoBuf.TypeParameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter 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.metadata.ProtoBuf.TypeParameter prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeParameter} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeParameter) + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + id_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + reified_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + variance_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.INV; + bitField0_ = (bitField0_ & ~0x00000008); + upperBound_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + upperBoundId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter build() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.reified_ = reified_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.variance_ = variance_; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + upperBound_ = java.util.Collections.unmodifiableList(upperBound_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.upperBound_ = upperBound_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + upperBoundId_ = java.util.Collections.unmodifiableList(upperBoundId_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.upperBoundId_ = upperBoundId_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasName()) { + setName(other.getName()); + } + if (other.hasReified()) { + setReified(other.getReified()); + } + if (other.hasVariance()) { + setVariance(other.getVariance()); + } + if (!other.upperBound_.isEmpty()) { + if (upperBound_.isEmpty()) { + upperBound_ = other.upperBound_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureUpperBoundIsMutable(); + upperBound_.addAll(other.upperBound_); + } + + } + if (!other.upperBoundId_.isEmpty()) { + if (upperBoundId_.isEmpty()) { + upperBoundId_ = other.upperBoundId_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureUpperBoundIdIsMutable(); + upperBoundId_.addAll(other.upperBoundId_); + } + + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + + return false; + } + if (!hasName()) { + + return false; + } + for (int i = 0; i < getUpperBoundCount(); i++) { + if (!getUpperBound(i).isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int id_ ; + /** + * required int32 id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 id = 1; + */ + public int getId() { + return id_; + } + /** + * required int32 id = 1; + */ + public Builder setId(int value) { + bitField0_ |= 0x00000001; + id_ = value; + + return this; + } + /** + * required int32 id = 1; + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0; + + return this; + } + + private int name_ ; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + /** + * required int32 name = 2; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000002; + name_ = value; + + return this; + } + /** + * required int32 name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = 0; + + return this; + } + + private boolean reified_ ; + /** + * optional bool reified = 3 [default = false]; + */ + public boolean hasReified() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bool reified = 3 [default = false]; + */ + public boolean getReified() { + return reified_; + } + /** + * optional bool reified = 3 [default = false]; + */ + public Builder setReified(boolean value) { + bitField0_ |= 0x00000004; + reified_ = value; + + return this; + } + /** + * optional bool reified = 3 [default = false]; + */ + public Builder clearReified() { + bitField0_ = (bitField0_ & ~0x00000004); + reified_ = false; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance variance_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.INV; + /** + * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; + */ + public boolean hasVariance() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance getVariance() { + return variance_; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; + */ + public Builder setVariance(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + variance_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; + */ + public Builder clearVariance() { + bitField0_ = (bitField0_ & ~0x00000008); + variance_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.INV; + + return this; + } + + private java.util.List upperBound_ = + java.util.Collections.emptyList(); + private void ensureUpperBoundIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + upperBound_ = new java.util.ArrayList(upperBound_); + bitField0_ |= 0x00000010; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public java.util.List getUpperBoundList() { + return java.util.Collections.unmodifiableList(upperBound_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public int getUpperBoundCount() { + return upperBound_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUpperBound(int index) { + return upperBound_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder setUpperBound( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpperBoundIsMutable(); + upperBound_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder setUpperBound( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureUpperBoundIsMutable(); + upperBound_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder addUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpperBoundIsMutable(); + upperBound_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder addUpperBound( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpperBoundIsMutable(); + upperBound_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder addUpperBound( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureUpperBoundIsMutable(); + upperBound_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder addUpperBound( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureUpperBoundIsMutable(); + upperBound_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder addAllUpperBound( + java.lang.Iterable values) { + ensureUpperBoundIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, upperBound_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder clearUpperBound() { + upperBound_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; + */ + public Builder removeUpperBound(int index) { + ensureUpperBoundIsMutable(); + upperBound_.remove(index); + + return this; + } + + private java.util.List upperBoundId_ = java.util.Collections.emptyList(); + private void ensureUpperBoundIdIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + upperBoundId_ = new java.util.ArrayList(upperBoundId_); + bitField0_ |= 0x00000020; + } + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public java.util.List + getUpperBoundIdList() { + return java.util.Collections.unmodifiableList(upperBoundId_); + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public int getUpperBoundIdCount() { + return upperBoundId_.size(); + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public int getUpperBoundId(int index) { + return upperBoundId_.get(index); + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public Builder setUpperBoundId( + int index, int value) { + ensureUpperBoundIdIsMutable(); + upperBoundId_.set(index, value); + + return this; + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public Builder addUpperBoundId(int value) { + ensureUpperBoundIdIsMutable(); + upperBoundId_.add(value); + + return this; + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public Builder addAllUpperBoundId( + java.lang.Iterable values) { + ensureUpperBoundIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, upperBoundId_); + + return this; + } + /** + * repeated int32 upper_bound_id = 6 [packed = true]; + */ + public Builder clearUpperBoundId() { + upperBoundId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeParameter) + } + + static { + defaultInstance = new TypeParameter(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeParameter) + } + + public interface ClassOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Class) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *ClassKind
+     *isInner
+     *isData
+     *isExternal
+     *isExpect
+     *isInline
+     *isFun
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *ClassKind
+     *isInner
+     *isData
+     *isExternal
+     *isExpect
+     *isInline
+     *isFun
+     * 
+ */ + int getFlags(); + + /** + * required int32 fq_name = 3; + */ + boolean hasFqName(); + /** + * required int32 fq_name = 3; + */ + int getFqName(); + + /** + * optional int32 companion_object_name = 4; + */ + boolean hasCompanionObjectName(); + /** + * optional int32 companion_object_name = 4; + */ + int getCompanionObjectName(); + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + java.util.List + getTypeParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + int getTypeParameterCount(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + java.util.List + getSupertypeList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getSupertype(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + int getSupertypeCount(); + + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + java.util.List getSupertypeIdList(); + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + int getSupertypeIdCount(); + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + int getSupertypeId(int index); + + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + java.util.List getNestedClassNameList(); + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + int getNestedClassNameCount(); + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + int getNestedClassName(int index); + + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + java.util.List + getConstructorList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getConstructor(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + int getConstructorCount(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + java.util.List + getFunctionList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + int getFunctionCount(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + java.util.List + getPropertyList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + int getPropertyCount(); + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + java.util.List + getTypeAliasList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + int getTypeAliasCount(); + + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + java.util.List + getEnumEntryList(); + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getEnumEntry(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + int getEnumEntryCount(); + + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + java.util.List getSealedSubclassFqNameList(); + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + int getSealedSubclassFqNameCount(); + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + int getSealedSubclassFqName(int index); + + /** + * optional int32 inline_class_underlying_property_name = 17; + */ + boolean hasInlineClassUnderlyingPropertyName(); + /** + * optional int32 inline_class_underlying_property_name = 17; + */ + int getInlineClassUnderlyingPropertyName(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + boolean hasInlineClassUnderlyingType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getInlineClassUnderlyingType(); + + /** + * optional int32 inline_class_underlying_type_id = 19; + */ + boolean hasInlineClassUnderlyingTypeId(); + /** + * optional int32 inline_class_underlying_type_id = 19; + */ + int getInlineClassUnderlyingTypeId(); + + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + boolean hasTypeTable(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable(); + + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + java.util.List getVersionRequirementList(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirementCount(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirement(int index); + + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + boolean hasVersionRequirementTable(); + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Class} + */ + public static final class Class extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Class> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Class) + ClassOrBuilder { + // Use Class.newBuilder() to construct. + private Class(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Class(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Class defaultInstance; + public static Class getDefaultInstance() { + return defaultInstance; + } + + public Class getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Class( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 16: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + supertypeId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + supertypeId_.add(input.readInt32()); + break; + } + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) { + supertypeId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + while (input.getBytesUntilLimit() > 0) { + supertypeId_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 24: { + bitField0_ |= 0x00000002; + fqName_ = input.readInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000004; + companionObjectName_ = input.readInt32(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + typeParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + supertype_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + supertype_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); + break; + } + case 56: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + nestedClassName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + nestedClassName_.add(input.readInt32()); + break; + } + case 58: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040) && input.getBytesUntilLimit() > 0) { + nestedClassName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + while (input.getBytesUntilLimit() > 0) { + nestedClassName_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + constructor_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + constructor_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.PARSER, extensionRegistry)); + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + function_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + function_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Function.PARSER, extensionRegistry)); + break; + } + case 82: { + if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { + property_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000200; + } + property_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Property.PARSER, extensionRegistry)); + break; + } + case 90: { + if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { + typeAlias_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000400; + } + typeAlias_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.PARSER, extensionRegistry)); + break; + } + case 106: { + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + enumEntry_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + enumEntry_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.PARSER, extensionRegistry)); + break; + } + case 128: { + if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) { + sealedSubclassFqName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00001000; + } + sealedSubclassFqName_.add(input.readInt32()); + break; + } + case 130: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00001000) == 0x00001000) && input.getBytesUntilLimit() > 0) { + sealedSubclassFqName_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00001000; + } + while (input.getBytesUntilLimit() > 0) { + sealedSubclassFqName_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 136: { + bitField0_ |= 0x00000008; + inlineClassUnderlyingPropertyName_ = input.readInt32(); + break; + } + case 146: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = inlineClassUnderlyingType_.toBuilder(); + } + inlineClassUnderlyingType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(inlineClassUnderlyingType_); + inlineClassUnderlyingType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 152: { + bitField0_ |= 0x00000020; + inlineClassUnderlyingTypeId_ = input.readInt32(); + break; + } + case 242: { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + subBuilder = typeTable_.toBuilder(); + } + typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(typeTable_); + typeTable_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000040; + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00020000) == 0x00020000)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00020000; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00020000) == 0x00020000) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00020000; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 258: { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = versionRequirementTable_.toBuilder(); + } + versionRequirementTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(versionRequirementTable_); + versionRequirementTable_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + 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_ & 0x00000020) == 0x00000020)) { + supertypeId_ = java.util.Collections.unmodifiableList(supertypeId_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + supertype_ = java.util.Collections.unmodifiableList(supertype_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + nestedClassName_ = java.util.Collections.unmodifiableList(nestedClassName_); + } + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + constructor_ = java.util.Collections.unmodifiableList(constructor_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + function_ = java.util.Collections.unmodifiableList(function_); + } + if (((mutable_bitField0_ & 0x00000200) == 0x00000200)) { + property_ = java.util.Collections.unmodifiableList(property_); + } + if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) { + typeAlias_ = java.util.Collections.unmodifiableList(typeAlias_); + } + if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); + } + if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) { + sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_); + } + if (((mutable_bitField0_ & 0x00020000) == 0x00020000)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Class parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Class(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.Class.Kind} + */ + public enum Kind + implements com.google.protobuf.Internal.EnumLite { + /** + * CLASS = 0; + * + *
+       * 3 bits
+       * 
+ */ + CLASS(0, 0), + /** + * INTERFACE = 1; + */ + INTERFACE(1, 1), + /** + * ENUM_CLASS = 2; + */ + ENUM_CLASS(2, 2), + /** + * ENUM_ENTRY = 3; + */ + ENUM_ENTRY(3, 3), + /** + * ANNOTATION_CLASS = 4; + */ + ANNOTATION_CLASS(4, 4), + /** + * OBJECT = 5; + */ + OBJECT(5, 5), + /** + * COMPANION_OBJECT = 6; + */ + COMPANION_OBJECT(6, 6), + ; + + /** + * CLASS = 0; + * + *
+       * 3 bits
+       * 
+ */ + public static final int CLASS_VALUE = 0; + /** + * INTERFACE = 1; + */ + public static final int INTERFACE_VALUE = 1; + /** + * ENUM_CLASS = 2; + */ + public static final int ENUM_CLASS_VALUE = 2; + /** + * ENUM_ENTRY = 3; + */ + public static final int ENUM_ENTRY_VALUE = 3; + /** + * ANNOTATION_CLASS = 4; + */ + public static final int ANNOTATION_CLASS_VALUE = 4; + /** + * OBJECT = 5; + */ + public static final int OBJECT_VALUE = 5; + /** + * COMPANION_OBJECT = 6; + */ + public static final int COMPANION_OBJECT_VALUE = 6; + + + public final int getNumber() { return value; } + + public static Kind valueOf(int value) { + switch (value) { + case 0: return CLASS; + case 1: return INTERFACE; + case 2: return ENUM_CLASS; + case 3: return ENUM_ENTRY; + case 4: return ANNOTATION_CLASS; + case 5: return OBJECT; + case 6: return COMPANION_OBJECT; + 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 Kind findValueByNumber(int number) { + return Kind.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Kind(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Class.Kind) + } + + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *ClassKind
+     *isInner
+     *isData
+     *isExternal
+     *isExpect
+     *isInline
+     *isFun
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *ClassKind
+     *isInner
+     *isData
+     *isExternal
+     *isExpect
+     *isInline
+     *isFun
+     * 
+ */ + public int getFlags() { + return flags_; + } + + public static final int FQ_NAME_FIELD_NUMBER = 3; + private int fqName_; + /** + * required int32 fq_name = 3; + */ + public boolean hasFqName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 fq_name = 3; + */ + public int getFqName() { + return fqName_; + } + + public static final int COMPANION_OBJECT_NAME_FIELD_NUMBER = 4; + private int companionObjectName_; + /** + * optional int32 companion_object_name = 4; + */ + public boolean hasCompanionObjectName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 companion_object_name = 4; + */ + public int getCompanionObjectName() { + return companionObjectName_; + } + + public static final int TYPE_PARAMETER_FIELD_NUMBER = 5; + private java.util.List typeParameter_; + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public java.util.List getTypeParameterList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public java.util.List + getTypeParameterOrBuilderList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + int index) { + return typeParameter_.get(index); + } + + public static final int SUPERTYPE_FIELD_NUMBER = 6; + private java.util.List supertype_; + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public java.util.List getSupertypeList() { + return supertype_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public java.util.List + getSupertypeOrBuilderList() { + return supertype_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public int getSupertypeCount() { + return supertype_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getSupertype(int index) { + return supertype_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getSupertypeOrBuilder( + int index) { + return supertype_.get(index); + } + + public static final int SUPERTYPE_ID_FIELD_NUMBER = 2; + private java.util.List supertypeId_; + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public java.util.List + getSupertypeIdList() { + return supertypeId_; + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public int getSupertypeIdCount() { + return supertypeId_.size(); + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public int getSupertypeId(int index) { + return supertypeId_.get(index); + } + private int supertypeIdMemoizedSerializedSize = -1; + + public static final int NESTED_CLASS_NAME_FIELD_NUMBER = 7; + private java.util.List nestedClassName_; + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public java.util.List + getNestedClassNameList() { + return nestedClassName_; + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public int getNestedClassNameCount() { + return nestedClassName_.size(); + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public int getNestedClassName(int index) { + return nestedClassName_.get(index); + } + private int nestedClassNameMemoizedSerializedSize = -1; + + public static final int CONSTRUCTOR_FIELD_NUMBER = 8; + private java.util.List constructor_; + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public java.util.List getConstructorList() { + return constructor_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public java.util.List + getConstructorOrBuilderList() { + return constructor_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public int getConstructorCount() { + return constructor_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getConstructor(int index) { + return constructor_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ConstructorOrBuilder getConstructorOrBuilder( + int index) { + return constructor_.get(index); + } + + public static final int FUNCTION_FIELD_NUMBER = 9; + private java.util.List function_; + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public java.util.List getFunctionList() { + return function_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public java.util.List + getFunctionOrBuilderList() { + return function_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public int getFunctionCount() { + return function_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index) { + return function_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.FunctionOrBuilder getFunctionOrBuilder( + int index) { + return function_.get(index); + } + + public static final int PROPERTY_FIELD_NUMBER = 10; + private java.util.List property_; + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public java.util.List getPropertyList() { + return property_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public java.util.List + getPropertyOrBuilderList() { + return property_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public int getPropertyCount() { + return property_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index) { + return property_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.PropertyOrBuilder getPropertyOrBuilder( + int index) { + return property_.get(index); + } + + public static final int TYPE_ALIAS_FIELD_NUMBER = 11; + private java.util.List typeAlias_; + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public java.util.List getTypeAliasList() { + return typeAlias_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public java.util.List + getTypeAliasOrBuilderList() { + return typeAlias_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public int getTypeAliasCount() { + return typeAlias_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index) { + return typeAlias_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAliasOrBuilder getTypeAliasOrBuilder( + int index) { + return typeAlias_.get(index); + } + + public static final int ENUM_ENTRY_FIELD_NUMBER = 13; + private java.util.List enumEntry_; + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public java.util.List getEnumEntryList() { + return enumEntry_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public java.util.List + getEnumEntryOrBuilderList() { + return enumEntry_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public int getEnumEntryCount() { + return enumEntry_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getEnumEntry(int index) { + return enumEntry_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntryOrBuilder getEnumEntryOrBuilder( + int index) { + return enumEntry_.get(index); + } + + public static final int SEALED_SUBCLASS_FQ_NAME_FIELD_NUMBER = 16; + private java.util.List sealedSubclassFqName_; + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public java.util.List + getSealedSubclassFqNameList() { + return sealedSubclassFqName_; + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public int getSealedSubclassFqNameCount() { + return sealedSubclassFqName_.size(); + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public int getSealedSubclassFqName(int index) { + return sealedSubclassFqName_.get(index); + } + private int sealedSubclassFqNameMemoizedSerializedSize = -1; + + public static final int INLINE_CLASS_UNDERLYING_PROPERTY_NAME_FIELD_NUMBER = 17; + private int inlineClassUnderlyingPropertyName_; + /** + * optional int32 inline_class_underlying_property_name = 17; + */ + public boolean hasInlineClassUnderlyingPropertyName() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 inline_class_underlying_property_name = 17; + */ + public int getInlineClassUnderlyingPropertyName() { + return inlineClassUnderlyingPropertyName_; + } + + public static final int INLINE_CLASS_UNDERLYING_TYPE_FIELD_NUMBER = 18; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type inlineClassUnderlyingType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + public boolean hasInlineClassUnderlyingType() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getInlineClassUnderlyingType() { + return inlineClassUnderlyingType_; + } + + public static final int INLINE_CLASS_UNDERLYING_TYPE_ID_FIELD_NUMBER = 19; + private int inlineClassUnderlyingTypeId_; + /** + * optional int32 inline_class_underlying_type_id = 19; + */ + public boolean hasInlineClassUnderlyingTypeId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 inline_class_underlying_type_id = 19; + */ + public int getInlineClassUnderlyingTypeId() { + return inlineClassUnderlyingTypeId_; + } + + public static final int TYPE_TABLE_FIELD_NUMBER = 30; + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public boolean hasTypeTable() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + return typeTable_; + } + + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public java.util.List + getVersionRequirementList() { + return versionRequirement_; + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + + public static final int VERSION_REQUIREMENT_TABLE_FIELD_NUMBER = 32; + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable versionRequirementTable_; + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public boolean hasVersionRequirementTable() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable() { + return versionRequirementTable_; + } + + private void initFields() { + flags_ = 6; + fqName_ = 0; + companionObjectName_ = 0; + typeParameter_ = java.util.Collections.emptyList(); + supertype_ = java.util.Collections.emptyList(); + supertypeId_ = java.util.Collections.emptyList(); + nestedClassName_ = java.util.Collections.emptyList(); + constructor_ = java.util.Collections.emptyList(); + function_ = java.util.Collections.emptyList(); + property_ = java.util.Collections.emptyList(); + typeAlias_ = java.util.Collections.emptyList(); + enumEntry_ = java.util.Collections.emptyList(); + sealedSubclassFqName_ = java.util.Collections.emptyList(); + inlineClassUnderlyingPropertyName_ = 0; + inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + inlineClassUnderlyingTypeId_ = 0; + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + versionRequirement_ = java.util.Collections.emptyList(); + versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasFqName()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getSupertypeCount(); i++) { + if (!getSupertype(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getConstructorCount(); i++) { + if (!getConstructor(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getFunctionCount(); i++) { + if (!getFunction(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getPropertyCount(); i++) { + if (!getProperty(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getTypeAliasCount(); i++) { + if (!getTypeAlias(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getEnumEntryCount(); i++) { + if (!getEnumEntry(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasInlineClassUnderlyingType()) { + if (!getInlineClassUnderlyingType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTypeTable()) { + if (!getTypeTable().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, flags_); + } + if (getSupertypeIdList().size() > 0) { + output.writeRawVarint32(18); + output.writeRawVarint32(supertypeIdMemoizedSerializedSize); + } + for (int i = 0; i < supertypeId_.size(); i++) { + output.writeInt32NoTag(supertypeId_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(3, fqName_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(4, companionObjectName_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + output.writeMessage(5, typeParameter_.get(i)); + } + for (int i = 0; i < supertype_.size(); i++) { + output.writeMessage(6, supertype_.get(i)); + } + if (getNestedClassNameList().size() > 0) { + output.writeRawVarint32(58); + output.writeRawVarint32(nestedClassNameMemoizedSerializedSize); + } + for (int i = 0; i < nestedClassName_.size(); i++) { + output.writeInt32NoTag(nestedClassName_.get(i)); + } + for (int i = 0; i < constructor_.size(); i++) { + output.writeMessage(8, constructor_.get(i)); + } + for (int i = 0; i < function_.size(); i++) { + output.writeMessage(9, function_.get(i)); + } + for (int i = 0; i < property_.size(); i++) { + output.writeMessage(10, property_.get(i)); + } + for (int i = 0; i < typeAlias_.size(); i++) { + output.writeMessage(11, typeAlias_.get(i)); + } + for (int i = 0; i < enumEntry_.size(); i++) { + output.writeMessage(13, enumEntry_.get(i)); + } + if (getSealedSubclassFqNameList().size() > 0) { + output.writeRawVarint32(130); + output.writeRawVarint32(sealedSubclassFqNameMemoizedSerializedSize); + } + for (int i = 0; i < sealedSubclassFqName_.size(); i++) { + output.writeInt32NoTag(sealedSubclassFqName_.get(i)); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(17, inlineClassUnderlyingPropertyName_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(18, inlineClassUnderlyingType_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(19, inlineClassUnderlyingTypeId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeMessage(30, typeTable_); + } + for (int i = 0; i < versionRequirement_.size(); i++) { + output.writeInt32(31, versionRequirement_.get(i)); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeMessage(32, versionRequirementTable_); + } + extensionWriter.writeUntil(19000, output); + output.writeRawBytes(unknownFields); + } + + 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, flags_); + } + { + int dataSize = 0; + for (int i = 0; i < supertypeId_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(supertypeId_.get(i)); + } + size += dataSize; + if (!getSupertypeIdList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + supertypeIdMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, fqName_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, companionObjectName_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, typeParameter_.get(i)); + } + for (int i = 0; i < supertype_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, supertype_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < nestedClassName_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(nestedClassName_.get(i)); + } + size += dataSize; + if (!getNestedClassNameList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + nestedClassNameMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < constructor_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, constructor_.get(i)); + } + for (int i = 0; i < function_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, function_.get(i)); + } + for (int i = 0; i < property_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, property_.get(i)); + } + for (int i = 0; i < typeAlias_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, typeAlias_.get(i)); + } + for (int i = 0; i < enumEntry_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, enumEntry_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < sealedSubclassFqName_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(sealedSubclassFqName_.get(i)); + } + size += dataSize; + if (!getSealedSubclassFqNameList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + sealedSubclassFqNameMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(17, inlineClassUnderlyingPropertyName_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(18, inlineClassUnderlyingType_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(19, inlineClassUnderlyingTypeId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(30, typeTable_); + } + { + int dataSize = 0; + for (int i = 0; i < versionRequirement_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(versionRequirement_.get(i)); + } + size += dataSize; + size += 2 * getVersionRequirementList().size(); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(32, versionRequirementTable_); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.Class parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Class 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.metadata.ProtoBuf.Class parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Class 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.metadata.ProtoBuf.Class prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Class} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.Class, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Class) + org.jetbrains.kotlin.metadata.ProtoBuf.ClassOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Class.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + flags_ = 6; + bitField0_ = (bitField0_ & ~0x00000001); + fqName_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + companionObjectName_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + supertype_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + supertypeId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + nestedClassName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + constructor_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + function_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + property_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + typeAlias_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + enumEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + sealedSubclassFqName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + inlineClassUnderlyingPropertyName_ = 0; + bitField0_ = (bitField0_ & ~0x00002000); + inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00004000); + inlineClassUnderlyingTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00008000); + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00010000); + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00020000); + versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00040000); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Class getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Class build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Class result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Class buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Class result = new org.jetbrains.kotlin.metadata.ProtoBuf.Class(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.fqName_ = fqName_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.companionObjectName_ = companionObjectName_; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.typeParameter_ = typeParameter_; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + supertype_ = java.util.Collections.unmodifiableList(supertype_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.supertype_ = supertype_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + supertypeId_ = java.util.Collections.unmodifiableList(supertypeId_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.supertypeId_ = supertypeId_; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + nestedClassName_ = java.util.Collections.unmodifiableList(nestedClassName_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.nestedClassName_ = nestedClassName_; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + constructor_ = java.util.Collections.unmodifiableList(constructor_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.constructor_ = constructor_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + function_ = java.util.Collections.unmodifiableList(function_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.function_ = function_; + if (((bitField0_ & 0x00000200) == 0x00000200)) { + property_ = java.util.Collections.unmodifiableList(property_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.property_ = property_; + if (((bitField0_ & 0x00000400) == 0x00000400)) { + typeAlias_ = java.util.Collections.unmodifiableList(typeAlias_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.typeAlias_ = typeAlias_; + if (((bitField0_ & 0x00000800) == 0x00000800)) { + enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.enumEntry_ = enumEntry_; + if (((bitField0_ & 0x00001000) == 0x00001000)) { + sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.sealedSubclassFqName_ = sealedSubclassFqName_; + if (((from_bitField0_ & 0x00002000) == 0x00002000)) { + to_bitField0_ |= 0x00000008; + } + result.inlineClassUnderlyingPropertyName_ = inlineClassUnderlyingPropertyName_; + if (((from_bitField0_ & 0x00004000) == 0x00004000)) { + to_bitField0_ |= 0x00000010; + } + result.inlineClassUnderlyingType_ = inlineClassUnderlyingType_; + if (((from_bitField0_ & 0x00008000) == 0x00008000)) { + to_bitField0_ |= 0x00000020; + } + result.inlineClassUnderlyingTypeId_ = inlineClassUnderlyingTypeId_; + if (((from_bitField0_ & 0x00010000) == 0x00010000)) { + to_bitField0_ |= 0x00000040; + } + result.typeTable_ = typeTable_; + if (((bitField0_ & 0x00020000) == 0x00020000)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00020000); + } + result.versionRequirement_ = versionRequirement_; + if (((from_bitField0_ & 0x00040000) == 0x00040000)) { + to_bitField0_ |= 0x00000080; + } + result.versionRequirementTable_ = versionRequirementTable_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Class other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasFqName()) { + setFqName(other.getFqName()); + } + if (other.hasCompanionObjectName()) { + setCompanionObjectName(other.getCompanionObjectName()); + } + if (!other.typeParameter_.isEmpty()) { + if (typeParameter_.isEmpty()) { + typeParameter_ = other.typeParameter_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureTypeParameterIsMutable(); + typeParameter_.addAll(other.typeParameter_); + } + + } + if (!other.supertype_.isEmpty()) { + if (supertype_.isEmpty()) { + supertype_ = other.supertype_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureSupertypeIsMutable(); + supertype_.addAll(other.supertype_); + } + + } + if (!other.supertypeId_.isEmpty()) { + if (supertypeId_.isEmpty()) { + supertypeId_ = other.supertypeId_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureSupertypeIdIsMutable(); + supertypeId_.addAll(other.supertypeId_); + } + + } + if (!other.nestedClassName_.isEmpty()) { + if (nestedClassName_.isEmpty()) { + nestedClassName_ = other.nestedClassName_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureNestedClassNameIsMutable(); + nestedClassName_.addAll(other.nestedClassName_); + } + + } + if (!other.constructor_.isEmpty()) { + if (constructor_.isEmpty()) { + constructor_ = other.constructor_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureConstructorIsMutable(); + constructor_.addAll(other.constructor_); + } + + } + if (!other.function_.isEmpty()) { + if (function_.isEmpty()) { + function_ = other.function_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureFunctionIsMutable(); + function_.addAll(other.function_); + } + + } + if (!other.property_.isEmpty()) { + if (property_.isEmpty()) { + property_ = other.property_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensurePropertyIsMutable(); + property_.addAll(other.property_); + } + + } + if (!other.typeAlias_.isEmpty()) { + if (typeAlias_.isEmpty()) { + typeAlias_ = other.typeAlias_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureTypeAliasIsMutable(); + typeAlias_.addAll(other.typeAlias_); + } + + } + if (!other.enumEntry_.isEmpty()) { + if (enumEntry_.isEmpty()) { + enumEntry_ = other.enumEntry_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureEnumEntryIsMutable(); + enumEntry_.addAll(other.enumEntry_); + } + + } + if (!other.sealedSubclassFqName_.isEmpty()) { + if (sealedSubclassFqName_.isEmpty()) { + sealedSubclassFqName_ = other.sealedSubclassFqName_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureSealedSubclassFqNameIsMutable(); + sealedSubclassFqName_.addAll(other.sealedSubclassFqName_); + } + + } + if (other.hasInlineClassUnderlyingPropertyName()) { + setInlineClassUnderlyingPropertyName(other.getInlineClassUnderlyingPropertyName()); + } + if (other.hasInlineClassUnderlyingType()) { + mergeInlineClassUnderlyingType(other.getInlineClassUnderlyingType()); + } + if (other.hasInlineClassUnderlyingTypeId()) { + setInlineClassUnderlyingTypeId(other.getInlineClassUnderlyingTypeId()); + } + if (other.hasTypeTable()) { + mergeTypeTable(other.getTypeTable()); + } + if (!other.versionRequirement_.isEmpty()) { + if (versionRequirement_.isEmpty()) { + versionRequirement_ = other.versionRequirement_; + bitField0_ = (bitField0_ & ~0x00020000); + } else { + ensureVersionRequirementIsMutable(); + versionRequirement_.addAll(other.versionRequirement_); + } + + } + if (other.hasVersionRequirementTable()) { + mergeVersionRequirementTable(other.getVersionRequirementTable()); + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasFqName()) { + + return false; + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getSupertypeCount(); i++) { + if (!getSupertype(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getConstructorCount(); i++) { + if (!getConstructor(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getFunctionCount(); i++) { + if (!getFunction(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getPropertyCount(); i++) { + if (!getProperty(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getTypeAliasCount(); i++) { + if (!getTypeAlias(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getEnumEntryCount(); i++) { + if (!getEnumEntry(i).isInitialized()) { + + return false; + } + } + if (hasInlineClassUnderlyingType()) { + if (!getInlineClassUnderlyingType().isInitialized()) { + + return false; + } + } + if (hasTypeTable()) { + if (!getTypeTable().isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Class parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Class) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int flags_ = 6; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *ClassKind
+       *isInner
+       *isData
+       *isExternal
+       *isExpect
+       *isInline
+       *isFun
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *ClassKind
+       *isInner
+       *isData
+       *isExternal
+       *isExpect
+       *isInline
+       *isFun
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *ClassKind
+       *isInner
+       *isData
+       *isExternal
+       *isExpect
+       *isInline
+       *isFun
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *ClassKind
+       *isInner
+       *isData
+       *isExternal
+       *isExpect
+       *isInline
+       *isFun
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 6; + + return this; + } + + private int fqName_ ; + /** + * required int32 fq_name = 3; + */ + public boolean hasFqName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 fq_name = 3; + */ + public int getFqName() { + return fqName_; + } + /** + * required int32 fq_name = 3; + */ + public Builder setFqName(int value) { + bitField0_ |= 0x00000002; + fqName_ = value; + + return this; + } + /** + * required int32 fq_name = 3; + */ + public Builder clearFqName() { + bitField0_ = (bitField0_ & ~0x00000002); + fqName_ = 0; + + return this; + } + + private int companionObjectName_ ; + /** + * optional int32 companion_object_name = 4; + */ + public boolean hasCompanionObjectName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 companion_object_name = 4; + */ + public int getCompanionObjectName() { + return companionObjectName_; + } + /** + * optional int32 companion_object_name = 4; + */ + public Builder setCompanionObjectName(int value) { + bitField0_ |= 0x00000004; + companionObjectName_ = value; + + return this; + } + /** + * optional int32 companion_object_name = 4; + */ + public Builder clearCompanionObjectName() { + bitField0_ = (bitField0_ & ~0x00000004); + companionObjectName_ = 0; + + return this; + } + + private java.util.List typeParameter_ = + java.util.Collections.emptyList(); + private void ensureTypeParameterIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + typeParameter_ = new java.util.ArrayList(typeParameter_); + bitField0_ |= 0x00000008; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public java.util.List getTypeParameterList() { + return java.util.Collections.unmodifiableList(typeParameter_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder addTypeParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder addAllTypeParameter( + java.lang.Iterable values) { + ensureTypeParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeParameter_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder clearTypeParameter() { + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; + */ + public Builder removeTypeParameter(int index) { + ensureTypeParameterIsMutable(); + typeParameter_.remove(index); + + return this; + } + + private java.util.List supertype_ = + java.util.Collections.emptyList(); + private void ensureSupertypeIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + supertype_ = new java.util.ArrayList(supertype_); + bitField0_ |= 0x00000010; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public java.util.List getSupertypeList() { + return java.util.Collections.unmodifiableList(supertype_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public int getSupertypeCount() { + return supertype_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getSupertype(int index) { + return supertype_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder setSupertype( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupertypeIsMutable(); + supertype_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder setSupertype( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureSupertypeIsMutable(); + supertype_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder addSupertype(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupertypeIsMutable(); + supertype_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder addSupertype( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupertypeIsMutable(); + supertype_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder addSupertype( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureSupertypeIsMutable(); + supertype_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder addSupertype( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureSupertypeIsMutable(); + supertype_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder addAllSupertype( + java.lang.Iterable values) { + ensureSupertypeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, supertype_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder clearSupertype() { + supertype_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; + */ + public Builder removeSupertype(int index) { + ensureSupertypeIsMutable(); + supertype_.remove(index); + + return this; + } + + private java.util.List supertypeId_ = java.util.Collections.emptyList(); + private void ensureSupertypeIdIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + supertypeId_ = new java.util.ArrayList(supertypeId_); + bitField0_ |= 0x00000020; + } + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public java.util.List + getSupertypeIdList() { + return java.util.Collections.unmodifiableList(supertypeId_); + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public int getSupertypeIdCount() { + return supertypeId_.size(); + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public int getSupertypeId(int index) { + return supertypeId_.get(index); + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public Builder setSupertypeId( + int index, int value) { + ensureSupertypeIdIsMutable(); + supertypeId_.set(index, value); + + return this; + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public Builder addSupertypeId(int value) { + ensureSupertypeIdIsMutable(); + supertypeId_.add(value); + + return this; + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public Builder addAllSupertypeId( + java.lang.Iterable values) { + ensureSupertypeIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, supertypeId_); + + return this; + } + /** + * repeated int32 supertype_id = 2 [packed = true]; + */ + public Builder clearSupertypeId() { + supertypeId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + + return this; + } + + private java.util.List nestedClassName_ = java.util.Collections.emptyList(); + private void ensureNestedClassNameIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + nestedClassName_ = new java.util.ArrayList(nestedClassName_); + bitField0_ |= 0x00000040; + } + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public java.util.List + getNestedClassNameList() { + return java.util.Collections.unmodifiableList(nestedClassName_); + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public int getNestedClassNameCount() { + return nestedClassName_.size(); + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public int getNestedClassName(int index) { + return nestedClassName_.get(index); + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public Builder setNestedClassName( + int index, int value) { + ensureNestedClassNameIsMutable(); + nestedClassName_.set(index, value); + + return this; + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public Builder addNestedClassName(int value) { + ensureNestedClassNameIsMutable(); + nestedClassName_.add(value); + + return this; + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public Builder addAllNestedClassName( + java.lang.Iterable values) { + ensureNestedClassNameIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nestedClassName_); + + return this; + } + /** + * repeated int32 nested_class_name = 7 [packed = true]; + */ + public Builder clearNestedClassName() { + nestedClassName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + + return this; + } + + private java.util.List constructor_ = + java.util.Collections.emptyList(); + private void ensureConstructorIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + constructor_ = new java.util.ArrayList(constructor_); + bitField0_ |= 0x00000080; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public java.util.List getConstructorList() { + return java.util.Collections.unmodifiableList(constructor_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public int getConstructorCount() { + return constructor_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getConstructor(int index) { + return constructor_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder setConstructor( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Constructor value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstructorIsMutable(); + constructor_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder setConstructor( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.Builder builderForValue) { + ensureConstructorIsMutable(); + constructor_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder addConstructor(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstructorIsMutable(); + constructor_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder addConstructor( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Constructor value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstructorIsMutable(); + constructor_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder addConstructor( + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.Builder builderForValue) { + ensureConstructorIsMutable(); + constructor_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder addConstructor( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.Builder builderForValue) { + ensureConstructorIsMutable(); + constructor_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder addAllConstructor( + java.lang.Iterable values) { + ensureConstructorIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, constructor_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder clearConstructor() { + constructor_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; + */ + public Builder removeConstructor(int index) { + ensureConstructorIsMutable(); + constructor_.remove(index); + + return this; + } + + private java.util.List function_ = + java.util.Collections.emptyList(); + private void ensureFunctionIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + function_ = new java.util.ArrayList(function_); + bitField0_ |= 0x00000100; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public java.util.List getFunctionList() { + return java.util.Collections.unmodifiableList(function_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public int getFunctionCount() { + return function_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index) { + return function_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder setFunction( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder setFunction( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + ensureFunctionIsMutable(); + function_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder addFunction(org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder addFunction( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder addFunction( + org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + ensureFunctionIsMutable(); + function_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder addFunction( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + ensureFunctionIsMutable(); + function_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder addAllFunction( + java.lang.Iterable values) { + ensureFunctionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, function_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder clearFunction() { + function_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 9; + */ + public Builder removeFunction(int index) { + ensureFunctionIsMutable(); + function_.remove(index); + + return this; + } + + private java.util.List property_ = + java.util.Collections.emptyList(); + private void ensurePropertyIsMutable() { + if (!((bitField0_ & 0x00000200) == 0x00000200)) { + property_ = new java.util.ArrayList(property_); + bitField0_ |= 0x00000200; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public java.util.List getPropertyList() { + return java.util.Collections.unmodifiableList(property_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public int getPropertyCount() { + return property_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index) { + return property_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder setProperty( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyIsMutable(); + property_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder setProperty( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + ensurePropertyIsMutable(); + property_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder addProperty(org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyIsMutable(); + property_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder addProperty( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyIsMutable(); + property_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder addProperty( + org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + ensurePropertyIsMutable(); + property_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder addProperty( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + ensurePropertyIsMutable(); + property_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder addAllProperty( + java.lang.Iterable values) { + ensurePropertyIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, property_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder clearProperty() { + property_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 10; + */ + public Builder removeProperty(int index) { + ensurePropertyIsMutable(); + property_.remove(index); + + return this; + } + + private java.util.List typeAlias_ = + java.util.Collections.emptyList(); + private void ensureTypeAliasIsMutable() { + if (!((bitField0_ & 0x00000400) == 0x00000400)) { + typeAlias_ = new java.util.ArrayList(typeAlias_); + bitField0_ |= 0x00000400; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public java.util.List getTypeAliasList() { + return java.util.Collections.unmodifiableList(typeAlias_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public int getTypeAliasCount() { + return typeAlias_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index) { + return typeAlias_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder setTypeAlias( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeAliasIsMutable(); + typeAlias_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder setTypeAlias( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + ensureTypeAliasIsMutable(); + typeAlias_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder addTypeAlias(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeAliasIsMutable(); + typeAlias_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder addTypeAlias( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeAliasIsMutable(); + typeAlias_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder addTypeAlias( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + ensureTypeAliasIsMutable(); + typeAlias_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder addTypeAlias( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + ensureTypeAliasIsMutable(); + typeAlias_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder addAllTypeAlias( + java.lang.Iterable values) { + ensureTypeAliasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeAlias_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder clearTypeAlias() { + typeAlias_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; + */ + public Builder removeTypeAlias(int index) { + ensureTypeAliasIsMutable(); + typeAlias_.remove(index); + + return this; + } + + private java.util.List enumEntry_ = + java.util.Collections.emptyList(); + private void ensureEnumEntryIsMutable() { + if (!((bitField0_ & 0x00000800) == 0x00000800)) { + enumEntry_ = new java.util.ArrayList(enumEntry_); + bitField0_ |= 0x00000800; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public java.util.List getEnumEntryList() { + return java.util.Collections.unmodifiableList(enumEntry_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public int getEnumEntryCount() { + return enumEntry_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getEnumEntry(int index) { + return enumEntry_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder setEnumEntry( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnumEntryIsMutable(); + enumEntry_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder setEnumEntry( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.Builder builderForValue) { + ensureEnumEntryIsMutable(); + enumEntry_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder addEnumEntry(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnumEntryIsMutable(); + enumEntry_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder addEnumEntry( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnumEntryIsMutable(); + enumEntry_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder addEnumEntry( + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.Builder builderForValue) { + ensureEnumEntryIsMutable(); + enumEntry_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder addEnumEntry( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.Builder builderForValue) { + ensureEnumEntryIsMutable(); + enumEntry_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder addAllEnumEntry( + java.lang.Iterable values) { + ensureEnumEntryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, enumEntry_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder clearEnumEntry() { + enumEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; + */ + public Builder removeEnumEntry(int index) { + ensureEnumEntryIsMutable(); + enumEntry_.remove(index); + + return this; + } + + private java.util.List sealedSubclassFqName_ = java.util.Collections.emptyList(); + private void ensureSealedSubclassFqNameIsMutable() { + if (!((bitField0_ & 0x00001000) == 0x00001000)) { + sealedSubclassFqName_ = new java.util.ArrayList(sealedSubclassFqName_); + bitField0_ |= 0x00001000; + } + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public java.util.List + getSealedSubclassFqNameList() { + return java.util.Collections.unmodifiableList(sealedSubclassFqName_); + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public int getSealedSubclassFqNameCount() { + return sealedSubclassFqName_.size(); + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public int getSealedSubclassFqName(int index) { + return sealedSubclassFqName_.get(index); + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public Builder setSealedSubclassFqName( + int index, int value) { + ensureSealedSubclassFqNameIsMutable(); + sealedSubclassFqName_.set(index, value); + + return this; + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public Builder addSealedSubclassFqName(int value) { + ensureSealedSubclassFqNameIsMutable(); + sealedSubclassFqName_.add(value); + + return this; + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public Builder addAllSealedSubclassFqName( + java.lang.Iterable values) { + ensureSealedSubclassFqNameIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sealedSubclassFqName_); + + return this; + } + /** + * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; + */ + public Builder clearSealedSubclassFqName() { + sealedSubclassFqName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + + return this; + } + + private int inlineClassUnderlyingPropertyName_ ; + /** + * optional int32 inline_class_underlying_property_name = 17; + */ + public boolean hasInlineClassUnderlyingPropertyName() { + return ((bitField0_ & 0x00002000) == 0x00002000); + } + /** + * optional int32 inline_class_underlying_property_name = 17; + */ + public int getInlineClassUnderlyingPropertyName() { + return inlineClassUnderlyingPropertyName_; + } + /** + * optional int32 inline_class_underlying_property_name = 17; + */ + public Builder setInlineClassUnderlyingPropertyName(int value) { + bitField0_ |= 0x00002000; + inlineClassUnderlyingPropertyName_ = value; + + return this; + } + /** + * optional int32 inline_class_underlying_property_name = 17; + */ + public Builder clearInlineClassUnderlyingPropertyName() { + bitField0_ = (bitField0_ & ~0x00002000); + inlineClassUnderlyingPropertyName_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + public boolean hasInlineClassUnderlyingType() { + return ((bitField0_ & 0x00004000) == 0x00004000); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getInlineClassUnderlyingType() { + return inlineClassUnderlyingType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + public Builder setInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + inlineClassUnderlyingType_ = value; + + bitField0_ |= 0x00004000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + public Builder setInlineClassUnderlyingType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + inlineClassUnderlyingType_ = builderForValue.build(); + + bitField0_ |= 0x00004000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + public Builder mergeInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00004000) == 0x00004000) && + inlineClassUnderlyingType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + inlineClassUnderlyingType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(inlineClassUnderlyingType_).mergeFrom(value).buildPartial(); + } else { + inlineClassUnderlyingType_ = value; + } + + bitField0_ |= 0x00004000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; + */ + public Builder clearInlineClassUnderlyingType() { + inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00004000); + return this; + } + + private int inlineClassUnderlyingTypeId_ ; + /** + * optional int32 inline_class_underlying_type_id = 19; + */ + public boolean hasInlineClassUnderlyingTypeId() { + return ((bitField0_ & 0x00008000) == 0x00008000); + } + /** + * optional int32 inline_class_underlying_type_id = 19; + */ + public int getInlineClassUnderlyingTypeId() { + return inlineClassUnderlyingTypeId_; + } + /** + * optional int32 inline_class_underlying_type_id = 19; + */ + public Builder setInlineClassUnderlyingTypeId(int value) { + bitField0_ |= 0x00008000; + inlineClassUnderlyingTypeId_ = value; + + return this; + } + /** + * optional int32 inline_class_underlying_type_id = 19; + */ + public Builder clearInlineClassUnderlyingTypeId() { + bitField0_ = (bitField0_ & ~0x00008000); + inlineClassUnderlyingTypeId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public boolean hasTypeTable() { + return ((bitField0_ & 0x00010000) == 0x00010000); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + return typeTable_; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + if (value == null) { + throw new NullPointerException(); + } + typeTable_ = value; + + bitField0_ |= 0x00010000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder setTypeTable( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { + typeTable_ = builderForValue.build(); + + bitField0_ |= 0x00010000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + if (((bitField0_ & 0x00010000) == 0x00010000) && + typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { + typeTable_ = + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); + } else { + typeTable_ = value; + } + + bitField0_ |= 0x00010000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder clearTypeTable() { + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00010000); + return this; + } + + private java.util.List versionRequirement_ = java.util.Collections.emptyList(); + private void ensureVersionRequirementIsMutable() { + if (!((bitField0_ & 0x00020000) == 0x00020000)) { + versionRequirement_ = new java.util.ArrayList(versionRequirement_); + bitField0_ |= 0x00020000; + } + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public java.util.List + getVersionRequirementList() { + return java.util.Collections.unmodifiableList(versionRequirement_); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder setVersionRequirement( + int index, int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.set(index, value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00020000); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public boolean hasVersionRequirementTable() { + return ((bitField0_ & 0x00040000) == 0x00040000); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable() { + return versionRequirementTable_; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public Builder setVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { + if (value == null) { + throw new NullPointerException(); + } + versionRequirementTable_ = value; + + bitField0_ |= 0x00040000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public Builder setVersionRequirementTable( + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder builderForValue) { + versionRequirementTable_ = builderForValue.build(); + + bitField0_ |= 0x00040000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { + if (((bitField0_ & 0x00040000) == 0x00040000) && + versionRequirementTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) { + versionRequirementTable_ = + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial(); + } else { + versionRequirementTable_ = value; + } + + bitField0_ |= 0x00040000; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public Builder clearVersionRequirementTable() { + versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00040000); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Class) + } + + static { + defaultInstance = new Class(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Class) + } + + public interface PackageOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Package) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + java.util.List + getFunctionList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + int getFunctionCount(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + java.util.List + getPropertyList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + int getPropertyCount(); + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + java.util.List + getTypeAliasList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + int getTypeAliasCount(); + + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + boolean hasTypeTable(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable(); + + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + boolean hasVersionRequirementTable(); + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Package} + */ + public static final class Package extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Package> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Package) + PackageOrBuilder { + // Use Package.newBuilder() to construct. + private Package(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Package(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Package defaultInstance; + public static Package getDefaultInstance() { + return defaultInstance; + } + + public Package getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Package( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + function_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + function_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Function.PARSER, extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + property_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + property_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Property.PARSER, extensionRegistry)); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + typeAlias_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + typeAlias_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.PARSER, extensionRegistry)); + break; + } + case 242: { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = typeTable_.toBuilder(); + } + typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(typeTable_); + typeTable_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 258: { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = versionRequirementTable_.toBuilder(); + } + versionRequirementTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(versionRequirementTable_); + versionRequirementTable_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + 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)) { + function_ = java.util.Collections.unmodifiableList(function_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + property_ = java.util.Collections.unmodifiableList(property_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + typeAlias_ = java.util.Collections.unmodifiableList(typeAlias_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Package parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Package(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int FUNCTION_FIELD_NUMBER = 3; + private java.util.List function_; + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public java.util.List getFunctionList() { + return function_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public java.util.List + getFunctionOrBuilderList() { + return function_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public int getFunctionCount() { + return function_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index) { + return function_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.FunctionOrBuilder getFunctionOrBuilder( + int index) { + return function_.get(index); + } + + public static final int PROPERTY_FIELD_NUMBER = 4; + private java.util.List property_; + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public java.util.List getPropertyList() { + return property_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public java.util.List + getPropertyOrBuilderList() { + return property_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public int getPropertyCount() { + return property_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index) { + return property_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.PropertyOrBuilder getPropertyOrBuilder( + int index) { + return property_.get(index); + } + + public static final int TYPE_ALIAS_FIELD_NUMBER = 5; + private java.util.List typeAlias_; + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public java.util.List getTypeAliasList() { + return typeAlias_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public java.util.List + getTypeAliasOrBuilderList() { + return typeAlias_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public int getTypeAliasCount() { + return typeAlias_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index) { + return typeAlias_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAliasOrBuilder getTypeAliasOrBuilder( + int index) { + return typeAlias_.get(index); + } + + public static final int TYPE_TABLE_FIELD_NUMBER = 30; + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public boolean hasTypeTable() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + return typeTable_; + } + + public static final int VERSION_REQUIREMENT_TABLE_FIELD_NUMBER = 32; + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable versionRequirementTable_; + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public boolean hasVersionRequirementTable() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable() { + return versionRequirementTable_; + } + + private void initFields() { + function_ = java.util.Collections.emptyList(); + property_ = java.util.Collections.emptyList(); + typeAlias_ = java.util.Collections.emptyList(); + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getFunctionCount(); i++) { + if (!getFunction(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getPropertyCount(); i++) { + if (!getProperty(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getTypeAliasCount(); i++) { + if (!getTypeAlias(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTypeTable()) { + if (!getTypeTable().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + for (int i = 0; i < function_.size(); i++) { + output.writeMessage(3, function_.get(i)); + } + for (int i = 0; i < property_.size(); i++) { + output.writeMessage(4, property_.get(i)); + } + for (int i = 0; i < typeAlias_.size(); i++) { + output.writeMessage(5, typeAlias_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(30, typeTable_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(32, versionRequirementTable_); + } + extensionWriter.writeUntil(200, output); + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < function_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, function_.get(i)); + } + for (int i = 0; i < property_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, property_.get(i)); + } + for (int i = 0; i < typeAlias_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, typeAlias_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(30, typeTable_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(32, versionRequirementTable_); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.Package parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Package 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.metadata.ProtoBuf.Package parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Package 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.metadata.ProtoBuf.Package prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Package} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.Package, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Package) + org.jetbrains.kotlin.metadata.ProtoBuf.PackageOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Package.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + function_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + property_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + typeAlias_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Package getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Package build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Package result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Package buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Package result = new org.jetbrains.kotlin.metadata.ProtoBuf.Package(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + function_ = java.util.Collections.unmodifiableList(function_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.function_ = function_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + property_ = java.util.Collections.unmodifiableList(property_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.property_ = property_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + typeAlias_ = java.util.Collections.unmodifiableList(typeAlias_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.typeAlias_ = typeAlias_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000001; + } + result.typeTable_ = typeTable_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000002; + } + result.versionRequirementTable_ = versionRequirementTable_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Package other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance()) return this; + if (!other.function_.isEmpty()) { + if (function_.isEmpty()) { + function_ = other.function_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFunctionIsMutable(); + function_.addAll(other.function_); + } + + } + if (!other.property_.isEmpty()) { + if (property_.isEmpty()) { + property_ = other.property_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePropertyIsMutable(); + property_.addAll(other.property_); + } + + } + if (!other.typeAlias_.isEmpty()) { + if (typeAlias_.isEmpty()) { + typeAlias_ = other.typeAlias_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureTypeAliasIsMutable(); + typeAlias_.addAll(other.typeAlias_); + } + + } + if (other.hasTypeTable()) { + mergeTypeTable(other.getTypeTable()); + } + if (other.hasVersionRequirementTable()) { + mergeVersionRequirementTable(other.getVersionRequirementTable()); + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getFunctionCount(); i++) { + if (!getFunction(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getPropertyCount(); i++) { + if (!getProperty(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getTypeAliasCount(); i++) { + if (!getTypeAlias(i).isInitialized()) { + + return false; + } + } + if (hasTypeTable()) { + if (!getTypeTable().isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Package parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Package) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List function_ = + java.util.Collections.emptyList(); + private void ensureFunctionIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + function_ = new java.util.ArrayList(function_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public java.util.List getFunctionList() { + return java.util.Collections.unmodifiableList(function_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public int getFunctionCount() { + return function_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index) { + return function_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder setFunction( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder setFunction( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + ensureFunctionIsMutable(); + function_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder addFunction(org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder addFunction( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder addFunction( + org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + ensureFunctionIsMutable(); + function_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder addFunction( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + ensureFunctionIsMutable(); + function_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder addAllFunction( + java.lang.Iterable values) { + ensureFunctionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, function_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder clearFunction() { + function_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + */ + public Builder removeFunction(int index) { + ensureFunctionIsMutable(); + function_.remove(index); + + return this; + } + + private java.util.List property_ = + java.util.Collections.emptyList(); + private void ensurePropertyIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + property_ = new java.util.ArrayList(property_); + bitField0_ |= 0x00000002; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public java.util.List getPropertyList() { + return java.util.Collections.unmodifiableList(property_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public int getPropertyCount() { + return property_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index) { + return property_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder setProperty( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyIsMutable(); + property_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder setProperty( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + ensurePropertyIsMutable(); + property_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder addProperty(org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyIsMutable(); + property_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder addProperty( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertyIsMutable(); + property_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder addProperty( + org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + ensurePropertyIsMutable(); + property_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder addProperty( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + ensurePropertyIsMutable(); + property_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder addAllProperty( + java.lang.Iterable values) { + ensurePropertyIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, property_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder clearProperty() { + property_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + */ + public Builder removeProperty(int index) { + ensurePropertyIsMutable(); + property_.remove(index); + + return this; + } + + private java.util.List typeAlias_ = + java.util.Collections.emptyList(); + private void ensureTypeAliasIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + typeAlias_ = new java.util.ArrayList(typeAlias_); + bitField0_ |= 0x00000004; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public java.util.List getTypeAliasList() { + return java.util.Collections.unmodifiableList(typeAlias_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public int getTypeAliasCount() { + return typeAlias_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index) { + return typeAlias_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder setTypeAlias( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeAliasIsMutable(); + typeAlias_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder setTypeAlias( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + ensureTypeAliasIsMutable(); + typeAlias_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder addTypeAlias(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeAliasIsMutable(); + typeAlias_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder addTypeAlias( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeAliasIsMutable(); + typeAlias_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder addTypeAlias( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + ensureTypeAliasIsMutable(); + typeAlias_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder addTypeAlias( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + ensureTypeAliasIsMutable(); + typeAlias_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder addAllTypeAlias( + java.lang.Iterable values) { + ensureTypeAliasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeAlias_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder clearTypeAlias() { + typeAlias_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + */ + public Builder removeTypeAlias(int index) { + ensureTypeAliasIsMutable(); + typeAlias_.remove(index); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public boolean hasTypeTable() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + return typeTable_; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + if (value == null) { + throw new NullPointerException(); + } + typeTable_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder setTypeTable( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { + typeTable_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { + typeTable_ = + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); + } else { + typeTable_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder clearTypeTable() { + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public boolean hasVersionRequirementTable() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable() { + return versionRequirementTable_; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public Builder setVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { + if (value == null) { + throw new NullPointerException(); + } + versionRequirementTable_ = value; + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public Builder setVersionRequirementTable( + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder builderForValue) { + versionRequirementTable_ = builderForValue.build(); + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + versionRequirementTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) { + versionRequirementTable_ = + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial(); + } else { + versionRequirementTable_ = value; + } + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + */ + public Builder clearVersionRequirementTable() { + versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Package) + } + + static { + defaultInstance = new Package(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Package) + } + + public interface TypeTableOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeTable) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + java.util.List + getTypeList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + int getTypeCount(); + + /** + * optional int32 first_nullable = 2 [default = -1]; + * + *
+     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * 
+ */ + boolean hasFirstNullable(); + /** + * optional int32 first_nullable = 2 [default = -1]; + * + *
+     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * 
+ */ + int getFirstNullable(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} + */ + public static final class TypeTable extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeTable) + TypeTableOrBuilder { + // Use TypeTable.newBuilder() to construct. + private TypeTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private TypeTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final TypeTable defaultInstance; + public static TypeTable getDefaultInstance() { + return defaultInstance; + } + + public TypeTable getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private TypeTable( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + type_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + type_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); + break; + } + case 16: { + bitField0_ |= 0x00000001; + firstNullable_ = input.readInt32(); + 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)) { + type_ = java.util.Collections.unmodifiableList(type_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TypeTable parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TypeTable(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private java.util.List type_; + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public java.util.List getTypeList() { + return type_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public java.util.List + getTypeOrBuilderList() { + return type_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public int getTypeCount() { + return type_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index) { + return type_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getTypeOrBuilder( + int index) { + return type_.get(index); + } + + public static final int FIRST_NULLABLE_FIELD_NUMBER = 2; + private int firstNullable_; + /** + * optional int32 first_nullable = 2 [default = -1]; + * + *
+     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * 
+ */ + public boolean hasFirstNullable() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 first_nullable = 2 [default = -1]; + * + *
+     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * 
+ */ + public int getFirstNullable() { + return firstNullable_; + } + + private void initFields() { + type_ = java.util.Collections.emptyList(); + firstNullable_ = -1; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getTypeCount(); i++) { + if (!getType(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < type_.size(); i++) { + output.writeMessage(1, type_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(2, firstNullable_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < type_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, type_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, firstNullable_); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.TypeTable parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable 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.metadata.ProtoBuf.TypeTable parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable 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.metadata.ProtoBuf.TypeTable prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeTable) + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTableOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + type_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + firstNullable_ = -1; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable build() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + type_ = java.util.Collections.unmodifiableList(type_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000001; + } + result.firstNullable_ = firstNullable_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) return this; + if (!other.type_.isEmpty()) { + if (type_.isEmpty()) { + type_ = other.type_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTypeIsMutable(); + type_.addAll(other.type_); + } + + } + if (other.hasFirstNullable()) { + setFirstNullable(other.getFirstNullable()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getTypeCount(); i++) { + if (!getType(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List type_ = + java.util.Collections.emptyList(); + private void ensureTypeIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + type_ = new java.util.ArrayList(type_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public java.util.List getTypeList() { + return java.util.Collections.unmodifiableList(type_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public int getTypeCount() { + return type_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index) { + return type_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder setType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeIsMutable(); + type_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder setType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureTypeIsMutable(); + type_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder addType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeIsMutable(); + type_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder addType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeIsMutable(); + type_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder addType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureTypeIsMutable(); + type_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder addType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureTypeIsMutable(); + type_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder addAllType( + java.lang.Iterable values) { + ensureTypeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, type_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder clearType() { + type_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + */ + public Builder removeType(int index) { + ensureTypeIsMutable(); + type_.remove(index); + + return this; + } + + private int firstNullable_ = -1; + /** + * optional int32 first_nullable = 2 [default = -1]; + * + *
+       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * 
+ */ + public boolean hasFirstNullable() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 first_nullable = 2 [default = -1]; + * + *
+       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * 
+ */ + public int getFirstNullable() { + return firstNullable_; + } + /** + * optional int32 first_nullable = 2 [default = -1]; + * + *
+       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * 
+ */ + public Builder setFirstNullable(int value) { + bitField0_ |= 0x00000002; + firstNullable_ = value; + + return this; + } + /** + * optional int32 first_nullable = 2 [default = -1]; + * + *
+       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * 
+ */ + public Builder clearFirstNullable() { + bitField0_ = (bitField0_ & ~0x00000002); + firstNullable_ = -1; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeTable) + } + + static { + defaultInstance = new TypeTable(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeTable) + } + + public interface ConstructorOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Constructor) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *isSecondary
+     *hasNonStableParameterNames
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *isSecondary
+     *hasNonStableParameterNames
+     * 
+ */ + int getFlags(); + + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + java.util.List + getValueParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + int getValueParameterCount(); + + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + java.util.List getVersionRequirementList(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirementCount(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirement(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} + */ + public static final class Constructor extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Constructor> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Constructor) + ConstructorOrBuilder { + // Use Constructor.newBuilder() to construct. + private Constructor(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Constructor(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Constructor defaultInstance; + public static Constructor getDefaultInstance() { + return defaultInstance; + } + + public Constructor getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Constructor( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + valueParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + valueParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry)); + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.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_ & 0x00000002) == 0x00000002)) { + valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Constructor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Constructor(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *isSecondary
+     *hasNonStableParameterNames
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *isSecondary
+     *hasNonStableParameterNames
+     * 
+ */ + public int getFlags() { + return flags_; + } + + public static final int VALUE_PARAMETER_FIELD_NUMBER = 2; + private java.util.List valueParameter_; + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public java.util.List getValueParameterList() { + return valueParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public java.util.List + getValueParameterOrBuilderList() { + return valueParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public int getValueParameterCount() { + return valueParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + return valueParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( + int index) { + return valueParameter_.get(index); + } + + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public java.util.List + getVersionRequirementList() { + return versionRequirement_; + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + + private void initFields() { + flags_ = 6; + valueParameter_ = java.util.Collections.emptyList(); + versionRequirement_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getValueParameterCount(); i++) { + if (!getValueParameter(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, flags_); + } + for (int i = 0; i < valueParameter_.size(); i++) { + output.writeMessage(2, valueParameter_.get(i)); + } + for (int i = 0; i < versionRequirement_.size(); i++) { + output.writeInt32(31, versionRequirement_.get(i)); + } + extensionWriter.writeUntil(19000, output); + output.writeRawBytes(unknownFields); + } + + 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, flags_); + } + for (int i = 0; i < valueParameter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, valueParameter_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < versionRequirement_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(versionRequirement_.get(i)); + } + size += dataSize; + size += 2 * getVersionRequirementList().size(); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.Constructor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor 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.metadata.ProtoBuf.Constructor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor 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.metadata.ProtoBuf.Constructor prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Constructor) + org.jetbrains.kotlin.metadata.ProtoBuf.ConstructorOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + flags_ = 6; + bitField0_ = (bitField0_ & ~0x00000001); + valueParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor result = new org.jetbrains.kotlin.metadata.ProtoBuf.Constructor(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.valueParameter_ = valueParameter_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.versionRequirement_ = versionRequirement_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (!other.valueParameter_.isEmpty()) { + if (valueParameter_.isEmpty()) { + valueParameter_ = other.valueParameter_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureValueParameterIsMutable(); + valueParameter_.addAll(other.valueParameter_); + } + + } + if (!other.versionRequirement_.isEmpty()) { + if (versionRequirement_.isEmpty()) { + versionRequirement_ = other.versionRequirement_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureVersionRequirementIsMutable(); + versionRequirement_.addAll(other.versionRequirement_); + } + + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getValueParameterCount(); i++) { + if (!getValueParameter(i).isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Constructor) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int flags_ = 6; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *isSecondary
+       *hasNonStableParameterNames
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *isSecondary
+       *hasNonStableParameterNames
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *isSecondary
+       *hasNonStableParameterNames
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *isSecondary
+       *hasNonStableParameterNames
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 6; + + return this; + } + + private java.util.List valueParameter_ = + java.util.Collections.emptyList(); + private void ensureValueParameterIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + valueParameter_ = new java.util.ArrayList(valueParameter_); + bitField0_ |= 0x00000002; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public java.util.List getValueParameterList() { + return java.util.Collections.unmodifiableList(valueParameter_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public int getValueParameterCount() { + return valueParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + return valueParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder setValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueParameterIsMutable(); + valueParameter_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder setValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueParameterIsMutable(); + valueParameter_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder addValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueParameterIsMutable(); + valueParameter_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder addValueParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder addValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder addAllValueParameter( + java.lang.Iterable values) { + ensureValueParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, valueParameter_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder clearValueParameter() { + valueParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public Builder removeValueParameter(int index) { + ensureValueParameterIsMutable(); + valueParameter_.remove(index); + + return this; + } + + private java.util.List versionRequirement_ = java.util.Collections.emptyList(); + private void ensureVersionRequirementIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + versionRequirement_ = new java.util.ArrayList(versionRequirement_); + bitField0_ |= 0x00000004; + } + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public java.util.List + getVersionRequirementList() { + return java.util.Collections.unmodifiableList(versionRequirement_); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder setVersionRequirement( + int index, int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.set(index, value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Constructor) + } + + static { + defaultInstance = new Constructor(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Constructor) + } + + public interface FunctionOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Function) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional int32 flags = 9 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isOperator
+     *isInfix
+     *isInline
+     *isTailrec
+     *isExternal
+     *isSuspend
+     *isExpect
+     *hasNonStableParameterNames
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 9 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isOperator
+     *isInfix
+     *isInline
+     *isTailrec
+     *isExternal
+     *isSuspend
+     *isExpect
+     *hasNonStableParameterNames
+     * 
+ */ + int getFlags(); + + /** + * optional int32 old_flags = 1 [default = 6]; + */ + boolean hasOldFlags(); + /** + * optional int32 old_flags = 1 [default = 6]; + */ + int getOldFlags(); + + /** + * required int32 name = 2; + */ + boolean hasName(); + /** + * required int32 name = 2; + */ + int getName(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + boolean hasReturnType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType(); + + /** + * optional int32 return_type_id = 7; + */ + boolean hasReturnTypeId(); + /** + * optional int32 return_type_id = 7; + */ + int getReturnTypeId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + java.util.List + getTypeParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + int getTypeParameterCount(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + boolean hasReceiverType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType(); + + /** + * optional int32 receiver_type_id = 8; + */ + boolean hasReceiverTypeId(); + /** + * optional int32 receiver_type_id = 8; + */ + int getReceiverTypeId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + java.util.List + getValueParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + int getValueParameterCount(); + + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + boolean hasTypeTable(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable(); + + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + java.util.List getVersionRequirementList(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirementCount(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirement(int index); + + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + boolean hasContract(); + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} + */ + public static final class Function extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Function> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Function) + FunctionOrBuilder { + // Use Function.newBuilder() to construct. + private Function(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Function(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Function defaultInstance; + public static Function getDefaultInstance() { + return defaultInstance; + } + + public Function getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Function( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000002; + oldFlags_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000004; + name_ = input.readInt32(); + break; + } + case 26: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = returnType_.toBuilder(); + } + returnType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(returnType_); + returnType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + break; + } + case 42: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = receiverType_.toBuilder(); + } + receiverType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(receiverType_); + receiverType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + valueParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + valueParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry)); + break; + } + case 56: { + bitField0_ |= 0x00000010; + returnTypeId_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000040; + receiverTypeId_ = input.readInt32(); + break; + } + case 72: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 242: { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = typeTable_.toBuilder(); + } + typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(typeTable_); + typeTable_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000400; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000400) == 0x00000400) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000400; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 258: { + org.jetbrains.kotlin.metadata.ProtoBuf.Contract.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = contract_.toBuilder(); + } + contract_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Contract.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contract_); + contract_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + 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_ & 0x00000020) == 0x00000020)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); + } + if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Function parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Function(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 9; + private int flags_; + /** + * optional int32 flags = 9 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isOperator
+     *isInfix
+     *isInline
+     *isTailrec
+     *isExternal
+     *isSuspend
+     *isExpect
+     *hasNonStableParameterNames
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 9 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isOperator
+     *isInfix
+     *isInline
+     *isTailrec
+     *isExternal
+     *isSuspend
+     *isExpect
+     *hasNonStableParameterNames
+     * 
+ */ + public int getFlags() { + return flags_; + } + + public static final int OLD_FLAGS_FIELD_NUMBER = 1; + private int oldFlags_; + /** + * optional int32 old_flags = 1 [default = 6]; + */ + public boolean hasOldFlags() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 old_flags = 1 [default = 6]; + */ + public int getOldFlags() { + return oldFlags_; + } + + public static final int NAME_FIELD_NUMBER = 2; + private int name_; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + + public static final int RETURN_TYPE_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public boolean hasReturnType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + return returnType_; + } + + public static final int RETURN_TYPE_ID_FIELD_NUMBER = 7; + private int returnTypeId_; + /** + * optional int32 return_type_id = 7; + */ + public boolean hasReturnTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 return_type_id = 7; + */ + public int getReturnTypeId() { + return returnTypeId_; + } + + public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; + private java.util.List typeParameter_; + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List getTypeParameterList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List + getTypeParameterOrBuilderList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + int index) { + return typeParameter_.get(index); + } + + public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public boolean hasReceiverType() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + return receiverType_; + } + + public static final int RECEIVER_TYPE_ID_FIELD_NUMBER = 8; + private int receiverTypeId_; + /** + * optional int32 receiver_type_id = 8; + */ + public boolean hasReceiverTypeId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 receiver_type_id = 8; + */ + public int getReceiverTypeId() { + return receiverTypeId_; + } + + public static final int VALUE_PARAMETER_FIELD_NUMBER = 6; + private java.util.List valueParameter_; + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public java.util.List getValueParameterList() { + return valueParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public java.util.List + getValueParameterOrBuilderList() { + return valueParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public int getValueParameterCount() { + return valueParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + return valueParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( + int index) { + return valueParameter_.get(index); + } + + public static final int TYPE_TABLE_FIELD_NUMBER = 30; + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public boolean hasTypeTable() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + return typeTable_; + } + + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public java.util.List + getVersionRequirementList() { + return versionRequirement_; + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + + public static final int CONTRACT_FIELD_NUMBER = 32; + private org.jetbrains.kotlin.metadata.ProtoBuf.Contract contract_; + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public boolean hasContract() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract() { + return contract_; + } + + private void initFields() { + flags_ = 6; + oldFlags_ = 6; + name_ = 0; + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnTypeId_ = 0; + typeParameter_ = java.util.Collections.emptyList(); + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverTypeId_ = 0; + valueParameter_ = java.util.Collections.emptyList(); + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + versionRequirement_ = java.util.Collections.emptyList(); + contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (hasReturnType()) { + if (!getReturnType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasReceiverType()) { + if (!getReceiverType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getValueParameterCount(); i++) { + if (!getValueParameter(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTypeTable()) { + if (!getTypeTable().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasContract()) { + if (!getContract().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(1, oldFlags_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(2, name_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(3, returnType_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + output.writeMessage(4, typeParameter_.get(i)); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeMessage(5, receiverType_); + } + for (int i = 0; i < valueParameter_.size(); i++) { + output.writeMessage(6, valueParameter_.get(i)); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(7, returnTypeId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(8, receiverTypeId_); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(9, flags_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeMessage(30, typeTable_); + } + for (int i = 0; i < versionRequirement_.size(); i++) { + output.writeInt32(31, versionRequirement_.get(i)); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeMessage(32, contract_); + } + extensionWriter.writeUntil(19000, output); + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, oldFlags_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, name_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, returnType_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, typeParameter_.get(i)); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, receiverType_); + } + for (int i = 0; i < valueParameter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, valueParameter_.get(i)); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, returnTypeId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, receiverTypeId_); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, flags_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(30, typeTable_); + } + { + int dataSize = 0; + for (int i = 0; i < versionRequirement_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(versionRequirement_.get(i)); + } + size += dataSize; + size += 2 * getVersionRequirementList().size(); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(32, contract_); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.Function parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Function 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.metadata.ProtoBuf.Function parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Function 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.metadata.ProtoBuf.Function prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.Function, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Function) + org.jetbrains.kotlin.metadata.ProtoBuf.FunctionOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Function.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + flags_ = 6; + bitField0_ = (bitField0_ & ~0x00000001); + oldFlags_ = 6; + bitField0_ = (bitField0_ & ~0x00000002); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + returnTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000040); + receiverTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + valueParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000200); + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Function getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Function build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Function result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Function buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Function result = new org.jetbrains.kotlin.metadata.ProtoBuf.Function(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.oldFlags_ = oldFlags_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.returnType_ = returnType_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.returnTypeId_ = returnTypeId_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.typeParameter_ = typeParameter_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; + } + result.receiverType_ = receiverType_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000040; + } + result.receiverTypeId_ = receiverTypeId_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.valueParameter_ = valueParameter_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000080; + } + result.typeTable_ = typeTable_; + if (((bitField0_ & 0x00000400) == 0x00000400)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.versionRequirement_ = versionRequirement_; + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000100; + } + result.contract_ = contract_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Function other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasOldFlags()) { + setOldFlags(other.getOldFlags()); + } + if (other.hasName()) { + setName(other.getName()); + } + if (other.hasReturnType()) { + mergeReturnType(other.getReturnType()); + } + if (other.hasReturnTypeId()) { + setReturnTypeId(other.getReturnTypeId()); + } + if (!other.typeParameter_.isEmpty()) { + if (typeParameter_.isEmpty()) { + typeParameter_ = other.typeParameter_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTypeParameterIsMutable(); + typeParameter_.addAll(other.typeParameter_); + } + + } + if (other.hasReceiverType()) { + mergeReceiverType(other.getReceiverType()); + } + if (other.hasReceiverTypeId()) { + setReceiverTypeId(other.getReceiverTypeId()); + } + if (!other.valueParameter_.isEmpty()) { + if (valueParameter_.isEmpty()) { + valueParameter_ = other.valueParameter_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureValueParameterIsMutable(); + valueParameter_.addAll(other.valueParameter_); + } + + } + if (other.hasTypeTable()) { + mergeTypeTable(other.getTypeTable()); + } + if (!other.versionRequirement_.isEmpty()) { + if (versionRequirement_.isEmpty()) { + versionRequirement_ = other.versionRequirement_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureVersionRequirementIsMutable(); + versionRequirement_.addAll(other.versionRequirement_); + } + + } + if (other.hasContract()) { + mergeContract(other.getContract()); + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + + return false; + } + if (hasReturnType()) { + if (!getReturnType().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + + return false; + } + } + if (hasReceiverType()) { + if (!getReceiverType().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getValueParameterCount(); i++) { + if (!getValueParameter(i).isInitialized()) { + + return false; + } + } + if (hasTypeTable()) { + if (!getTypeTable().isInitialized()) { + + return false; + } + } + if (hasContract()) { + if (!getContract().isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Function parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Function) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int flags_ = 6; + /** + * optional int32 flags = 9 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isOperator
+       *isInfix
+       *isInline
+       *isTailrec
+       *isExternal
+       *isSuspend
+       *isExpect
+       *hasNonStableParameterNames
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 9 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isOperator
+       *isInfix
+       *isInline
+       *isTailrec
+       *isExternal
+       *isSuspend
+       *isExpect
+       *hasNonStableParameterNames
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 9 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isOperator
+       *isInfix
+       *isInline
+       *isTailrec
+       *isExternal
+       *isSuspend
+       *isExpect
+       *hasNonStableParameterNames
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 9 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isOperator
+       *isInfix
+       *isInline
+       *isTailrec
+       *isExternal
+       *isSuspend
+       *isExpect
+       *hasNonStableParameterNames
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 6; + + return this; + } + + private int oldFlags_ = 6; + /** + * optional int32 old_flags = 1 [default = 6]; + */ + public boolean hasOldFlags() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 old_flags = 1 [default = 6]; + */ + public int getOldFlags() { + return oldFlags_; + } + /** + * optional int32 old_flags = 1 [default = 6]; + */ + public Builder setOldFlags(int value) { + bitField0_ |= 0x00000002; + oldFlags_ = value; + + return this; + } + /** + * optional int32 old_flags = 1 [default = 6]; + */ + public Builder clearOldFlags() { + bitField0_ = (bitField0_ & ~0x00000002); + oldFlags_ = 6; + + return this; + } + + private int name_ ; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + /** + * required int32 name = 2; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000004; + name_ = value; + + return this; + } + /** + * required int32 name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000004); + name_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public boolean hasReturnType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + return returnType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + returnType_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder setReturnType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + returnType_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + returnType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + returnType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); + } else { + returnType_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder clearReturnType() { + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + private int returnTypeId_ ; + /** + * optional int32 return_type_id = 7; + */ + public boolean hasReturnTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 return_type_id = 7; + */ + public int getReturnTypeId() { + return returnTypeId_; + } + /** + * optional int32 return_type_id = 7; + */ + public Builder setReturnTypeId(int value) { + bitField0_ |= 0x00000010; + returnTypeId_ = value; + + return this; + } + /** + * optional int32 return_type_id = 7; + */ + public Builder clearReturnTypeId() { + bitField0_ = (bitField0_ & ~0x00000010); + returnTypeId_ = 0; + + return this; + } + + private java.util.List typeParameter_ = + java.util.Collections.emptyList(); + private void ensureTypeParameterIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = new java.util.ArrayList(typeParameter_); + bitField0_ |= 0x00000020; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List getTypeParameterList() { + return java.util.Collections.unmodifiableList(typeParameter_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addAllTypeParameter( + java.lang.Iterable values) { + ensureTypeParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeParameter_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder clearTypeParameter() { + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder removeTypeParameter(int index) { + ensureTypeParameterIsMutable(); + typeParameter_.remove(index); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public boolean hasReceiverType() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + return receiverType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + receiverType_ = value; + + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder setReceiverType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + receiverType_ = builderForValue.build(); + + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000040) == 0x00000040) && + receiverType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + receiverType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); + } else { + receiverType_ = value; + } + + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder clearReceiverType() { + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + private int receiverTypeId_ ; + /** + * optional int32 receiver_type_id = 8; + */ + public boolean hasReceiverTypeId() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int32 receiver_type_id = 8; + */ + public int getReceiverTypeId() { + return receiverTypeId_; + } + /** + * optional int32 receiver_type_id = 8; + */ + public Builder setReceiverTypeId(int value) { + bitField0_ |= 0x00000080; + receiverTypeId_ = value; + + return this; + } + /** + * optional int32 receiver_type_id = 8; + */ + public Builder clearReceiverTypeId() { + bitField0_ = (bitField0_ & ~0x00000080); + receiverTypeId_ = 0; + + return this; + } + + private java.util.List valueParameter_ = + java.util.Collections.emptyList(); + private void ensureValueParameterIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + valueParameter_ = new java.util.ArrayList(valueParameter_); + bitField0_ |= 0x00000100; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public java.util.List getValueParameterList() { + return java.util.Collections.unmodifiableList(valueParameter_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public int getValueParameterCount() { + return valueParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + return valueParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder setValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueParameterIsMutable(); + valueParameter_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder setValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueParameterIsMutable(); + valueParameter_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder addValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueParameterIsMutable(); + valueParameter_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder addValueParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder addValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder addAllValueParameter( + java.lang.Iterable values) { + ensureValueParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, valueParameter_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder clearValueParameter() { + valueParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder removeValueParameter(int index) { + ensureValueParameterIsMutable(); + valueParameter_.remove(index); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public boolean hasTypeTable() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + return typeTable_; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + if (value == null) { + throw new NullPointerException(); + } + typeTable_ = value; + + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder setTypeTable( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { + typeTable_ = builderForValue.build(); + + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + if (((bitField0_ & 0x00000200) == 0x00000200) && + typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { + typeTable_ = + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); + } else { + typeTable_ = value; + } + + bitField0_ |= 0x00000200; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public Builder clearTypeTable() { + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + + private java.util.List versionRequirement_ = java.util.Collections.emptyList(); + private void ensureVersionRequirementIsMutable() { + if (!((bitField0_ & 0x00000400) == 0x00000400)) { + versionRequirement_ = new java.util.ArrayList(versionRequirement_); + bitField0_ |= 0x00000400; + } + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public java.util.List + getVersionRequirementList() { + return java.util.Collections.unmodifiableList(versionRequirement_); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder setVersionRequirement( + int index, int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.set(index, value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Contract contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public boolean hasContract() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract() { + return contract_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public Builder setContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value) { + if (value == null) { + throw new NullPointerException(); + } + contract_ = value; + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public Builder setContract( + org.jetbrains.kotlin.metadata.ProtoBuf.Contract.Builder builderForValue) { + contract_ = builderForValue.build(); + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public Builder mergeContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value) { + if (((bitField0_ & 0x00000800) == 0x00000800) && + contract_ != org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance()) { + contract_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Contract.newBuilder(contract_).mergeFrom(value).buildPartial(); + } else { + contract_ = value; + } + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public Builder clearContract() { + contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Function) + } + + static { + defaultInstance = new Function(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Function) + } + + public interface PropertyOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Property) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional int32 flags = 11 [default = 518]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isVar
+     *hasGetter
+     *hasSetter
+     *isConst
+     *isLateinit
+     *hasConstant
+     *isExternal
+     *isDelegated
+     *isExpect
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 11 [default = 518]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isVar
+     *hasGetter
+     *hasSetter
+     *isConst
+     *isLateinit
+     *hasConstant
+     *isExternal
+     *isDelegated
+     *isExpect
+     * 
+ */ + int getFlags(); + + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + boolean hasOldFlags(); + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + int getOldFlags(); + + /** + * required int32 name = 2; + */ + boolean hasName(); + /** + * required int32 name = 2; + */ + int getName(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + boolean hasReturnType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType(); + + /** + * optional int32 return_type_id = 9; + */ + boolean hasReturnTypeId(); + /** + * optional int32 return_type_id = 9; + */ + int getReturnTypeId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + java.util.List + getTypeParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + int getTypeParameterCount(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + boolean hasReceiverType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType(); + + /** + * optional int32 receiver_type_id = 10; + */ + boolean hasReceiverTypeId(); + /** + * optional int32 receiver_type_id = 10; + */ + int getReceiverTypeId(); + + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + boolean hasSetterValueParameter(); + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter(); + + /** + * optional int32 getter_flags = 7; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *isNotDefault
+     *isExternal
+     *isInline
+     *If getter_flags or setter_flags are absent, their value should be computed as follows:
+     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+     *- all other flags are false
+     * 
+ */ + boolean hasGetterFlags(); + /** + * optional int32 getter_flags = 7; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *isNotDefault
+     *isExternal
+     *isInline
+     *If getter_flags or setter_flags are absent, their value should be computed as follows:
+     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+     *- all other flags are false
+     * 
+ */ + int getGetterFlags(); + + /** + * optional int32 setter_flags = 8; + */ + boolean hasSetterFlags(); + /** + * optional int32 setter_flags = 8; + */ + int getSetterFlags(); + + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + java.util.List getVersionRequirementList(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirementCount(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirement(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} + */ + public static final class Property extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Property> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Property) + PropertyOrBuilder { + // Use Property.newBuilder() to construct. + private Property(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Property(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Property defaultInstance; + public static Property getDefaultInstance() { + return defaultInstance; + } + + public Property getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Property( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000002; + oldFlags_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000004; + name_ = input.readInt32(); + break; + } + case 26: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = returnType_.toBuilder(); + } + returnType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(returnType_); + returnType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + break; + } + case 42: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = receiverType_.toBuilder(); + } + receiverType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(receiverType_); + receiverType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 50: { + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = setterValueParameter_.toBuilder(); + } + setterValueParameter_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setterValueParameter_); + setterValueParameter_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 56: { + bitField0_ |= 0x00000100; + getterFlags_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000200; + setterFlags_ = input.readInt32(); + break; + } + case 72: { + bitField0_ |= 0x00000010; + returnTypeId_ = input.readInt32(); + break; + } + case 80: { + bitField0_ |= 0x00000040; + receiverTypeId_ = input.readInt32(); + break; + } + case 88: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.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_ & 0x00000020) == 0x00000020)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + } + if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Property parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Property(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 11; + private int flags_; + /** + * optional int32 flags = 11 [default = 518]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isVar
+     *hasGetter
+     *hasSetter
+     *isConst
+     *isLateinit
+     *hasConstant
+     *isExternal
+     *isDelegated
+     *isExpect
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 11 [default = 518]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isVar
+     *hasGetter
+     *hasSetter
+     *isConst
+     *isLateinit
+     *hasConstant
+     *isExternal
+     *isDelegated
+     *isExpect
+     * 
+ */ + public int getFlags() { + return flags_; + } + + public static final int OLD_FLAGS_FIELD_NUMBER = 1; + private int oldFlags_; + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public boolean hasOldFlags() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public int getOldFlags() { + return oldFlags_; + } + + public static final int NAME_FIELD_NUMBER = 2; + private int name_; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + + public static final int RETURN_TYPE_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public boolean hasReturnType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + return returnType_; + } + + public static final int RETURN_TYPE_ID_FIELD_NUMBER = 9; + private int returnTypeId_; + /** + * optional int32 return_type_id = 9; + */ + public boolean hasReturnTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 return_type_id = 9; + */ + public int getReturnTypeId() { + return returnTypeId_; + } + + public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; + private java.util.List typeParameter_; + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List getTypeParameterList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List + getTypeParameterOrBuilderList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + int index) { + return typeParameter_.get(index); + } + + public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public boolean hasReceiverType() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + return receiverType_; + } + + public static final int RECEIVER_TYPE_ID_FIELD_NUMBER = 10; + private int receiverTypeId_; + /** + * optional int32 receiver_type_id = 10; + */ + public boolean hasReceiverTypeId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 receiver_type_id = 10; + */ + public int getReceiverTypeId() { + return receiverTypeId_; + } + + public static final int SETTER_VALUE_PARAMETER_FIELD_NUMBER = 6; + private org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter setterValueParameter_; + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public boolean hasSetterValueParameter() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter() { + return setterValueParameter_; + } + + public static final int GETTER_FLAGS_FIELD_NUMBER = 7; + private int getterFlags_; + /** + * optional int32 getter_flags = 7; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *isNotDefault
+     *isExternal
+     *isInline
+     *If getter_flags or setter_flags are absent, their value should be computed as follows:
+     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+     *- all other flags are false
+     * 
+ */ + public boolean hasGetterFlags() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional int32 getter_flags = 7; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *isNotDefault
+     *isExternal
+     *isInline
+     *If getter_flags or setter_flags are absent, their value should be computed as follows:
+     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+     *- all other flags are false
+     * 
+ */ + public int getGetterFlags() { + return getterFlags_; + } + + public static final int SETTER_FLAGS_FIELD_NUMBER = 8; + private int setterFlags_; + /** + * optional int32 setter_flags = 8; + */ + public boolean hasSetterFlags() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional int32 setter_flags = 8; + */ + public int getSetterFlags() { + return setterFlags_; + } + + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public java.util.List + getVersionRequirementList() { + return versionRequirement_; + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + + private void initFields() { + flags_ = 518; + oldFlags_ = 2054; + name_ = 0; + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnTypeId_ = 0; + typeParameter_ = java.util.Collections.emptyList(); + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverTypeId_ = 0; + setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + getterFlags_ = 0; + setterFlags_ = 0; + versionRequirement_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (hasReturnType()) { + if (!getReturnType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasReceiverType()) { + if (!getReceiverType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSetterValueParameter()) { + if (!getSetterValueParameter().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(1, oldFlags_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(2, name_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(3, returnType_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + output.writeMessage(4, typeParameter_.get(i)); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeMessage(5, receiverType_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeMessage(6, setterValueParameter_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeInt32(7, getterFlags_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeInt32(8, setterFlags_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(9, returnTypeId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(10, receiverTypeId_); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(11, flags_); + } + for (int i = 0; i < versionRequirement_.size(); i++) { + output.writeInt32(31, versionRequirement_.get(i)); + } + extensionWriter.writeUntil(19000, output); + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, oldFlags_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, name_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, returnType_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, typeParameter_.get(i)); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, receiverType_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, setterValueParameter_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, getterFlags_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, setterFlags_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, returnTypeId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, receiverTypeId_); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, flags_); + } + { + int dataSize = 0; + for (int i = 0; i < versionRequirement_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(versionRequirement_.get(i)); + } + size += dataSize; + size += 2 * getVersionRequirementList().size(); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.Property parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property 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.metadata.ProtoBuf.Property parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property 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.metadata.ProtoBuf.Property prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.Property, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Property) + org.jetbrains.kotlin.metadata.ProtoBuf.PropertyOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Property.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + flags_ = 518; + bitField0_ = (bitField0_ & ~0x00000001); + oldFlags_ = 2054; + bitField0_ = (bitField0_ & ~0x00000002); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + returnTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000040); + receiverTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000100); + getterFlags_ = 0; + bitField0_ = (bitField0_ & ~0x00000200); + setterFlags_ = 0; + bitField0_ = (bitField0_ & ~0x00000400); + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Property getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Property build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Property result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Property buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Property result = new org.jetbrains.kotlin.metadata.ProtoBuf.Property(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.oldFlags_ = oldFlags_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.returnType_ = returnType_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.returnTypeId_ = returnTypeId_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.typeParameter_ = typeParameter_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; + } + result.receiverType_ = receiverType_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000040; + } + result.receiverTypeId_ = receiverTypeId_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000080; + } + result.setterValueParameter_ = setterValueParameter_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000100; + } + result.getterFlags_ = getterFlags_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000200; + } + result.setterFlags_ = setterFlags_; + if (((bitField0_ & 0x00000800) == 0x00000800)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.versionRequirement_ = versionRequirement_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Property other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasOldFlags()) { + setOldFlags(other.getOldFlags()); + } + if (other.hasName()) { + setName(other.getName()); + } + if (other.hasReturnType()) { + mergeReturnType(other.getReturnType()); + } + if (other.hasReturnTypeId()) { + setReturnTypeId(other.getReturnTypeId()); + } + if (!other.typeParameter_.isEmpty()) { + if (typeParameter_.isEmpty()) { + typeParameter_ = other.typeParameter_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTypeParameterIsMutable(); + typeParameter_.addAll(other.typeParameter_); + } + + } + if (other.hasReceiverType()) { + mergeReceiverType(other.getReceiverType()); + } + if (other.hasReceiverTypeId()) { + setReceiverTypeId(other.getReceiverTypeId()); + } + if (other.hasSetterValueParameter()) { + mergeSetterValueParameter(other.getSetterValueParameter()); + } + if (other.hasGetterFlags()) { + setGetterFlags(other.getGetterFlags()); + } + if (other.hasSetterFlags()) { + setSetterFlags(other.getSetterFlags()); + } + if (!other.versionRequirement_.isEmpty()) { + if (versionRequirement_.isEmpty()) { + versionRequirement_ = other.versionRequirement_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureVersionRequirementIsMutable(); + versionRequirement_.addAll(other.versionRequirement_); + } + + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + + return false; + } + if (hasReturnType()) { + if (!getReturnType().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + + return false; + } + } + if (hasReceiverType()) { + if (!getReceiverType().isInitialized()) { + + return false; + } + } + if (hasSetterValueParameter()) { + if (!getSetterValueParameter().isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Property parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Property) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int flags_ = 518; + /** + * optional int32 flags = 11 [default = 518]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isVar
+       *hasGetter
+       *hasSetter
+       *isConst
+       *isLateinit
+       *hasConstant
+       *isExternal
+       *isDelegated
+       *isExpect
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 11 [default = 518]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isVar
+       *hasGetter
+       *hasSetter
+       *isConst
+       *isLateinit
+       *hasConstant
+       *isExternal
+       *isDelegated
+       *isExpect
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 11 [default = 518]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isVar
+       *hasGetter
+       *hasSetter
+       *isConst
+       *isLateinit
+       *hasConstant
+       *isExternal
+       *isDelegated
+       *isExpect
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 11 [default = 518]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isVar
+       *hasGetter
+       *hasSetter
+       *isConst
+       *isLateinit
+       *hasConstant
+       *isExternal
+       *isDelegated
+       *isExpect
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 518; + + return this; + } + + private int oldFlags_ = 2054; + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public boolean hasOldFlags() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public int getOldFlags() { + return oldFlags_; + } + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public Builder setOldFlags(int value) { + bitField0_ |= 0x00000002; + oldFlags_ = value; + + return this; + } + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public Builder clearOldFlags() { + bitField0_ = (bitField0_ & ~0x00000002); + oldFlags_ = 2054; + + return this; + } + + private int name_ ; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + /** + * required int32 name = 2; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000004; + name_ = value; + + return this; + } + /** + * required int32 name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000004); + name_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public boolean hasReturnType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + return returnType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + returnType_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder setReturnType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + returnType_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + returnType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + returnType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); + } else { + returnType_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder clearReturnType() { + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + private int returnTypeId_ ; + /** + * optional int32 return_type_id = 9; + */ + public boolean hasReturnTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 return_type_id = 9; + */ + public int getReturnTypeId() { + return returnTypeId_; + } + /** + * optional int32 return_type_id = 9; + */ + public Builder setReturnTypeId(int value) { + bitField0_ |= 0x00000010; + returnTypeId_ = value; + + return this; + } + /** + * optional int32 return_type_id = 9; + */ + public Builder clearReturnTypeId() { + bitField0_ = (bitField0_ & ~0x00000010); + returnTypeId_ = 0; + + return this; + } + + private java.util.List typeParameter_ = + java.util.Collections.emptyList(); + private void ensureTypeParameterIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = new java.util.ArrayList(typeParameter_); + bitField0_ |= 0x00000020; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List getTypeParameterList() { + return java.util.Collections.unmodifiableList(typeParameter_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addAllTypeParameter( + java.lang.Iterable values) { + ensureTypeParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeParameter_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder clearTypeParameter() { + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder removeTypeParameter(int index) { + ensureTypeParameterIsMutable(); + typeParameter_.remove(index); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public boolean hasReceiverType() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + return receiverType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + receiverType_ = value; + + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder setReceiverType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + receiverType_ = builderForValue.build(); + + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000040) == 0x00000040) && + receiverType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + receiverType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); + } else { + receiverType_ = value; + } + + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder clearReceiverType() { + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + private int receiverTypeId_ ; + /** + * optional int32 receiver_type_id = 10; + */ + public boolean hasReceiverTypeId() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int32 receiver_type_id = 10; + */ + public int getReceiverTypeId() { + return receiverTypeId_; + } + /** + * optional int32 receiver_type_id = 10; + */ + public Builder setReceiverTypeId(int value) { + bitField0_ |= 0x00000080; + receiverTypeId_ = value; + + return this; + } + /** + * optional int32 receiver_type_id = 10; + */ + public Builder clearReceiverTypeId() { + bitField0_ = (bitField0_ & ~0x00000080); + receiverTypeId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public boolean hasSetterValueParameter() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter() { + return setterValueParameter_; + } + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public Builder setSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (value == null) { + throw new NullPointerException(); + } + setterValueParameter_ = value; + + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public Builder setSetterValueParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + setterValueParameter_ = builderForValue.build(); + + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public Builder mergeSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (((bitField0_ & 0x00000100) == 0x00000100) && + setterValueParameter_ != org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance()) { + setterValueParameter_ = + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.newBuilder(setterValueParameter_).mergeFrom(value).buildPartial(); + } else { + setterValueParameter_ = value; + } + + bitField0_ |= 0x00000100; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public Builder clearSetterValueParameter() { + setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + + private int getterFlags_ ; + /** + * optional int32 getter_flags = 7; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *isNotDefault
+       *isExternal
+       *isInline
+       *If getter_flags or setter_flags are absent, their value should be computed as follows:
+       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+       *- all other flags are false
+       * 
+ */ + public boolean hasGetterFlags() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional int32 getter_flags = 7; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *isNotDefault
+       *isExternal
+       *isInline
+       *If getter_flags or setter_flags are absent, their value should be computed as follows:
+       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+       *- all other flags are false
+       * 
+ */ + public int getGetterFlags() { + return getterFlags_; + } + /** + * optional int32 getter_flags = 7; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *isNotDefault
+       *isExternal
+       *isInline
+       *If getter_flags or setter_flags are absent, their value should be computed as follows:
+       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+       *- all other flags are false
+       * 
+ */ + public Builder setGetterFlags(int value) { + bitField0_ |= 0x00000200; + getterFlags_ = value; + + return this; + } + /** + * optional int32 getter_flags = 7; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *isNotDefault
+       *isExternal
+       *isInline
+       *If getter_flags or setter_flags are absent, their value should be computed as follows:
+       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+       *- all other flags are false
+       * 
+ */ + public Builder clearGetterFlags() { + bitField0_ = (bitField0_ & ~0x00000200); + getterFlags_ = 0; + + return this; + } + + private int setterFlags_ ; + /** + * optional int32 setter_flags = 8; + */ + public boolean hasSetterFlags() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional int32 setter_flags = 8; + */ + public int getSetterFlags() { + return setterFlags_; + } + /** + * optional int32 setter_flags = 8; + */ + public Builder setSetterFlags(int value) { + bitField0_ |= 0x00000400; + setterFlags_ = value; + + return this; + } + /** + * optional int32 setter_flags = 8; + */ + public Builder clearSetterFlags() { + bitField0_ = (bitField0_ & ~0x00000400); + setterFlags_ = 0; + + return this; + } + + private java.util.List versionRequirement_ = java.util.Collections.emptyList(); + private void ensureVersionRequirementIsMutable() { + if (!((bitField0_ & 0x00000800) == 0x00000800)) { + versionRequirement_ = new java.util.ArrayList(versionRequirement_); + bitField0_ |= 0x00000800; + } + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public java.util.List + getVersionRequirementList() { + return java.util.Collections.unmodifiableList(versionRequirement_); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder setVersionRequirement( + int index, int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.set(index, value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Property) + } + + static { + defaultInstance = new Property(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Property) + } + + public interface ValueParameterOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.ValueParameter) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional int32 flags = 1 [default = 0]; + * + *
+     *hasAnnotations
+     *declaresDefault
+     *isCrossinline
+     *isNoinline
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 1 [default = 0]; + * + *
+     *hasAnnotations
+     *declaresDefault
+     *isCrossinline
+     *isNoinline
+     * 
+ */ + int getFlags(); + + /** + * required int32 name = 2; + */ + boolean hasName(); + /** + * required int32 name = 2; + */ + int getName(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + boolean hasType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(); + + /** + * optional int32 type_id = 5; + */ + boolean hasTypeId(); + /** + * optional int32 type_id = 5; + */ + int getTypeId(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + boolean hasVarargElementType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType(); + + /** + * optional int32 vararg_element_type_id = 6; + */ + boolean hasVarargElementTypeId(); + /** + * optional int32 vararg_element_type_id = 6; + */ + int getVarargElementTypeId(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} + */ + public static final class ValueParameter extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + ValueParameter> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.ValueParameter) + ValueParameterOrBuilder { + // Use ValueParameter.newBuilder() to construct. + private ValueParameter(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private ValueParameter(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final ValueParameter defaultInstance; + public static ValueParameter getDefaultInstance() { + return defaultInstance; + } + + public ValueParameter getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private ValueParameter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + name_ = input.readInt32(); + break; + } + case 26: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = type_.toBuilder(); + } + type_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(type_); + type_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 34: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = varargElementType_.toBuilder(); + } + varargElementType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(varargElementType_); + varargElementType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 40: { + bitField0_ |= 0x00000008; + typeId_ = input.readInt32(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + varargElementTypeId_ = input.readInt32(); + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ValueParameter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ValueParameter(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; + /** + * optional int32 flags = 1 [default = 0]; + * + *
+     *hasAnnotations
+     *declaresDefault
+     *isCrossinline
+     *isNoinline
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+     *hasAnnotations
+     *declaresDefault
+     *isCrossinline
+     *isNoinline
+     * 
+ */ + public int getFlags() { + return flags_; + } + + public static final int NAME_FIELD_NUMBER = 2; + private int name_; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + + public static final int TYPE_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_; + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + return type_; + } + + public static final int TYPE_ID_FIELD_NUMBER = 5; + private int typeId_; + /** + * optional int32 type_id = 5; + */ + public boolean hasTypeId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 type_id = 5; + */ + public int getTypeId() { + return typeId_; + } + + public static final int VARARG_ELEMENT_TYPE_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type varargElementType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public boolean hasVarargElementType() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType() { + return varargElementType_; + } + + public static final int VARARG_ELEMENT_TYPE_ID_FIELD_NUMBER = 6; + private int varargElementTypeId_; + /** + * optional int32 vararg_element_type_id = 6; + */ + public boolean hasVarargElementTypeId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 vararg_element_type_id = 6; + */ + public int getVarargElementTypeId() { + return varargElementTypeId_; + } + + private void initFields() { + flags_ = 0; + name_ = 0; + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + typeId_ = 0; + varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + varargElementTypeId_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (hasType()) { + if (!getType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasVarargElementType()) { + if (!getVarargElementType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, flags_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, name_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(3, type_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(4, varargElementType_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(5, typeId_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(6, varargElementTypeId_); + } + extensionWriter.writeUntil(200, output); + output.writeRawBytes(unknownFields); + } + + 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, flags_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, name_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, type_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, varargElementType_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, typeId_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, varargElementTypeId_); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.ValueParameter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter 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.metadata.ProtoBuf.ValueParameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter 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.metadata.ProtoBuf.ValueParameter prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.ValueParameter) + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + flags_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + typeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000010); + varargElementTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter build() { + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter result = new org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.typeId_ = typeId_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.varargElementType_ = varargElementType_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.varargElementTypeId_ = varargElementTypeId_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasName()) { + setName(other.getName()); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (other.hasTypeId()) { + setTypeId(other.getTypeId()); + } + if (other.hasVarargElementType()) { + mergeVarargElementType(other.getVarargElementType()); + } + if (other.hasVarargElementTypeId()) { + setVarargElementTypeId(other.getVarargElementTypeId()); + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + + return false; + } + if (hasType()) { + if (!getType().isInitialized()) { + + return false; + } + } + if (hasVarargElementType()) { + if (!getVarargElementType().isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int flags_ ; + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *hasAnnotations
+       *declaresDefault
+       *isCrossinline
+       *isNoinline
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *hasAnnotations
+       *declaresDefault
+       *isCrossinline
+       *isNoinline
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *hasAnnotations
+       *declaresDefault
+       *isCrossinline
+       *isNoinline
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *hasAnnotations
+       *declaresDefault
+       *isCrossinline
+       *isNoinline
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 0; + + return this; + } + + private int name_ ; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + /** + * required int32 name = 2; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000002; + name_ = value; + + return this; + } + /** + * required int32 name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + return type_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public Builder setType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + type_ = builderForValue.build(); + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + type_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + type_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public Builder clearType() { + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + private int typeId_ ; + /** + * optional int32 type_id = 5; + */ + public boolean hasTypeId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 type_id = 5; + */ + public int getTypeId() { + return typeId_; + } + /** + * optional int32 type_id = 5; + */ + public Builder setTypeId(int value) { + bitField0_ |= 0x00000008; + typeId_ = value; + + return this; + } + /** + * optional int32 type_id = 5; + */ + public Builder clearTypeId() { + bitField0_ = (bitField0_ & ~0x00000008); + typeId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public boolean hasVarargElementType() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType() { + return varargElementType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public Builder setVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + varargElementType_ = value; + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public Builder setVarargElementType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + varargElementType_ = builderForValue.build(); + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public Builder mergeVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + varargElementType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + varargElementType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(varargElementType_).mergeFrom(value).buildPartial(); + } else { + varargElementType_ = value; + } + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public Builder clearVarargElementType() { + varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + private int varargElementTypeId_ ; + /** + * optional int32 vararg_element_type_id = 6; + */ + public boolean hasVarargElementTypeId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 vararg_element_type_id = 6; + */ + public int getVarargElementTypeId() { + return varargElementTypeId_; + } + /** + * optional int32 vararg_element_type_id = 6; + */ + public Builder setVarargElementTypeId(int value) { + bitField0_ |= 0x00000020; + varargElementTypeId_ = value; + + return this; + } + /** + * optional int32 vararg_element_type_id = 6; + */ + public Builder clearVarargElementTypeId() { + bitField0_ = (bitField0_ & ~0x00000020); + varargElementTypeId_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.ValueParameter) + } + + static { + defaultInstance = new ValueParameter(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.ValueParameter) + } + + public interface TypeAliasOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeAlias) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     * 
+ */ + int getFlags(); + + /** + * required int32 name = 2; + */ + boolean hasName(); + /** + * required int32 name = 2; + */ + int getName(); + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + java.util.List + getTypeParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + int getTypeParameterCount(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + boolean hasUnderlyingType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType(); + + /** + * optional int32 underlying_type_id = 5; + */ + boolean hasUnderlyingTypeId(); + /** + * optional int32 underlying_type_id = 5; + */ + int getUnderlyingTypeId(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + boolean hasExpandedType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType(); + + /** + * optional int32 expanded_type_id = 7; + */ + boolean hasExpandedTypeId(); + /** + * optional int32 expanded_type_id = 7; + */ + int getExpandedTypeId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + java.util.List + getAnnotationList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + int getAnnotationCount(); + + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + java.util.List getVersionRequirementList(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirementCount(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirement(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} + */ + public static final class TypeAlias extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + TypeAlias> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeAlias) + TypeAliasOrBuilder { + // Use TypeAlias.newBuilder() to construct. + private TypeAlias(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private TypeAlias(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final TypeAlias defaultInstance; + public static TypeAlias getDefaultInstance() { + return defaultInstance; + } + + public TypeAlias getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private TypeAlias( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + name_ = input.readInt32(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + typeParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + break; + } + case 34: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = underlyingType_.toBuilder(); + } + underlyingType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(underlyingType_); + underlyingType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 40: { + bitField0_ |= 0x00000008; + underlyingTypeId_ = input.readInt32(); + break; + } + case 50: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = expandedType_.toBuilder(); + } + expandedType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expandedType_); + expandedType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 56: { + bitField0_ |= 0x00000020; + expandedTypeId_ = input.readInt32(); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + annotation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + annotation_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.PARSER, extensionRegistry)); + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.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_ & 0x00000004) == 0x00000004)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + } + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TypeAlias parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TypeAlias(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     * 
+ */ + public int getFlags() { + return flags_; + } + + public static final int NAME_FIELD_NUMBER = 2; + private int name_; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + + public static final int TYPE_PARAMETER_FIELD_NUMBER = 3; + private java.util.List typeParameter_; + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public java.util.List getTypeParameterList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public java.util.List + getTypeParameterOrBuilderList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + int index) { + return typeParameter_.get(index); + } + + public static final int UNDERLYING_TYPE_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type underlyingType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public boolean hasUnderlyingType() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType() { + return underlyingType_; + } + + public static final int UNDERLYING_TYPE_ID_FIELD_NUMBER = 5; + private int underlyingTypeId_; + /** + * optional int32 underlying_type_id = 5; + */ + public boolean hasUnderlyingTypeId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 underlying_type_id = 5; + */ + public int getUnderlyingTypeId() { + return underlyingTypeId_; + } + + public static final int EXPANDED_TYPE_FIELD_NUMBER = 6; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type expandedType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public boolean hasExpandedType() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType() { + return expandedType_; + } + + public static final int EXPANDED_TYPE_ID_FIELD_NUMBER = 7; + private int expandedTypeId_; + /** + * optional int32 expanded_type_id = 7; + */ + public boolean hasExpandedTypeId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 expanded_type_id = 7; + */ + public int getExpandedTypeId() { + return expandedTypeId_; + } + + public static final int ANNOTATION_FIELD_NUMBER = 8; + private java.util.List annotation_; + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public java.util.List getAnnotationList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public java.util.List + getAnnotationOrBuilderList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder( + int index) { + return annotation_.get(index); + } + + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public java.util.List + getVersionRequirementList() { + return versionRequirement_; + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + + private void initFields() { + flags_ = 6; + name_ = 0; + typeParameter_ = java.util.Collections.emptyList(); + underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + underlyingTypeId_ = 0; + expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + expandedTypeId_ = 0; + annotation_ = java.util.Collections.emptyList(); + versionRequirement_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasUnderlyingType()) { + if (!getUnderlyingType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasExpandedType()) { + if (!getExpandedType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, flags_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, name_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + output.writeMessage(3, typeParameter_.get(i)); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(4, underlyingType_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(5, underlyingTypeId_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(6, expandedType_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(7, expandedTypeId_); + } + for (int i = 0; i < annotation_.size(); i++) { + output.writeMessage(8, annotation_.get(i)); + } + for (int i = 0; i < versionRequirement_.size(); i++) { + output.writeInt32(31, versionRequirement_.get(i)); + } + extensionWriter.writeUntil(200, output); + output.writeRawBytes(unknownFields); + } + + 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, flags_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, name_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, typeParameter_.get(i)); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, underlyingType_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, underlyingTypeId_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, expandedType_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, expandedTypeId_); + } + for (int i = 0; i < annotation_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, annotation_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < versionRequirement_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(versionRequirement_.get(i)); + } + size += dataSize; + size += 2 * getVersionRequirementList().size(); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.TypeAlias parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias 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.metadata.ProtoBuf.TypeAlias parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias 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.metadata.ProtoBuf.TypeAlias prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeAlias) + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAliasOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + flags_ = 6; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + underlyingTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000020); + expandedTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + annotation_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias build() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.typeParameter_ = typeParameter_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.underlyingType_ = underlyingType_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + result.underlyingTypeId_ = underlyingTypeId_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000010; + } + result.expandedType_ = expandedType_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; + } + result.expandedTypeId_ = expandedTypeId_; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.annotation_ = annotation_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.versionRequirement_ = versionRequirement_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasName()) { + setName(other.getName()); + } + if (!other.typeParameter_.isEmpty()) { + if (typeParameter_.isEmpty()) { + typeParameter_ = other.typeParameter_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureTypeParameterIsMutable(); + typeParameter_.addAll(other.typeParameter_); + } + + } + if (other.hasUnderlyingType()) { + mergeUnderlyingType(other.getUnderlyingType()); + } + if (other.hasUnderlyingTypeId()) { + setUnderlyingTypeId(other.getUnderlyingTypeId()); + } + if (other.hasExpandedType()) { + mergeExpandedType(other.getExpandedType()); + } + if (other.hasExpandedTypeId()) { + setExpandedTypeId(other.getExpandedTypeId()); + } + if (!other.annotation_.isEmpty()) { + if (annotation_.isEmpty()) { + annotation_ = other.annotation_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureAnnotationIsMutable(); + annotation_.addAll(other.annotation_); + } + + } + if (!other.versionRequirement_.isEmpty()) { + if (versionRequirement_.isEmpty()) { + versionRequirement_ = other.versionRequirement_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureVersionRequirementIsMutable(); + versionRequirement_.addAll(other.versionRequirement_); + } + + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + + return false; + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + + return false; + } + } + if (hasUnderlyingType()) { + if (!getUnderlyingType().isInitialized()) { + + return false; + } + } + if (hasExpandedType()) { + if (!getExpandedType().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int flags_ = 6; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 6; + + return this; + } + + private int name_ ; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + /** + * required int32 name = 2; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000002; + name_ = value; + + return this; + } + /** + * required int32 name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = 0; + + return this; + } + + private java.util.List typeParameter_ = + java.util.Collections.emptyList(); + private void ensureTypeParameterIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + typeParameter_ = new java.util.ArrayList(typeParameter_); + bitField0_ |= 0x00000004; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public java.util.List getTypeParameterList() { + return java.util.Collections.unmodifiableList(typeParameter_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addTypeParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addAllTypeParameter( + java.lang.Iterable values) { + ensureTypeParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeParameter_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder clearTypeParameter() { + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder removeTypeParameter(int index) { + ensureTypeParameterIsMutable(); + typeParameter_.remove(index); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public boolean hasUnderlyingType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType() { + return underlyingType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public Builder setUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + underlyingType_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public Builder setUnderlyingType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + underlyingType_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public Builder mergeUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + underlyingType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + underlyingType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(underlyingType_).mergeFrom(value).buildPartial(); + } else { + underlyingType_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public Builder clearUnderlyingType() { + underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + private int underlyingTypeId_ ; + /** + * optional int32 underlying_type_id = 5; + */ + public boolean hasUnderlyingTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 underlying_type_id = 5; + */ + public int getUnderlyingTypeId() { + return underlyingTypeId_; + } + /** + * optional int32 underlying_type_id = 5; + */ + public Builder setUnderlyingTypeId(int value) { + bitField0_ |= 0x00000010; + underlyingTypeId_ = value; + + return this; + } + /** + * optional int32 underlying_type_id = 5; + */ + public Builder clearUnderlyingTypeId() { + bitField0_ = (bitField0_ & ~0x00000010); + underlyingTypeId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public boolean hasExpandedType() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType() { + return expandedType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public Builder setExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + expandedType_ = value; + + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public Builder setExpandedType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + expandedType_ = builderForValue.build(); + + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public Builder mergeExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000020) == 0x00000020) && + expandedType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + expandedType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(expandedType_).mergeFrom(value).buildPartial(); + } else { + expandedType_ = value; + } + + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public Builder clearExpandedType() { + expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + private int expandedTypeId_ ; + /** + * optional int32 expanded_type_id = 7; + */ + public boolean hasExpandedTypeId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 expanded_type_id = 7; + */ + public int getExpandedTypeId() { + return expandedTypeId_; + } + /** + * optional int32 expanded_type_id = 7; + */ + public Builder setExpandedTypeId(int value) { + bitField0_ |= 0x00000040; + expandedTypeId_ = value; + + return this; + } + /** + * optional int32 expanded_type_id = 7; + */ + public Builder clearExpandedTypeId() { + bitField0_ = (bitField0_ & ~0x00000040); + expandedTypeId_ = 0; + + return this; + } + + private java.util.List annotation_ = + java.util.Collections.emptyList(); + private void ensureAnnotationIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + annotation_ = new java.util.ArrayList(annotation_); + bitField0_ |= 0x00000080; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public java.util.List getAnnotationList() { + return java.util.Collections.unmodifiableList(annotation_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAnnotation( + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAllAnnotation( + java.lang.Iterable values) { + ensureAnnotationIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, annotation_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder clearAnnotation() { + annotation_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder removeAnnotation(int index) { + ensureAnnotationIsMutable(); + annotation_.remove(index); + + return this; + } + + private java.util.List versionRequirement_ = java.util.Collections.emptyList(); + private void ensureVersionRequirementIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + versionRequirement_ = new java.util.ArrayList(versionRequirement_); + bitField0_ |= 0x00000100; + } + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public java.util.List + getVersionRequirementList() { + return java.util.Collections.unmodifiableList(versionRequirement_); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder setVersionRequirement( + int index, int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.set(index, value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeAlias) + } + + static { + defaultInstance = new TypeAlias(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeAlias) + } + + public interface EnumEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.EnumEntry) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional int32 name = 1; + */ + boolean hasName(); + /** + * optional int32 name = 1; + */ + int getName(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} + */ + public static final class EnumEntry extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + EnumEntry> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.EnumEntry) + EnumEntryOrBuilder { + // Use EnumEntry.newBuilder() to construct. + private EnumEntry(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private EnumEntry(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final EnumEntry defaultInstance; + public static EnumEntry getDefaultInstance() { + return defaultInstance; + } + + public EnumEntry getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private EnumEntry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + name_ = input.readInt32(); + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public EnumEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnumEntry(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private int name_; + /** + * optional int32 name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 name = 1; + */ + public int getName() { + return name_; + } + + private void initFields() { + name_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, name_); + } + extensionWriter.writeUntil(200, output); + output.writeRawBytes(unknownFields); + } + + 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, name_); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.EnumEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry 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.metadata.ProtoBuf.EnumEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry 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.metadata.ProtoBuf.EnumEntry prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.EnumEntry) + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntryOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry build() { + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry result = new org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.getDefaultInstance()) return this; + if (other.hasName()) { + setName(other.getName()); + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int name_ ; + /** + * optional int32 name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 name = 1; + */ + public int getName() { + return name_; + } + /** + * optional int32 name = 1; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000001; + name_ = value; + + return this; + } + /** + * optional int32 name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.EnumEntry) + } + + static { + defaultInstance = new EnumEntry(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.EnumEntry) + } + + public interface VersionRequirementOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional int32 version = 1; + * + *
+     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+     * (patch << 7) + (minor << 3) + major
+     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+     * 
+ */ + boolean hasVersion(); + /** + * optional int32 version = 1; + * + *
+     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+     * (patch << 7) + (minor << 3) + major
+     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+     * 
+ */ + int getVersion(); + + /** + * optional int32 version_full = 2; + * + *
+     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+     * (patch << 16) + (minor << 8) + major
+     * 
+ */ + boolean hasVersionFull(); + /** + * optional int32 version_full = 2; + * + *
+     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+     * (patch << 16) + (minor << 8) + major
+     * 
+ */ + int getVersionFull(); + + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+     * Level of the reported diagnostic
+     * 
+ */ + boolean hasLevel(); + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+     * Level of the reported diagnostic
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel(); + + /** + * optional int32 error_code = 4; + * + *
+     * Error code, to be looked up on the website
+     * 
+ */ + boolean hasErrorCode(); + /** + * optional int32 error_code = 4; + * + *
+     * Error code, to be looked up on the website
+     * 
+ */ + int getErrorCode(); + + /** + * optional int32 message = 5; + * + *
+     * Diagnostic message
+     * 
+ */ + boolean hasMessage(); + /** + * optional int32 message = 5; + * + *
+     * Diagnostic message
+     * 
+ */ + int getMessage(); + + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+     * 
+ */ + boolean hasVersionKind(); + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} + */ + public static final class VersionRequirement extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) + VersionRequirementOrBuilder { + // Use VersionRequirement.newBuilder() to construct. + private VersionRequirement(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private VersionRequirement(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final VersionRequirement defaultInstance; + public static VersionRequirement getDefaultInstance() { + return defaultInstance; + } + + public VersionRequirement getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private VersionRequirement( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + version_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + versionFull_ = input.readInt32(); + break; + } + case 24: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level value = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000004; + level_ = value; + } + break; + } + case 32: { + bitField0_ |= 0x00000008; + errorCode_ = input.readInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + message_ = input.readInt32(); + break; + } + case 48: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind value = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000020; + versionKind_ = value; + } + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public VersionRequirement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VersionRequirement(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level} + */ + public enum Level + implements com.google.protobuf.Internal.EnumLite { + /** + * WARNING = 0; + */ + WARNING(0, 0), + /** + * ERROR = 1; + */ + ERROR(1, 1), + /** + * HIDDEN = 2; + */ + HIDDEN(2, 2), + ; + + /** + * WARNING = 0; + */ + public static final int WARNING_VALUE = 0; + /** + * ERROR = 1; + */ + public static final int ERROR_VALUE = 1; + /** + * HIDDEN = 2; + */ + public static final int HIDDEN_VALUE = 2; + + + public final int getNumber() { return value; } + + public static Level valueOf(int value) { + switch (value) { + case 0: return WARNING; + case 1: return ERROR; + case 2: return HIDDEN; + 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 Level findValueByNumber(int number) { + return Level.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Level(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level) + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind} + */ + public enum VersionKind + implements com.google.protobuf.Internal.EnumLite { + /** + * LANGUAGE_VERSION = 0; + */ + LANGUAGE_VERSION(0, 0), + /** + * COMPILER_VERSION = 1; + */ + COMPILER_VERSION(1, 1), + /** + * API_VERSION = 2; + */ + API_VERSION(2, 2), + ; + + /** + * LANGUAGE_VERSION = 0; + */ + public static final int LANGUAGE_VERSION_VALUE = 0; + /** + * COMPILER_VERSION = 1; + */ + public static final int COMPILER_VERSION_VALUE = 1; + /** + * API_VERSION = 2; + */ + public static final int API_VERSION_VALUE = 2; + + + public final int getNumber() { return value; } + + public static VersionKind valueOf(int value) { + switch (value) { + case 0: return LANGUAGE_VERSION; + case 1: return COMPILER_VERSION; + case 2: return API_VERSION; + 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 VersionKind findValueByNumber(int number) { + return VersionKind.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private VersionKind(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind) + } + + private int bitField0_; + public static final int VERSION_FIELD_NUMBER = 1; + private int version_; + /** + * optional int32 version = 1; + * + *
+     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+     * (patch << 7) + (minor << 3) + major
+     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+     * 
+ */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 version = 1; + * + *
+     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+     * (patch << 7) + (minor << 3) + major
+     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+     * 
+ */ + public int getVersion() { + return version_; + } + + public static final int VERSION_FULL_FIELD_NUMBER = 2; + private int versionFull_; + /** + * optional int32 version_full = 2; + * + *
+     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+     * (patch << 16) + (minor << 8) + major
+     * 
+ */ + public boolean hasVersionFull() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 version_full = 2; + * + *
+     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+     * (patch << 16) + (minor << 8) + major
+     * 
+ */ + public int getVersionFull() { + return versionFull_; + } + + public static final int LEVEL_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level level_; + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+     * Level of the reported diagnostic
+     * 
+ */ + public boolean hasLevel() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+     * Level of the reported diagnostic
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel() { + return level_; + } + + public static final int ERROR_CODE_FIELD_NUMBER = 4; + private int errorCode_; + /** + * optional int32 error_code = 4; + * + *
+     * Error code, to be looked up on the website
+     * 
+ */ + public boolean hasErrorCode() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 error_code = 4; + * + *
+     * Error code, to be looked up on the website
+     * 
+ */ + public int getErrorCode() { + return errorCode_; + } + + public static final int MESSAGE_FIELD_NUMBER = 5; + private int message_; + /** + * optional int32 message = 5; + * + *
+     * Diagnostic message
+     * 
+ */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 message = 5; + * + *
+     * Diagnostic message
+     * 
+ */ + public int getMessage() { + return message_; + } + + public static final int VERSION_KIND_FIELD_NUMBER = 6; + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind versionKind_; + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+     * 
+ */ + public boolean hasVersionKind() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind() { + return versionKind_; + } + + private void initFields() { + version_ = 0; + versionFull_ = 0; + level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + errorCode_ = 0; + message_ = 0; + versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, versionFull_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, level_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, errorCode_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, message_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeEnum(6, versionKind_.getNumber()); + } + output.writeRawBytes(unknownFields); + } + + 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, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, versionFull_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, level_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, errorCode_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, message_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, versionKind_.getNumber()); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.VersionRequirement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement 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.metadata.ProtoBuf.VersionRequirement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement 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.metadata.ProtoBuf.VersionRequirement prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + version_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + versionFull_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + bitField0_ = (bitField0_ & ~0x00000004); + errorCode_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + message_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement build() { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement result = new org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.version_ = version_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.versionFull_ = versionFull_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.level_ = level_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.errorCode_ = errorCode_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.message_ = message_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.versionKind_ = versionKind_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.getDefaultInstance()) return this; + if (other.hasVersion()) { + setVersion(other.getVersion()); + } + if (other.hasVersionFull()) { + setVersionFull(other.getVersionFull()); + } + if (other.hasLevel()) { + setLevel(other.getLevel()); + } + if (other.hasErrorCode()) { + setErrorCode(other.getErrorCode()); + } + if (other.hasMessage()) { + setMessage(other.getMessage()); + } + if (other.hasVersionKind()) { + setVersionKind(other.getVersionKind()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + 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.metadata.ProtoBuf.VersionRequirement parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int version_ ; + /** + * optional int32 version = 1; + * + *
+       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+       * (patch << 7) + (minor << 3) + major
+       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+       * 
+ */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 version = 1; + * + *
+       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+       * (patch << 7) + (minor << 3) + major
+       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+       * 
+ */ + public int getVersion() { + return version_; + } + /** + * optional int32 version = 1; + * + *
+       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+       * (patch << 7) + (minor << 3) + major
+       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+       * 
+ */ + public Builder setVersion(int value) { + bitField0_ |= 0x00000001; + version_ = value; + + return this; + } + /** + * optional int32 version = 1; + * + *
+       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+       * (patch << 7) + (minor << 3) + major
+       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+       * 
+ */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 0; + + return this; + } + + private int versionFull_ ; + /** + * optional int32 version_full = 2; + * + *
+       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+       * (patch << 16) + (minor << 8) + major
+       * 
+ */ + public boolean hasVersionFull() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 version_full = 2; + * + *
+       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+       * (patch << 16) + (minor << 8) + major
+       * 
+ */ + public int getVersionFull() { + return versionFull_; + } + /** + * optional int32 version_full = 2; + * + *
+       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+       * (patch << 16) + (minor << 8) + major
+       * 
+ */ + public Builder setVersionFull(int value) { + bitField0_ |= 0x00000002; + versionFull_ = value; + + return this; + } + /** + * optional int32 version_full = 2; + * + *
+       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+       * (patch << 16) + (minor << 8) + major
+       * 
+ */ + public Builder clearVersionFull() { + bitField0_ = (bitField0_ & ~0x00000002); + versionFull_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+       * Level of the reported diagnostic
+       * 
+ */ + public boolean hasLevel() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+       * Level of the reported diagnostic
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel() { + return level_; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+       * Level of the reported diagnostic
+       * 
+ */ + public Builder setLevel(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + level_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+       * Level of the reported diagnostic
+       * 
+ */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + + return this; + } + + private int errorCode_ ; + /** + * optional int32 error_code = 4; + * + *
+       * Error code, to be looked up on the website
+       * 
+ */ + public boolean hasErrorCode() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 error_code = 4; + * + *
+       * Error code, to be looked up on the website
+       * 
+ */ + public int getErrorCode() { + return errorCode_; + } + /** + * optional int32 error_code = 4; + * + *
+       * Error code, to be looked up on the website
+       * 
+ */ + public Builder setErrorCode(int value) { + bitField0_ |= 0x00000008; + errorCode_ = value; + + return this; + } + /** + * optional int32 error_code = 4; + * + *
+       * Error code, to be looked up on the website
+       * 
+ */ + public Builder clearErrorCode() { + bitField0_ = (bitField0_ & ~0x00000008); + errorCode_ = 0; + + return this; + } + + private int message_ ; + /** + * optional int32 message = 5; + * + *
+       * Diagnostic message
+       * 
+ */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 message = 5; + * + *
+       * Diagnostic message
+       * 
+ */ + public int getMessage() { + return message_; + } + /** + * optional int32 message = 5; + * + *
+       * Diagnostic message
+       * 
+ */ + public Builder setMessage(int value) { + bitField0_ |= 0x00000010; + message_ = value; + + return this; + } + /** + * optional int32 message = 5; + * + *
+       * Diagnostic message
+       * 
+ */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000010); + message_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+       * 
+ */ + public boolean hasVersionKind() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind() { + return versionKind_; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+       * 
+ */ + public Builder setVersionKind(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + versionKind_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+       * 
+ */ + public Builder clearVersionKind() { + bitField0_ = (bitField0_ & ~0x00000020); + versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) + } + + static { + defaultInstance = new VersionRequirement(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) + } + + public interface VersionRequirementTableOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + java.util.List + getRequirementList(); + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + int getRequirementCount(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} + */ + public static final class VersionRequirementTable extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + VersionRequirementTableOrBuilder { + // Use VersionRequirementTable.newBuilder() to construct. + private VersionRequirementTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private VersionRequirementTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final VersionRequirementTable defaultInstance; + public static VersionRequirementTable getDefaultInstance() { + return defaultInstance; + } + + public VersionRequirementTable getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private VersionRequirementTable( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + requirement_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.PARSER, extensionRegistry)); + 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)) { + requirement_ = java.util.Collections.unmodifiableList(requirement_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public VersionRequirementTable parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VersionRequirementTable(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public static final int REQUIREMENT_FIELD_NUMBER = 1; + private java.util.List requirement_; + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public java.util.List getRequirementList() { + return requirement_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public java.util.List + getRequirementOrBuilderList() { + return requirement_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public int getRequirementCount() { + return requirement_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index) { + return requirement_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementOrBuilder getRequirementOrBuilder( + int index) { + return requirement_.get(index); + } + + private void initFields() { + requirement_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < requirement_.size(); i++) { + output.writeMessage(1, requirement_.get(i)); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < requirement_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, requirement_.get(i)); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.VersionRequirementTable parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable 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.metadata.ProtoBuf.VersionRequirementTable parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable 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.metadata.ProtoBuf.VersionRequirementTable prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTableOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + requirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable build() { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable(this); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + requirement_ = java.util.Collections.unmodifiableList(requirement_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.requirement_ = requirement_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) return this; + if (!other.requirement_.isEmpty()) { + if (requirement_.isEmpty()) { + requirement_ = other.requirement_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRequirementIsMutable(); + requirement_.addAll(other.requirement_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + 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.metadata.ProtoBuf.VersionRequirementTable parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List requirement_ = + java.util.Collections.emptyList(); + private void ensureRequirementIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + requirement_ = new java.util.ArrayList(requirement_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public java.util.List getRequirementList() { + return java.util.Collections.unmodifiableList(requirement_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public int getRequirementCount() { + return requirement_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index) { + return requirement_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder setRequirement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequirementIsMutable(); + requirement_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder setRequirement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + ensureRequirementIsMutable(); + requirement_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder addRequirement(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequirementIsMutable(); + requirement_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder addRequirement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequirementIsMutable(); + requirement_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder addRequirement( + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + ensureRequirementIsMutable(); + requirement_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder addRequirement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + ensureRequirementIsMutable(); + requirement_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder addAllRequirement( + java.lang.Iterable values) { + ensureRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, requirement_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder clearRequirement() { + requirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + */ + public Builder removeRequirement(int index) { + ensureRequirementIsMutable(); + requirement_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + } + + static { + defaultInstance = new VersionRequirementTable(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + } + + public interface PackageFragmentOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.PackageFragment) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + boolean hasStrings(); + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.StringTable getStrings(); + + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + boolean hasQualifiedNames(); + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable getQualifiedNames(); + + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + boolean hasPackage(); + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Package getPackage(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + java.util.List + getClass_List(); + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Class getClass_(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + int getClass_Count(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.PackageFragment} + * + *
+   * A part of the package, which is used to serialize .kjsm/.meta.js, .kotlin_builtins and .kotlin_metadata files.
+   * Is not used in the JVM back-end
+   * 
+ */ + public static final class PackageFragment extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + PackageFragment> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.PackageFragment) + PackageFragmentOrBuilder { + // Use PackageFragment.newBuilder() to construct. + private PackageFragment(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private PackageFragment(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final PackageFragment defaultInstance; + public static PackageFragment getDefaultInstance() { + return defaultInstance; + } + + public PackageFragment getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private PackageFragment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = strings_.toBuilder(); + } + strings_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(strings_); + strings_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = qualifiedNames_.toBuilder(); + } + qualifiedNames_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(qualifiedNames_); + qualifiedNames_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: { + org.jetbrains.kotlin.metadata.ProtoBuf.Package.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = package_.toBuilder(); + } + package_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Package.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(package_); + package_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + class__ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + class__.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Class.PARSER, extensionRegistry)); + 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)) { + class__ = java.util.Collections.unmodifiableList(class__); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public PackageFragment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PackageFragment(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int STRINGS_FIELD_NUMBER = 1; + private org.jetbrains.kotlin.metadata.ProtoBuf.StringTable strings_; + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + public boolean hasStrings() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable getStrings() { + return strings_; + } + + public static final int QUALIFIED_NAMES_FIELD_NUMBER = 2; + private org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable qualifiedNames_; + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + public boolean hasQualifiedNames() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable getQualifiedNames() { + return qualifiedNames_; + } + + public static final int PACKAGE_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Package package_; + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + public boolean hasPackage() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Package getPackage() { + return package_; + } + + public static final int CLASS_FIELD_NUMBER = 4; + private java.util.List class__; + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public java.util.List getClass_List() { + return class__; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public java.util.List + getClass_OrBuilderList() { + return class__; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public int getClass_Count() { + return class__.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Class getClass_(int index) { + return class__.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ClassOrBuilder getClass_OrBuilder( + int index) { + return class__.get(index); + } + + private void initFields() { + strings_ = org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); + qualifiedNames_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); + package_ = org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); + class__ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (hasQualifiedNames()) { + if (!getQualifiedNames().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasPackage()) { + if (!getPackage().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getClass_Count(); i++) { + if (!getClass_(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, strings_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, qualifiedNames_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(3, package_); + } + for (int i = 0; i < class__.size(); i++) { + output.writeMessage(4, class__.get(i)); + } + extensionWriter.writeUntil(200, output); + output.writeRawBytes(unknownFields); + } + + 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 + .computeMessageSize(1, strings_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, qualifiedNames_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, package_); + } + for (int i = 0; i < class__.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, class__.get(i)); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.PackageFragment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment 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.metadata.ProtoBuf.PackageFragment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment 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.metadata.ProtoBuf.PackageFragment prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.PackageFragment} + * + *
+     * A part of the package, which is used to serialize .kjsm/.meta.js, .kotlin_builtins and .kotlin_metadata files.
+     * Is not used in the JVM back-end
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.PackageFragment) + org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragmentOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + strings_ = org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + qualifiedNames_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + package_ = org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + class__ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment build() { + org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment result = new org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.strings_ = strings_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.qualifiedNames_ = qualifiedNames_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.package_ = package_; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + class__ = java.util.Collections.unmodifiableList(class__); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.class__ = class__; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment.getDefaultInstance()) return this; + if (other.hasStrings()) { + mergeStrings(other.getStrings()); + } + if (other.hasQualifiedNames()) { + mergeQualifiedNames(other.getQualifiedNames()); + } + if (other.hasPackage()) { + mergePackage(other.getPackage()); + } + if (!other.class__.isEmpty()) { + if (class__.isEmpty()) { + class__ = other.class__; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureClass_IsMutable(); + class__.addAll(other.class__); + } + + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (hasQualifiedNames()) { + if (!getQualifiedNames().isInitialized()) { + + return false; + } + } + if (hasPackage()) { + if (!getPackage().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getClass_Count(); i++) { + if (!getClass_(i).isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private org.jetbrains.kotlin.metadata.ProtoBuf.StringTable strings_ = org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + public boolean hasStrings() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable getStrings() { + return strings_; + } + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + public Builder setStrings(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable value) { + if (value == null) { + throw new NullPointerException(); + } + strings_ = value; + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + public Builder setStrings( + org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.Builder builderForValue) { + strings_ = builderForValue.build(); + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + public Builder mergeStrings(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable value) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + strings_ != org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance()) { + strings_ = + org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.newBuilder(strings_).mergeFrom(value).buildPartial(); + } else { + strings_ = value; + } + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; + */ + public Builder clearStrings() { + strings_ = org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable qualifiedNames_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + public boolean hasQualifiedNames() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable getQualifiedNames() { + return qualifiedNames_; + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + public Builder setQualifiedNames(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable value) { + if (value == null) { + throw new NullPointerException(); + } + qualifiedNames_ = value; + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + public Builder setQualifiedNames( + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.Builder builderForValue) { + qualifiedNames_ = builderForValue.build(); + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + public Builder mergeQualifiedNames(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable value) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + qualifiedNames_ != org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance()) { + qualifiedNames_ = + org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.newBuilder(qualifiedNames_).mergeFrom(value).buildPartial(); + } else { + qualifiedNames_ = value; + } + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; + */ + public Builder clearQualifiedNames() { + qualifiedNames_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Package package_ = org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + public boolean hasPackage() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Package getPackage() { + return package_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + public Builder setPackage(org.jetbrains.kotlin.metadata.ProtoBuf.Package value) { + if (value == null) { + throw new NullPointerException(); + } + package_ = value; + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + public Builder setPackage( + org.jetbrains.kotlin.metadata.ProtoBuf.Package.Builder builderForValue) { + package_ = builderForValue.build(); + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + public Builder mergePackage(org.jetbrains.kotlin.metadata.ProtoBuf.Package value) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + package_ != org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance()) { + package_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Package.newBuilder(package_).mergeFrom(value).buildPartial(); + } else { + package_ = value; + } + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Package package = 3; + */ + public Builder clearPackage() { + package_ = org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + private java.util.List class__ = + java.util.Collections.emptyList(); + private void ensureClass_IsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + class__ = new java.util.ArrayList(class__); + bitField0_ |= 0x00000008; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public java.util.List getClass_List() { + return java.util.Collections.unmodifiableList(class__); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public int getClass_Count() { + return class__.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Class getClass_(int index) { + return class__.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder setClass_( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClass_IsMutable(); + class__.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder setClass_( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class.Builder builderForValue) { + ensureClass_IsMutable(); + class__.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder addClass_(org.jetbrains.kotlin.metadata.ProtoBuf.Class value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClass_IsMutable(); + class__.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder addClass_( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClass_IsMutable(); + class__.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder addClass_( + org.jetbrains.kotlin.metadata.ProtoBuf.Class.Builder builderForValue) { + ensureClass_IsMutable(); + class__.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder addClass_( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class.Builder builderForValue) { + ensureClass_IsMutable(); + class__.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder addAllClass_( + java.lang.Iterable values) { + ensureClass_IsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, class__); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder clearClass_() { + class__ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + */ + public Builder removeClass_(int index) { + ensureClass_IsMutable(); + class__.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.PackageFragment) + } + + static { + defaultInstance = new PackageFragment(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.PackageFragment) + } + + public interface ContractOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Contract) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + java.util.List + getEffectList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Effect getEffect(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + int getEffectCount(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Contract} + */ + public static final class Contract extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Contract) + ContractOrBuilder { + // Use Contract.newBuilder() to construct. + private Contract(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Contract(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Contract defaultInstance; + public static Contract getDefaultInstance() { + return defaultInstance; + } + + public Contract getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Contract( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + effect_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + effect_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Effect.PARSER, extensionRegistry)); + 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)) { + effect_ = java.util.Collections.unmodifiableList(effect_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Contract parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Contract(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public static final int EFFECT_FIELD_NUMBER = 1; + private java.util.List effect_; + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public java.util.List getEffectList() { + return effect_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public java.util.List + getEffectOrBuilderList() { + return effect_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public int getEffectCount() { + return effect_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect getEffect(int index) { + return effect_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.EffectOrBuilder getEffectOrBuilder( + int index) { + return effect_.get(index); + } + + private void initFields() { + effect_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getEffectCount(); i++) { + if (!getEffect(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < effect_.size(); i++) { + output.writeMessage(1, effect_.get(i)); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < effect_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, effect_.get(i)); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.Contract parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract 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.metadata.ProtoBuf.Contract parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract 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.metadata.ProtoBuf.Contract prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Contract} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.Contract, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Contract) + org.jetbrains.kotlin.metadata.ProtoBuf.ContractOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Contract.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + effect_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Contract build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Contract result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Contract buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Contract result = new org.jetbrains.kotlin.metadata.ProtoBuf.Contract(this); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + effect_ = java.util.Collections.unmodifiableList(effect_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.effect_ = effect_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Contract other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance()) return this; + if (!other.effect_.isEmpty()) { + if (effect_.isEmpty()) { + effect_ = other.effect_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEffectIsMutable(); + effect_.addAll(other.effect_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getEffectCount(); i++) { + if (!getEffect(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Contract parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Contract) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List effect_ = + java.util.Collections.emptyList(); + private void ensureEffectIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + effect_ = new java.util.ArrayList(effect_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public java.util.List getEffectList() { + return java.util.Collections.unmodifiableList(effect_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public int getEffectCount() { + return effect_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect getEffect(int index) { + return effect_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder setEffect( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Effect value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEffectIsMutable(); + effect_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder setEffect( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Effect.Builder builderForValue) { + ensureEffectIsMutable(); + effect_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder addEffect(org.jetbrains.kotlin.metadata.ProtoBuf.Effect value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEffectIsMutable(); + effect_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder addEffect( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Effect value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEffectIsMutable(); + effect_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder addEffect( + org.jetbrains.kotlin.metadata.ProtoBuf.Effect.Builder builderForValue) { + ensureEffectIsMutable(); + effect_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder addEffect( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Effect.Builder builderForValue) { + ensureEffectIsMutable(); + effect_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder addAllEffect( + java.lang.Iterable values) { + ensureEffectIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, effect_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder clearEffect() { + effect_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; + */ + public Builder removeEffect(int index) { + ensureEffectIsMutable(); + effect_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Contract) + } + + static { + defaultInstance = new Contract(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Contract) + } + + public interface EffectOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Effect) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; + */ + boolean hasEffectType(); + /** + * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType getEffectType(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + java.util.List + getEffectConstructorArgumentList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Expression getEffectConstructorArgument(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + int getEffectConstructorArgumentCount(); + + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+     * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+     * is given by other fields in this message, and 'Expression' is stored in this field.
+     * 
+ */ + boolean hasConclusionOfConditionalEffect(); + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+     * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+     * is given by other fields in this message, and 'Expression' is stored in this field.
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.Expression getConclusionOfConditionalEffect(); + + /** + * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; + */ + boolean hasKind(); + /** + * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind getKind(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Effect} + */ + public static final class Effect extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Effect) + EffectOrBuilder { + // Use Effect.newBuilder() to construct. + private Effect(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Effect(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Effect defaultInstance; + public static Effect getDefaultInstance() { + return defaultInstance; + } + + public Effect getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Effect( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType value = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000001; + effectType_ = value; + } + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + effectConstructorArgument_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + effectConstructorArgument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.PARSER, extensionRegistry)); + break; + } + case 26: { + org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = conclusionOfConditionalEffect_.toBuilder(); + } + conclusionOfConditionalEffect_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(conclusionOfConditionalEffect_); + conclusionOfConditionalEffect_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 32: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind value = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000004; + kind_ = value; + } + 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_ & 0x00000002) == 0x00000002)) { + effectConstructorArgument_ = java.util.Collections.unmodifiableList(effectConstructorArgument_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Effect parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Effect(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.Effect.EffectType} + * + *
+     * This enum controls which effect this message contains and how 'effectConstructorArguments'
+     * should be parsed.
+     * Each enum value documented in the following syntax: "EffectName(arg1: T1, arg2: T2, ...)"
+     * Those arguments are expected to be found in 'effectConstructorArguments' in exactly the same
+     * order and amount as defined by signature, otherwise message should be dropped.
+     * 
+ */ + public enum EffectType + implements com.google.protobuf.Internal.EnumLite { + /** + * RETURNS_CONSTANT = 0; + * + *
+       * Returns(value: ConstantValue?)
+       * 
+ */ + RETURNS_CONSTANT(0, 0), + /** + * CALLS = 1; + * + *
+       * CallsInPlace(callable: ParameterReference)
+       * Additionally, InvocationKind in the field 'kind' may be provided to define exact amount of invocations.
+       * 
+ */ + CALLS(1, 1), + /** + * RETURNS_NOT_NULL = 2; + * + *
+       * ReturnsNotNull()
+       * 
+ */ + RETURNS_NOT_NULL(2, 2), + ; + + /** + * RETURNS_CONSTANT = 0; + * + *
+       * Returns(value: ConstantValue?)
+       * 
+ */ + public static final int RETURNS_CONSTANT_VALUE = 0; + /** + * CALLS = 1; + * + *
+       * CallsInPlace(callable: ParameterReference)
+       * Additionally, InvocationKind in the field 'kind' may be provided to define exact amount of invocations.
+       * 
+ */ + public static final int CALLS_VALUE = 1; + /** + * RETURNS_NOT_NULL = 2; + * + *
+       * ReturnsNotNull()
+       * 
+ */ + public static final int RETURNS_NOT_NULL_VALUE = 2; + + + public final int getNumber() { return value; } + + public static EffectType valueOf(int value) { + switch (value) { + case 0: return RETURNS_CONSTANT; + case 1: return CALLS; + case 2: return RETURNS_NOT_NULL; + 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 EffectType findValueByNumber(int number) { + return EffectType.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private EffectType(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Effect.EffectType) + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.Effect.InvocationKind} + */ + public enum InvocationKind + implements com.google.protobuf.Internal.EnumLite { + /** + * AT_MOST_ONCE = 0; + */ + AT_MOST_ONCE(0, 0), + /** + * EXACTLY_ONCE = 1; + */ + EXACTLY_ONCE(1, 1), + /** + * AT_LEAST_ONCE = 2; + */ + AT_LEAST_ONCE(2, 2), + ; + + /** + * AT_MOST_ONCE = 0; + */ + public static final int AT_MOST_ONCE_VALUE = 0; + /** + * EXACTLY_ONCE = 1; + */ + public static final int EXACTLY_ONCE_VALUE = 1; + /** + * AT_LEAST_ONCE = 2; + */ + public static final int AT_LEAST_ONCE_VALUE = 2; + + + public final int getNumber() { return value; } + + public static InvocationKind valueOf(int value) { + switch (value) { + case 0: return AT_MOST_ONCE; + case 1: return EXACTLY_ONCE; + case 2: return AT_LEAST_ONCE; + 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 InvocationKind findValueByNumber(int number) { + return InvocationKind.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private InvocationKind(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Effect.InvocationKind) + } + + private int bitField0_; + public static final int EFFECT_TYPE_FIELD_NUMBER = 1; + private org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType effectType_; + /** + * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; + */ + public boolean hasEffectType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType getEffectType() { + return effectType_; + } + + public static final int EFFECT_CONSTRUCTOR_ARGUMENT_FIELD_NUMBER = 2; + private java.util.List effectConstructorArgument_; + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public java.util.List getEffectConstructorArgumentList() { + return effectConstructorArgument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public java.util.List + getEffectConstructorArgumentOrBuilderList() { + return effectConstructorArgument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public int getEffectConstructorArgumentCount() { + return effectConstructorArgument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getEffectConstructorArgument(int index) { + return effectConstructorArgument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder getEffectConstructorArgumentOrBuilder( + int index) { + return effectConstructorArgument_.get(index); + } + + public static final int CONCLUSION_OF_CONDITIONAL_EFFECT_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Expression conclusionOfConditionalEffect_; + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+     * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+     * is given by other fields in this message, and 'Expression' is stored in this field.
+     * 
+ */ + public boolean hasConclusionOfConditionalEffect() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+     * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+     * is given by other fields in this message, and 'Expression' is stored in this field.
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getConclusionOfConditionalEffect() { + return conclusionOfConditionalEffect_; + } + + public static final int KIND_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind kind_; + /** + * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; + */ + public boolean hasKind() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind getKind() { + return kind_; + } + + private void initFields() { + effectType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; + effectConstructorArgument_ = java.util.Collections.emptyList(); + conclusionOfConditionalEffect_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getEffectConstructorArgumentCount(); i++) { + if (!getEffectConstructorArgument(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasConclusionOfConditionalEffect()) { + if (!getConclusionOfConditionalEffect().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, effectType_.getNumber()); + } + for (int i = 0; i < effectConstructorArgument_.size(); i++) { + output.writeMessage(2, effectConstructorArgument_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(3, conclusionOfConditionalEffect_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(4, kind_.getNumber()); + } + output.writeRawBytes(unknownFields); + } + + 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 + .computeEnumSize(1, effectType_.getNumber()); + } + for (int i = 0; i < effectConstructorArgument_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, effectConstructorArgument_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, conclusionOfConditionalEffect_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, kind_.getNumber()); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.Effect parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect 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.metadata.ProtoBuf.Effect parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect 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.metadata.ProtoBuf.Effect prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Effect} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.Effect, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Effect) + org.jetbrains.kotlin.metadata.ProtoBuf.EffectOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Effect.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + effectType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; + bitField0_ = (bitField0_ & ~0x00000001); + effectConstructorArgument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + conclusionOfConditionalEffect_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Effect.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Effect result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Effect result = new org.jetbrains.kotlin.metadata.ProtoBuf.Effect(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.effectType_ = effectType_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + effectConstructorArgument_ = java.util.Collections.unmodifiableList(effectConstructorArgument_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.effectConstructorArgument_ = effectConstructorArgument_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.conclusionOfConditionalEffect_ = conclusionOfConditionalEffect_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.kind_ = kind_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Effect other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Effect.getDefaultInstance()) return this; + if (other.hasEffectType()) { + setEffectType(other.getEffectType()); + } + if (!other.effectConstructorArgument_.isEmpty()) { + if (effectConstructorArgument_.isEmpty()) { + effectConstructorArgument_ = other.effectConstructorArgument_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEffectConstructorArgumentIsMutable(); + effectConstructorArgument_.addAll(other.effectConstructorArgument_); + } + + } + if (other.hasConclusionOfConditionalEffect()) { + mergeConclusionOfConditionalEffect(other.getConclusionOfConditionalEffect()); + } + if (other.hasKind()) { + setKind(other.getKind()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getEffectConstructorArgumentCount(); i++) { + if (!getEffectConstructorArgument(i).isInitialized()) { + + return false; + } + } + if (hasConclusionOfConditionalEffect()) { + if (!getConclusionOfConditionalEffect().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Effect parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Effect) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType effectType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; + /** + * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; + */ + public boolean hasEffectType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType getEffectType() { + return effectType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; + */ + public Builder setEffectType(org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + effectType_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; + */ + public Builder clearEffectType() { + bitField0_ = (bitField0_ & ~0x00000001); + effectType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; + + return this; + } + + private java.util.List effectConstructorArgument_ = + java.util.Collections.emptyList(); + private void ensureEffectConstructorArgumentIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + effectConstructorArgument_ = new java.util.ArrayList(effectConstructorArgument_); + bitField0_ |= 0x00000002; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public java.util.List getEffectConstructorArgumentList() { + return java.util.Collections.unmodifiableList(effectConstructorArgument_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public int getEffectConstructorArgumentCount() { + return effectConstructorArgument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getEffectConstructorArgument(int index) { + return effectConstructorArgument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder setEffectConstructorArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEffectConstructorArgumentIsMutable(); + effectConstructorArgument_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder setEffectConstructorArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureEffectConstructorArgumentIsMutable(); + effectConstructorArgument_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder addEffectConstructorArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEffectConstructorArgumentIsMutable(); + effectConstructorArgument_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder addEffectConstructorArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEffectConstructorArgumentIsMutable(); + effectConstructorArgument_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder addEffectConstructorArgument( + org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureEffectConstructorArgumentIsMutable(); + effectConstructorArgument_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder addEffectConstructorArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureEffectConstructorArgumentIsMutable(); + effectConstructorArgument_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder addAllEffectConstructorArgument( + java.lang.Iterable values) { + ensureEffectConstructorArgumentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, effectConstructorArgument_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder clearEffectConstructorArgument() { + effectConstructorArgument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; + */ + public Builder removeEffectConstructorArgument(int index) { + ensureEffectConstructorArgumentIsMutable(); + effectConstructorArgument_.remove(index); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Expression conclusionOfConditionalEffect_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+       * is given by other fields in this message, and 'Expression' is stored in this field.
+       * 
+ */ + public boolean hasConclusionOfConditionalEffect() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+       * is given by other fields in this message, and 'Expression' is stored in this field.
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getConclusionOfConditionalEffect() { + return conclusionOfConditionalEffect_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+       * is given by other fields in this message, and 'Expression' is stored in this field.
+       * 
+ */ + public Builder setConclusionOfConditionalEffect(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + conclusionOfConditionalEffect_ = value; + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+       * is given by other fields in this message, and 'Expression' is stored in this field.
+       * 
+ */ + public Builder setConclusionOfConditionalEffect( + org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + conclusionOfConditionalEffect_ = builderForValue.build(); + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+       * is given by other fields in this message, and 'Expression' is stored in this field.
+       * 
+ */ + public Builder mergeConclusionOfConditionalEffect(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + conclusionOfConditionalEffect_ != org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance()) { + conclusionOfConditionalEffect_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Expression.newBuilder(conclusionOfConditionalEffect_).mergeFrom(value).buildPartial(); + } else { + conclusionOfConditionalEffect_ = value; + } + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; + * + *
+       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
+       * is given by other fields in this message, and 'Expression' is stored in this field.
+       * 
+ */ + public Builder clearConclusionOfConditionalEffect() { + conclusionOfConditionalEffect_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; + /** + * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; + */ + public boolean hasKind() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind getKind() { + return kind_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; + */ + public Builder setKind(org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + kind_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; + */ + public Builder clearKind() { + bitField0_ = (bitField0_ & ~0x00000008); + kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Effect) + } + + static { + defaultInstance = new Effect(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Effect) + } + + public interface ExpressionOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Expression) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional int32 flags = 1 [default = 0]; + * + *
+     *isNegated => this expression should be negated
+     *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 1 [default = 0]; + * + *
+     *isNegated => this expression should be negated
+     *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
+     * 
+ */ + int getFlags(); + + /** + * optional int32 value_parameter_reference = 2; + * + *
+     * stored as index in valueParameters list of owner-function in 1-indexation
+     * Index '0' is reserved for extension receiver
+     * 
+ */ + boolean hasValueParameterReference(); + /** + * optional int32 value_parameter_reference = 2; + * + *
+     * stored as index in valueParameters list of owner-function in 1-indexation
+     * Index '0' is reserved for extension receiver
+     * 
+ */ + int getValueParameterReference(); + + /** + * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; + */ + boolean hasConstantValue(); + /** + * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue getConstantValue(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+     * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+     * and with type encoded in either one of next two fields as RHS.
+     * 
+ */ + boolean hasIsInstanceType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+     * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+     * and with type encoded in either one of next two fields as RHS.
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getIsInstanceType(); + + /** + * optional int32 is_instance_type_id = 5; + */ + boolean hasIsInstanceTypeId(); + /** + * optional int32 is_instance_type_id = 5; + */ + int getIsInstanceTypeId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message
+     * 
+ */ + java.util.List + getAndArgumentList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.Expression getAndArgument(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message
+     * 
+ */ + int getAndArgumentCount(); + + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message.
+     * 
+ */ + java.util.List + getOrArgumentList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message.
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.Expression getOrArgument(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message.
+     * 
+ */ + int getOrArgumentCount(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Expression} + * + *
+   * We use some trickery to optimize memory footprint of contract-expressions:
+   * exact type of Expression is determined based on its contents.
+   * 
+ */ + public static final class Expression extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Expression) + ExpressionOrBuilder { + // Use Expression.newBuilder() to construct. + private Expression(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Expression(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Expression defaultInstance; + public static Expression getDefaultInstance() { + return defaultInstance; + } + + public Expression getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private Expression( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + valueParameterReference_ = input.readInt32(); + break; + } + case 24: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue value = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000004; + constantValue_ = value; + } + break; + } + case 34: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = isInstanceType_.toBuilder(); + } + isInstanceType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(isInstanceType_); + isInstanceType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + case 40: { + bitField0_ |= 0x00000010; + isInstanceTypeId_ = input.readInt32(); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + andArgument_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + andArgument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.PARSER, extensionRegistry)); + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + orArgument_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + orArgument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.PARSER, extensionRegistry)); + 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_ & 0x00000020) == 0x00000020)) { + andArgument_ = java.util.Collections.unmodifiableList(andArgument_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + orArgument_ = java.util.Collections.unmodifiableList(orArgument_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Expression parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Expression(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.Expression.ConstantValue} + */ + public enum ConstantValue + implements com.google.protobuf.Internal.EnumLite { + /** + * TRUE = 0; + */ + TRUE(0, 0), + /** + * FALSE = 1; + */ + FALSE(1, 1), + /** + * NULL = 2; + */ + NULL(2, 2), + ; + + /** + * TRUE = 0; + */ + public static final int TRUE_VALUE = 0; + /** + * FALSE = 1; + */ + public static final int FALSE_VALUE = 1; + /** + * NULL = 2; + */ + public static final int NULL_VALUE = 2; + + + public final int getNumber() { return value; } + + public static ConstantValue valueOf(int value) { + switch (value) { + case 0: return TRUE; + case 1: return FALSE; + case 2: return NULL; + 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 ConstantValue findValueByNumber(int number) { + return ConstantValue.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private ConstantValue(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Expression.ConstantValue) + } + + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; + /** + * optional int32 flags = 1 [default = 0]; + * + *
+     *isNegated => this expression should be negated
+     *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+     *isNegated => this expression should be negated
+     *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
+     * 
+ */ + public int getFlags() { + return flags_; + } + + public static final int VALUE_PARAMETER_REFERENCE_FIELD_NUMBER = 2; + private int valueParameterReference_; + /** + * optional int32 value_parameter_reference = 2; + * + *
+     * stored as index in valueParameters list of owner-function in 1-indexation
+     * Index '0' is reserved for extension receiver
+     * 
+ */ + public boolean hasValueParameterReference() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 value_parameter_reference = 2; + * + *
+     * stored as index in valueParameters list of owner-function in 1-indexation
+     * Index '0' is reserved for extension receiver
+     * 
+ */ + public int getValueParameterReference() { + return valueParameterReference_; + } + + public static final int CONSTANT_VALUE_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue constantValue_; + /** + * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; + */ + public boolean hasConstantValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue getConstantValue() { + return constantValue_; + } + + public static final int IS_INSTANCE_TYPE_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type isInstanceType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+     * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+     * and with type encoded in either one of next two fields as RHS.
+     * 
+ */ + public boolean hasIsInstanceType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+     * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+     * and with type encoded in either one of next two fields as RHS.
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getIsInstanceType() { + return isInstanceType_; + } + + public static final int IS_INSTANCE_TYPE_ID_FIELD_NUMBER = 5; + private int isInstanceTypeId_; + /** + * optional int32 is_instance_type_id = 5; + */ + public boolean hasIsInstanceTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 is_instance_type_id = 5; + */ + public int getIsInstanceTypeId() { + return isInstanceTypeId_; + } + + public static final int AND_ARGUMENT_FIELD_NUMBER = 6; + private java.util.List andArgument_; + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message
+     * 
+ */ + public java.util.List getAndArgumentList() { + return andArgument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message
+     * 
+ */ + public java.util.List + getAndArgumentOrBuilderList() { + return andArgument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message
+     * 
+ */ + public int getAndArgumentCount() { + return andArgument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getAndArgument(int index) { + return andArgument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder getAndArgumentOrBuilder( + int index) { + return andArgument_.get(index); + } + + public static final int OR_ARGUMENT_FIELD_NUMBER = 7; + private java.util.List orArgument_; + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message.
+     * 
+ */ + public java.util.List getOrArgumentList() { + return orArgument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message.
+     * 
+ */ + public java.util.List + getOrArgumentOrBuilderList() { + return orArgument_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message.
+     * 
+ */ + public int getOrArgumentCount() { + return orArgument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message.
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getOrArgument(int index) { + return orArgument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+     * it is optimized and embedded straight into this message.
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder getOrArgumentOrBuilder( + int index) { + return orArgument_.get(index); + } + + private void initFields() { + flags_ = 0; + valueParameterReference_ = 0; + constantValue_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.TRUE; + isInstanceType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + isInstanceTypeId_ = 0; + andArgument_ = java.util.Collections.emptyList(); + orArgument_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (hasIsInstanceType()) { + if (!getIsInstanceType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getAndArgumentCount(); i++) { + if (!getAndArgument(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getOrArgumentCount(); i++) { + if (!getOrArgument(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, flags_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, valueParameterReference_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, constantValue_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(4, isInstanceType_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, isInstanceTypeId_); + } + for (int i = 0; i < andArgument_.size(); i++) { + output.writeMessage(6, andArgument_.get(i)); + } + for (int i = 0; i < orArgument_.size(); i++) { + output.writeMessage(7, orArgument_.get(i)); + } + output.writeRawBytes(unknownFields); + } + + 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, flags_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, valueParameterReference_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, constantValue_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, isInstanceType_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, isInstanceTypeId_); + } + for (int i = 0; i < andArgument_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, andArgument_.get(i)); + } + for (int i = 0; i < orArgument_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, orArgument_.get(i)); + } + size += unknownFields.size(); + 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.metadata.ProtoBuf.Expression parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression 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.metadata.ProtoBuf.Expression parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression 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.metadata.ProtoBuf.Expression prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Expression} + * + *
+     * We use some trickery to optimize memory footprint of contract-expressions:
+     * exact type of Expression is determined based on its contents.
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.Expression, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Expression) + org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Expression.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + flags_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + valueParameterReference_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + constantValue_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.TRUE; + bitField0_ = (bitField0_ & ~0x00000004); + isInstanceType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + isInstanceTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + andArgument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + orArgument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Expression result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Expression result = new org.jetbrains.kotlin.metadata.ProtoBuf.Expression(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.valueParameterReference_ = valueParameterReference_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.constantValue_ = constantValue_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.isInstanceType_ = isInstanceType_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.isInstanceTypeId_ = isInstanceTypeId_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + andArgument_ = java.util.Collections.unmodifiableList(andArgument_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.andArgument_ = andArgument_; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + orArgument_ = java.util.Collections.unmodifiableList(orArgument_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.orArgument_ = orArgument_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Expression other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasValueParameterReference()) { + setValueParameterReference(other.getValueParameterReference()); + } + if (other.hasConstantValue()) { + setConstantValue(other.getConstantValue()); + } + if (other.hasIsInstanceType()) { + mergeIsInstanceType(other.getIsInstanceType()); + } + if (other.hasIsInstanceTypeId()) { + setIsInstanceTypeId(other.getIsInstanceTypeId()); + } + if (!other.andArgument_.isEmpty()) { + if (andArgument_.isEmpty()) { + andArgument_ = other.andArgument_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureAndArgumentIsMutable(); + andArgument_.addAll(other.andArgument_); + } + + } + if (!other.orArgument_.isEmpty()) { + if (orArgument_.isEmpty()) { + orArgument_ = other.orArgument_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureOrArgumentIsMutable(); + orArgument_.addAll(other.orArgument_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (hasIsInstanceType()) { + if (!getIsInstanceType().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getAndArgumentCount(); i++) { + if (!getAndArgument(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getOrArgumentCount(); i++) { + if (!getOrArgument(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Expression parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Expression) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int flags_ ; + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *isNegated => this expression should be negated
+       *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *isNegated => this expression should be negated
+       *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *isNegated => this expression should be negated
+       *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *isNegated => this expression should be negated
+       *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 0; + + return this; + } + + private int valueParameterReference_ ; + /** + * optional int32 value_parameter_reference = 2; + * + *
+       * stored as index in valueParameters list of owner-function in 1-indexation
+       * Index '0' is reserved for extension receiver
+       * 
+ */ + public boolean hasValueParameterReference() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 value_parameter_reference = 2; + * + *
+       * stored as index in valueParameters list of owner-function in 1-indexation
+       * Index '0' is reserved for extension receiver
+       * 
+ */ + public int getValueParameterReference() { + return valueParameterReference_; + } + /** + * optional int32 value_parameter_reference = 2; + * + *
+       * stored as index in valueParameters list of owner-function in 1-indexation
+       * Index '0' is reserved for extension receiver
+       * 
+ */ + public Builder setValueParameterReference(int value) { + bitField0_ |= 0x00000002; + valueParameterReference_ = value; + + return this; + } + /** + * optional int32 value_parameter_reference = 2; + * + *
+       * stored as index in valueParameters list of owner-function in 1-indexation
+       * Index '0' is reserved for extension receiver
+       * 
+ */ + public Builder clearValueParameterReference() { + bitField0_ = (bitField0_ & ~0x00000002); + valueParameterReference_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue constantValue_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.TRUE; + /** + * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; + */ + public boolean hasConstantValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue getConstantValue() { + return constantValue_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; + */ + public Builder setConstantValue(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + constantValue_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; + */ + public Builder clearConstantValue() { + bitField0_ = (bitField0_ & ~0x00000004); + constantValue_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.TRUE; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type isInstanceType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+       * and with type encoded in either one of next two fields as RHS.
+       * 
+ */ + public boolean hasIsInstanceType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+       * and with type encoded in either one of next two fields as RHS.
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getIsInstanceType() { + return isInstanceType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+       * and with type encoded in either one of next two fields as RHS.
+       * 
+ */ + public Builder setIsInstanceType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + isInstanceType_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+       * and with type encoded in either one of next two fields as RHS.
+       * 
+ */ + public Builder setIsInstanceType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + isInstanceType_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+       * and with type encoded in either one of next two fields as RHS.
+       * 
+ */ + public Builder mergeIsInstanceType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + isInstanceType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + isInstanceType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(isInstanceType_).mergeFrom(value).buildPartial(); + } else { + isInstanceType_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; + * + *
+       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
+       * and with type encoded in either one of next two fields as RHS.
+       * 
+ */ + public Builder clearIsInstanceType() { + isInstanceType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + private int isInstanceTypeId_ ; + /** + * optional int32 is_instance_type_id = 5; + */ + public boolean hasIsInstanceTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 is_instance_type_id = 5; + */ + public int getIsInstanceTypeId() { + return isInstanceTypeId_; + } + /** + * optional int32 is_instance_type_id = 5; + */ + public Builder setIsInstanceTypeId(int value) { + bitField0_ |= 0x00000010; + isInstanceTypeId_ = value; + + return this; + } + /** + * optional int32 is_instance_type_id = 5; + */ + public Builder clearIsInstanceTypeId() { + bitField0_ = (bitField0_ & ~0x00000010); + isInstanceTypeId_ = 0; + + return this; + } + + private java.util.List andArgument_ = + java.util.Collections.emptyList(); + private void ensureAndArgumentIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + andArgument_ = new java.util.ArrayList(andArgument_); + bitField0_ |= 0x00000020; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public java.util.List getAndArgumentList() { + return java.util.Collections.unmodifiableList(andArgument_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public int getAndArgumentCount() { + return andArgument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getAndArgument(int index) { + return andArgument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder setAndArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAndArgumentIsMutable(); + andArgument_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder setAndArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureAndArgumentIsMutable(); + andArgument_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder addAndArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAndArgumentIsMutable(); + andArgument_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder addAndArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAndArgumentIsMutable(); + andArgument_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder addAndArgument( + org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureAndArgumentIsMutable(); + andArgument_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder addAndArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureAndArgumentIsMutable(); + andArgument_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder addAllAndArgument( + java.lang.Iterable values) { + ensureAndArgumentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, andArgument_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder clearAndArgument() { + andArgument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; + * + *
+       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message
+       * 
+ */ + public Builder removeAndArgument(int index) { + ensureAndArgumentIsMutable(); + andArgument_.remove(index); + + return this; + } + + private java.util.List orArgument_ = + java.util.Collections.emptyList(); + private void ensureOrArgumentIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + orArgument_ = new java.util.ArrayList(orArgument_); + bitField0_ |= 0x00000040; + } + } + + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public java.util.List getOrArgumentList() { + return java.util.Collections.unmodifiableList(orArgument_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public int getOrArgumentCount() { + return orArgument_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getOrArgument(int index) { + return orArgument_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder setOrArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrArgumentIsMutable(); + orArgument_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder setOrArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureOrArgumentIsMutable(); + orArgument_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder addOrArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrArgumentIsMutable(); + orArgument_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder addOrArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrArgumentIsMutable(); + orArgument_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder addOrArgument( + org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureOrArgumentIsMutable(); + orArgument_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder addOrArgument( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ensureOrArgumentIsMutable(); + orArgument_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder addAllOrArgument( + java.lang.Iterable values) { + ensureOrArgumentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, orArgument_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder clearOrArgument() { + orArgument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; + * + *
+       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
+       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
+       * it is optimized and embedded straight into this message.
+       * 
+ */ + public Builder removeOrArgument(int index) { + ensureOrArgumentIsMutable(); + orArgument_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Expression) + } + + static { + defaultInstance = new Expression(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Expression) + } + + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} \ No newline at end of file diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt new file mode 100644 index 0000000000..10163e9a30 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt @@ -0,0 +1,91 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.deserialization + +/** + * Subclasses of this class are used to identify different versions of the binary output of the compiler and their compatibility guarantees. + * - Major version should be increased only when the new binary format is neither forward- nor backward compatible. + * This shouldn't really ever happen at all. + * - Minor version should be increased when the new format is backward compatible, + * i.e. the new compiler can process old data, but the old compiler will not be able to process new data. + * - Patch version can be increased freely and is only supposed to be used for debugging. Increase the patch version when you + * make a change to binaries which is both forward- and backward compatible. + */ +abstract class BinaryVersion(private vararg val numbers: Int) { + val major: Int = numbers.getOrNull(0) ?: UNKNOWN + val minor: Int = numbers.getOrNull(1) ?: UNKNOWN + val patch: Int = numbers.getOrNull(2) ?: UNKNOWN + val rest: List = if (numbers.size > 3) numbers.asList().subList(3, numbers.size).toList() else emptyList() + + abstract fun isCompatible(): Boolean + + fun toArray(): IntArray = numbers + + /** + * Returns true if this version of some format loaded from some binaries is compatible + * to the expected version of that format in the current compiler. + * + * @param ourVersion the version of this format in the current compiler + */ + protected fun isCompatibleTo(ourVersion: BinaryVersion): Boolean { + return if (major == 0) ourVersion.major == 0 && minor == ourVersion.minor + else major == ourVersion.major && minor <= ourVersion.minor + } + + fun isAtLeast(version: BinaryVersion): Boolean = + isAtLeast(version.major, version.minor, version.patch) + + fun isAtLeast(major: Int, minor: Int, patch: Int): Boolean { + if (this.major > major) return true + if (this.major < major) return false + + if (this.minor > minor) return true + if (this.minor < minor) return false + + return this.patch >= patch + } + + fun isAtMost(version: BinaryVersion): Boolean = + isAtMost(version.major, version.minor, version.patch) + + fun isAtMost(major: Int, minor: Int, patch: Int): Boolean { + if (this.major < major) return true + if (this.major > major) return false + + if (this.minor < minor) return true + if (this.minor > minor) return false + + return this.patch <= patch + } + + override fun toString(): String { + val versions = toArray().takeWhile { it != UNKNOWN } + return if (versions.isEmpty()) "unknown" else versions.joinToString(".") + } + + override fun equals(other: Any?) = + other != null && + this::class.java == other::class.java && + major == (other as BinaryVersion).major && minor == other.minor && patch == other.patch && rest == other.rest + + override fun hashCode(): Int { + var result = major + result += 31 * result + minor + result += 31 * result + patch + result += 31 * result + rest.hashCode() + return result + } + + companion object { + private const val UNKNOWN = -1 + + @JvmStatic + fun parseVersionArray(string: String): IntArray? = + string.split(".") + .map { part -> part.toIntOrNull() ?: return null } + .toTypedArray().toIntArray() + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java new file mode 100644 index 0000000000..df78268636 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java @@ -0,0 +1,322 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.deserialization; + +import com.google.protobuf.Internal; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.kotlin.metadata.ProtoBuf; + +public class Flags { + protected Flags() {} + + // Types + public static final BooleanFlagField SUSPEND_TYPE = FlagField.booleanFirst(); + public static final BooleanFlagField DEFINITELY_NOT_NULL_TYPE = FlagField.booleanAfter(SUSPEND_TYPE); + + // Common for declarations + + public static final BooleanFlagField HAS_ANNOTATIONS = FlagField.booleanFirst(); + public static final FlagField VISIBILITY = FlagField.after(HAS_ANNOTATIONS, ProtoBuf.Visibility.values()); + public static final FlagField MODALITY = FlagField.after(VISIBILITY, ProtoBuf.Modality.values()); + + // Class + + public static final FlagField CLASS_KIND = FlagField.after(MODALITY, ProtoBuf.Class.Kind.values()); + public static final BooleanFlagField IS_INNER = FlagField.booleanAfter(CLASS_KIND); + public static final BooleanFlagField IS_DATA = FlagField.booleanAfter(IS_INNER); + public static final BooleanFlagField IS_EXTERNAL_CLASS = FlagField.booleanAfter(IS_DATA); + public static final BooleanFlagField IS_EXPECT_CLASS = FlagField.booleanAfter(IS_EXTERNAL_CLASS); + public static final BooleanFlagField IS_INLINE_CLASS = FlagField.booleanAfter(IS_EXPECT_CLASS); + public static final BooleanFlagField IS_FUN_INTERFACE = FlagField.booleanAfter(IS_INLINE_CLASS); + + // Constructors + + public static final BooleanFlagField IS_SECONDARY = FlagField.booleanAfter(VISIBILITY); + public static final BooleanFlagField IS_CONSTRUCTOR_WITH_NON_STABLE_PARAMETER_NAMES = FlagField.booleanAfter(IS_SECONDARY); + + // Callables + + public static final FlagField MEMBER_KIND = FlagField.after(MODALITY, ProtoBuf.MemberKind.values()); + + // Functions + + public static final BooleanFlagField IS_OPERATOR = FlagField.booleanAfter(MEMBER_KIND); + public static final BooleanFlagField IS_INFIX = FlagField.booleanAfter(IS_OPERATOR); + public static final BooleanFlagField IS_INLINE = FlagField.booleanAfter(IS_INFIX); + public static final BooleanFlagField IS_TAILREC = FlagField.booleanAfter(IS_INLINE); + public static final BooleanFlagField IS_EXTERNAL_FUNCTION = FlagField.booleanAfter(IS_TAILREC); + public static final BooleanFlagField IS_SUSPEND = FlagField.booleanAfter(IS_EXTERNAL_FUNCTION); + public static final BooleanFlagField IS_EXPECT_FUNCTION = FlagField.booleanAfter(IS_SUSPEND); + public static final BooleanFlagField IS_FUNCTION_WITH_NON_STABLE_PARAMETER_NAMES = FlagField.booleanAfter(IS_EXPECT_FUNCTION); + + // Properties + + public static final BooleanFlagField IS_VAR = FlagField.booleanAfter(MEMBER_KIND); + public static final BooleanFlagField HAS_GETTER = FlagField.booleanAfter(IS_VAR); + public static final BooleanFlagField HAS_SETTER = FlagField.booleanAfter(HAS_GETTER); + public static final BooleanFlagField IS_CONST = FlagField.booleanAfter(HAS_SETTER); + public static final BooleanFlagField IS_LATEINIT = FlagField.booleanAfter(IS_CONST); + public static final BooleanFlagField HAS_CONSTANT = FlagField.booleanAfter(IS_LATEINIT); + public static final BooleanFlagField IS_EXTERNAL_PROPERTY = FlagField.booleanAfter(HAS_CONSTANT); + public static final BooleanFlagField IS_DELEGATED = FlagField.booleanAfter(IS_EXTERNAL_PROPERTY); + public static final BooleanFlagField IS_EXPECT_PROPERTY = FlagField.booleanAfter(IS_DELEGATED); + + // Parameters + + public static final BooleanFlagField DECLARES_DEFAULT_VALUE = FlagField.booleanAfter(HAS_ANNOTATIONS); + public static final BooleanFlagField IS_CROSSINLINE = FlagField.booleanAfter(DECLARES_DEFAULT_VALUE); + public static final BooleanFlagField IS_NOINLINE = FlagField.booleanAfter(IS_CROSSINLINE); + + // Accessors + + public static final BooleanFlagField IS_NOT_DEFAULT = FlagField.booleanAfter(MODALITY); + public static final BooleanFlagField IS_EXTERNAL_ACCESSOR = FlagField.booleanAfter(IS_NOT_DEFAULT); + public static final BooleanFlagField IS_INLINE_ACCESSOR = FlagField.booleanAfter(IS_EXTERNAL_ACCESSOR); + + // Contracts expressions + public static final BooleanFlagField IS_NEGATED = FlagField.booleanFirst(); + public static final BooleanFlagField IS_NULL_CHECK_PREDICATE = FlagField.booleanAfter(IS_NEGATED); + + // Annotations + public static final BooleanFlagField IS_UNSIGNED = FlagField.booleanFirst(); + + // --- + + public static int getTypeFlags(boolean isSuspend, boolean isDefinitelyNotNull) { + return SUSPEND_TYPE.toFlags(isSuspend) | DEFINITELY_NOT_NULL_TYPE.toFlags(isDefinitelyNotNull); + } + + public static int getClassFlags( + boolean hasAnnotations, + @NotNull ProtoBuf.Visibility visibility, + @NotNull ProtoBuf.Modality modality, + @NotNull ProtoBuf.Class.Kind kind, + boolean inner, + boolean isData, + boolean isExternal, + boolean isExpect, + boolean isInline, + boolean isFun + ) { + return HAS_ANNOTATIONS.toFlags(hasAnnotations) + | MODALITY.toFlags(modality) + | VISIBILITY.toFlags(visibility) + | CLASS_KIND.toFlags(kind) + | IS_INNER.toFlags(inner) + | IS_DATA.toFlags(isData) + | IS_EXTERNAL_CLASS.toFlags(isExternal) + | IS_EXPECT_CLASS.toFlags(isExpect) + | IS_INLINE_CLASS.toFlags(isInline) + | IS_FUN_INTERFACE.toFlags(isFun) + ; + } + + public static int getConstructorFlags( + boolean hasAnnotations, + @NotNull ProtoBuf.Visibility visibility, + boolean isSecondary, + boolean hasStableParameterNames + ) { + return HAS_ANNOTATIONS.toFlags(hasAnnotations) + | VISIBILITY.toFlags(visibility) + | IS_SECONDARY.toFlags(isSecondary) + | IS_CONSTRUCTOR_WITH_NON_STABLE_PARAMETER_NAMES.toFlags(!hasStableParameterNames) + ; + } + + public static int getFunctionFlags( + boolean hasAnnotations, + @NotNull ProtoBuf.Visibility visibility, + @NotNull ProtoBuf.Modality modality, + @NotNull ProtoBuf.MemberKind memberKind, + boolean isOperator, + boolean isInfix, + boolean isInline, + boolean isTailrec, + boolean isExternal, + boolean isSuspend, + boolean isExpect, + boolean hasStableParameterNames + ) { + return HAS_ANNOTATIONS.toFlags(hasAnnotations) + | VISIBILITY.toFlags(visibility) + | MODALITY.toFlags(modality) + | MEMBER_KIND.toFlags(memberKind) + | IS_OPERATOR.toFlags(isOperator) + | IS_INFIX.toFlags(isInfix) + | IS_INLINE.toFlags(isInline) + | IS_TAILREC.toFlags(isTailrec) + | IS_EXTERNAL_FUNCTION.toFlags(isExternal) + | IS_SUSPEND.toFlags(isSuspend) + | IS_EXPECT_FUNCTION.toFlags(isExpect) + | IS_FUNCTION_WITH_NON_STABLE_PARAMETER_NAMES.toFlags(!hasStableParameterNames) + ; + } + + public static int getPropertyFlags( + boolean hasAnnotations, + @NotNull ProtoBuf.Visibility visibility, + @NotNull ProtoBuf.Modality modality, + @NotNull ProtoBuf.MemberKind memberKind, + boolean isVar, + boolean hasGetter, + boolean hasSetter, + boolean hasConstant, + boolean isConst, + boolean lateInit, + boolean isExternal, + boolean isDelegated, + boolean isExpect + ) { + return HAS_ANNOTATIONS.toFlags(hasAnnotations) + | VISIBILITY.toFlags(visibility) + | MODALITY.toFlags(modality) + | MEMBER_KIND.toFlags(memberKind) + | IS_VAR.toFlags(isVar) + | HAS_GETTER.toFlags(hasGetter) + | HAS_SETTER.toFlags(hasSetter) + | IS_CONST.toFlags(isConst) + | IS_LATEINIT.toFlags(lateInit) + | HAS_CONSTANT.toFlags(hasConstant) + | IS_EXTERNAL_PROPERTY.toFlags(isExternal) + | IS_DELEGATED.toFlags(isDelegated) + | IS_EXPECT_PROPERTY.toFlags(isExpect) + ; + } + + public static int getAccessorFlags( + boolean hasAnnotations, + @NotNull ProtoBuf.Visibility visibility, + @NotNull ProtoBuf.Modality modality, + boolean isNotDefault, + boolean isExternal, + boolean isInlineAccessor + ) { + return HAS_ANNOTATIONS.toFlags(hasAnnotations) + | MODALITY.toFlags(modality) + | VISIBILITY.toFlags(visibility) + | IS_NOT_DEFAULT.toFlags(isNotDefault) + | IS_EXTERNAL_ACCESSOR.toFlags(isExternal) + | IS_INLINE_ACCESSOR.toFlags(isInlineAccessor) + ; + } + + public static int getContractExpressionFlags(boolean isNegated, boolean isNullCheckPredicate) { + return IS_NEGATED.toFlags(isNegated) + | IS_NULL_CHECK_PREDICATE.toFlags(isNullCheckPredicate); + } + + public static int getValueParameterFlags( + boolean hasAnnotations, + boolean declaresDefaultValue, + boolean isCrossinline, + boolean isNoinline + ) { + return HAS_ANNOTATIONS.toFlags(hasAnnotations) + | DECLARES_DEFAULT_VALUE.toFlags(declaresDefaultValue) + | IS_CROSSINLINE.toFlags(isCrossinline) + | IS_NOINLINE.toFlags(isNoinline) + ; + } + + public static int getTypeAliasFlags(boolean hasAnnotations, ProtoBuf.Visibility visibility) { + return HAS_ANNOTATIONS.toFlags(hasAnnotations) + | VISIBILITY.toFlags(visibility) + ; + } + + // Infrastructure + + public static abstract class FlagField { + public static FlagField after(FlagField previousField, E[] values) { + int offset = previousField.offset + previousField.bitWidth; + return new EnumLiteFlagField(offset, values); + } + + public static FlagField first(E[] values) { + return new EnumLiteFlagField(0, values); + } + + public static BooleanFlagField booleanFirst() { + return new BooleanFlagField(0); + } + + public static BooleanFlagField booleanAfter(FlagField previousField) { + int offset = previousField.offset + previousField.bitWidth; + return new BooleanFlagField(offset); + } + + public final int offset; + public final int bitWidth; + + private FlagField(int offset, int bitWidth) { + this.offset = offset; + this.bitWidth = bitWidth; + } + + public abstract E get(int flags); + + public abstract int toFlags(E value); + } + + @SuppressWarnings("WeakerAccess") + public static class BooleanFlagField extends FlagField { + public BooleanFlagField(int offset) { + super(offset, 1); + } + + @Override + @NotNull + public Boolean get(int flags) { + return (flags & (1 << offset)) != 0; + } + + @Override + public int toFlags(Boolean value) { + return value ? 1 << offset : 0; + } + + public int invert(int flags) { return (flags ^ (1 << offset)); } + } + + private static class EnumLiteFlagField extends FlagField { + private final E[] values; + + public EnumLiteFlagField(int offset, E[] values) { + super(offset, bitWidth(values)); + this.values = values; + } + + private static int bitWidth(@NotNull E[] enumEntries) { + int length = enumEntries.length - 1; + if (length == 0) return 1; + for (int i = 31; i >= 0; i--) { + if ((length & (1 << i)) != 0) return i + 1; + } + throw new IllegalStateException("Empty enum: " + enumEntries.getClass()); + } + + @Override + @Nullable + public E get(int flags) { + int maskUnshifted = (1 << bitWidth) - 1; + int mask = maskUnshifted << offset; + int value = (flags & mask) >> offset; + for (E e : values) { + if (e.getNumber() == value) { + return e; + } + } + return null; + } + + @Override + public int toFlags(E value) { + return value.getNumber() << offset; + } + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/NameResolver.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/NameResolver.kt new file mode 100644 index 0000000000..403bd8064e --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/NameResolver.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.deserialization + +interface NameResolver { + fun getString(index: Int): String + + /** + * @return the fully qualified name of some class in the format: `org/foo/bar/Test.Inner` + */ + fun getQualifiedClassName(index: Int): String + + fun isLocalClassName(index: Int): Boolean +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt new file mode 100644 index 0000000000..9cd9f6674d --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.deserialization + +import com.google.protobuf.GeneratedMessageLite + +fun , T> GeneratedMessageLite.ExtendableMessage.getExtensionOrNull( + extension: GeneratedMessageLite.GeneratedExtension +): T? = if (hasExtension(extension)) getExtension(extension) else null + +fun , T> GeneratedMessageLite.ExtendableMessage.getExtensionOrNull( + extension: GeneratedMessageLite.GeneratedExtension>, index: Int +): T? = if (index < getExtensionCount(extension)) getExtension(extension, index) else null diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/TypeTable.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/TypeTable.kt new file mode 100644 index 0000000000..27406f036a --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/TypeTable.kt @@ -0,0 +1,35 @@ +/* + * 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.metadata.deserialization + +import org.jetbrains.kotlin.metadata.ProtoBuf + +class TypeTable(typeTable: ProtoBuf.TypeTable) { + val types: List = run { + val originalTypes = typeTable.typeList + if (typeTable.hasFirstNullable()) { + val firstNullable = typeTable.firstNullable + typeTable.typeList.mapIndexed { i, type -> + if (i >= firstNullable) { + type.toBuilder().setNullable(true).build() + } else type + } + } else originalTypes + } + + operator fun get(index: Int) = types[index] +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt new file mode 100644 index 0000000000..99a646716a --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt @@ -0,0 +1,118 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.deserialization + +import com.google.protobuf.MessageLite +import org.jetbrains.kotlin.metadata.ProtoBuf + +class VersionRequirementTable private constructor(private val infos: List) { + operator fun get(id: Int): ProtoBuf.VersionRequirement? = infos.getOrNull(id) + + companion object { + val EMPTY = VersionRequirementTable(emptyList()) + + fun create(table: ProtoBuf.VersionRequirementTable): VersionRequirementTable = + if (table.requirementCount == 0) EMPTY else VersionRequirementTable( + table.requirementList + ) + } +} + +class VersionRequirement( + val version: Version, + val kind: ProtoBuf.VersionRequirement.VersionKind, + val level: DeprecationLevel, + val errorCode: Int?, + val message: String? +) { + data class Version(val major: Int, val minor: Int, val patch: Int = 0) { + fun asString(): String = + if (patch == 0) "$major.$minor" else "$major.$minor.$patch" + + fun encode( + writeVersion: (Int) -> Unit, + writeVersionFull: (Int) -> Unit + ) = when { + this == INFINITY -> { + // Do nothing: absence of version means INFINITY + } + major > MAJOR_MASK || minor > MINOR_MASK || patch > PATCH_MASK -> { + writeVersionFull(major or (minor shl 8) or (patch shl 16)) + } + else -> { + writeVersion(major or (minor shl MAJOR_BITS) or (patch shl (MAJOR_BITS + MINOR_BITS))) + } + } + + override fun toString(): String = asString() + + companion object { + @JvmField + val INFINITY = Version(256, 256, 256) + + // Number of bits used for major, minor and patch components in "version" field + private const val MAJOR_BITS = 3 + private const val MINOR_BITS = 4 + private const val PATCH_BITS = 7 + private const val MAJOR_MASK = (1 shl MAJOR_BITS) - 1 + private const val MINOR_MASK = (1 shl MINOR_BITS) - 1 + private const val PATCH_MASK = (1 shl PATCH_BITS) - 1 + + fun decode(version: Int?, versionFull: Int?): Version = when { + versionFull != null -> Version( + major = versionFull and 255, + minor = (versionFull shr 8) and 255, + patch = (versionFull shr 16) and 255 + ) + version != null -> Version( + major = version and MAJOR_MASK, + minor = (version shr MAJOR_BITS) and MINOR_MASK, + patch = (version shr (MAJOR_BITS + MINOR_BITS)) and PATCH_MASK + ) + else -> INFINITY + } + } + } + + override fun toString(): String = + "since $version $level" + (if (errorCode != null) " error $errorCode" else "") + (if (message != null) ": $message" else "") + + companion object { + fun create(proto: MessageLite, nameResolver: NameResolver, table: VersionRequirementTable): List { + val ids = when (proto) { + is ProtoBuf.Class -> proto.versionRequirementList + is ProtoBuf.Constructor -> proto.versionRequirementList + is ProtoBuf.Function -> proto.versionRequirementList + is ProtoBuf.Property -> proto.versionRequirementList + is ProtoBuf.TypeAlias -> proto.versionRequirementList + else -> throw IllegalStateException("Unexpected declaration: ${proto::class.java}") + } + + return ids.mapNotNull { id -> create(id, nameResolver, table) } + } + + fun create(id: Int, nameResolver: NameResolver, table: VersionRequirementTable): VersionRequirement? { + val info = table[id] ?: return null + + val version = Version.decode( + if (info.hasVersion()) info.version else null, + if (info.hasVersionFull()) info.versionFull else null + ) + + val level = when (info.level!!) { + ProtoBuf.VersionRequirement.Level.WARNING -> DeprecationLevel.WARNING + ProtoBuf.VersionRequirement.Level.ERROR -> DeprecationLevel.ERROR + ProtoBuf.VersionRequirement.Level.HIDDEN -> DeprecationLevel.HIDDEN + } + + val errorCode = if (info.hasErrorCode()) info.errorCode else null + + val message = if (info.hasMessage()) nameResolver.getString(info.message) else null + + return VersionRequirement(version, info.versionKind, level, errorCode, message) + } + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt new file mode 100644 index 0000000000..a693fc81a0 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt @@ -0,0 +1,115 @@ +/* + * 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.metadata.deserialization + +import org.jetbrains.kotlin.metadata.ProtoBuf + +// TODO: return null and report a diagnostic instead of throwing exceptions + +fun ProtoBuf.Class.supertypes(typeTable: TypeTable): List = + supertypeList.takeIf(Collection<*>::isNotEmpty) ?: supertypeIdList.map { typeTable[it] } + +fun ProtoBuf.Class.inlineClassUnderlyingType(typeTable: TypeTable): ProtoBuf.Type? = when { + hasInlineClassUnderlyingType() -> inlineClassUnderlyingType + hasInlineClassUnderlyingTypeId() -> typeTable[inlineClassUnderlyingTypeId] + else -> null +} + +fun ProtoBuf.Type.Argument.type(typeTable: TypeTable): ProtoBuf.Type? = when { + hasType() -> type + hasTypeId() -> typeTable[typeId] + else -> null +} + +fun ProtoBuf.Type.flexibleUpperBound(typeTable: TypeTable): ProtoBuf.Type? = when { + hasFlexibleUpperBound() -> flexibleUpperBound + hasFlexibleUpperBoundId() -> typeTable[flexibleUpperBoundId] + else -> null +} + +fun ProtoBuf.TypeParameter.upperBounds(typeTable: TypeTable): List = + upperBoundList.takeIf(Collection<*>::isNotEmpty) ?: upperBoundIdList.map { typeTable[it] } + +fun ProtoBuf.Function.returnType(typeTable: TypeTable): ProtoBuf.Type = when { + hasReturnType() -> returnType + hasReturnTypeId() -> typeTable[returnTypeId] + else -> error("No returnType in ProtoBuf.Function") +} + +fun ProtoBuf.Function.hasReceiver(): Boolean = hasReceiverType() || hasReceiverTypeId() + +fun ProtoBuf.Function.receiverType(typeTable: TypeTable): ProtoBuf.Type? = when { + hasReceiverType() -> receiverType + hasReceiverTypeId() -> typeTable[receiverTypeId] + else -> null +} + +fun ProtoBuf.Property.returnType(typeTable: TypeTable): ProtoBuf.Type = when { + hasReturnType() -> returnType + hasReturnTypeId() -> typeTable[returnTypeId] + else -> error("No returnType in ProtoBuf.Property") +} + +fun ProtoBuf.Property.hasReceiver(): Boolean = hasReceiverType() || hasReceiverTypeId() + +fun ProtoBuf.Property.receiverType(typeTable: TypeTable): ProtoBuf.Type? = when { + hasReceiverType() -> receiverType + hasReceiverTypeId() -> typeTable[receiverTypeId] + else -> null +} + +fun ProtoBuf.ValueParameter.type(typeTable: TypeTable): ProtoBuf.Type = when { + hasType() -> type + hasTypeId() -> typeTable[typeId] + else -> error("No type in ProtoBuf.ValueParameter") +} + +fun ProtoBuf.ValueParameter.varargElementType(typeTable: TypeTable): ProtoBuf.Type? = when { + hasVarargElementType() -> varargElementType + hasVarargElementTypeId() -> typeTable[varargElementTypeId] + else -> null +} + +fun ProtoBuf.Type.outerType(typeTable: TypeTable): ProtoBuf.Type? = when { + hasOuterType() -> outerType + hasOuterTypeId() -> typeTable[outerTypeId] + else -> null +} + +fun ProtoBuf.Type.abbreviatedType(typeTable: TypeTable): ProtoBuf.Type? = when { + hasAbbreviatedType() -> abbreviatedType + hasAbbreviatedTypeId() -> typeTable[abbreviatedTypeId] + else -> null +} + +fun ProtoBuf.TypeAlias.underlyingType(typeTable: TypeTable): ProtoBuf.Type = when { + hasUnderlyingType() -> underlyingType + hasUnderlyingTypeId() -> typeTable[underlyingTypeId] + else -> error("No underlyingType in ProtoBuf.TypeAlias") +} + +fun ProtoBuf.TypeAlias.expandedType(typeTable: TypeTable): ProtoBuf.Type = when { + hasExpandedType() -> expandedType + hasExpandedTypeId() -> typeTable[expandedTypeId] + else -> error("No expandedType in ProtoBuf.TypeAlias") +} + +fun ProtoBuf.Expression.isInstanceType(typeTable: TypeTable): ProtoBuf.Type? = when { + hasIsInstanceType() -> isInstanceType + hasIsInstanceTypeId() -> typeTable[isInstanceTypeId] + else -> null +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java new file mode 100644 index 0000000000..98b5d4f960 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java @@ -0,0 +1,4183 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: core/metadata.jvm/src/jvm_metadata.proto + +package org.jetbrains.kotlin.metadata.jvm; + +public final class JvmProtoBuf { + private JvmProtoBuf() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(JvmProtoBuf.constructorSignature); + registry.add(JvmProtoBuf.methodSignature); + registry.add(JvmProtoBuf.lambdaClassOriginName); + registry.add(JvmProtoBuf.propertySignature); + registry.add(JvmProtoBuf.flags); + registry.add(JvmProtoBuf.typeAnnotation); + registry.add(JvmProtoBuf.isRaw); + registry.add(JvmProtoBuf.typeParameterAnnotation); + registry.add(JvmProtoBuf.classModuleName); + registry.add(JvmProtoBuf.classLocalVariable); + registry.add(JvmProtoBuf.anonymousObjectOriginName); + registry.add(JvmProtoBuf.jvmClassFlags); + registry.add(JvmProtoBuf.packageModuleName); + registry.add(JvmProtoBuf.packageLocalVariable); + } + public interface StringTableTypesOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + java.util.List + getRecordList(); + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + StringTableTypes.Record getRecord(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + int getRecordCount(); + + /** + * 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.metadata.jvm.StringTableTypes} + */ + public static final class StringTableTypes extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) + StringTableTypesOrBuilder { + // Use StringTableTypes.newBuilder() to construct. + private StringTableTypes(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private StringTableTypes(boolean noInit) { + this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final StringTableTypes defaultInstance; + public static StringTableTypes getDefaultInstance() { + return defaultInstance; + } + + @Override + public StringTableTypes getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString 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.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + record_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + record_.add(input.readMessage(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_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + + @Override + public StringTableTypes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StringTableTypes(input, extensionRegistry); + } + }; + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public interface RecordOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * 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; + * + *
+       * 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 string string = 6; + * + *
+       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+       * 
+ */ + boolean hasString(); + /** + * optional string string = 6; + * + *
+       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+       * 
+ */ + String getString(); + /** + * optional string string = 6; + * + *
+       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+       * 
+ */ + com.google.protobuf.ByteString + getStringBytes(); + + /** + * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + boolean hasOperation(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + Record.Operation getOperation(); + + /** + * 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]; + * + *
+       * 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.metadata.jvm.StringTableTypes.Record} + */ + public static final class Record extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) + RecordOrBuilder { + // Use Record.newBuilder() to construct. + private Record(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Record(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Record defaultInstance; + public static Record getDefaultInstance() { + return defaultInstance; + } + + @Override + public Record getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString 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.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + 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(); + Operation value = Operation.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000008; + operation_ = value; + } + break; + } + case 32: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + substringIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + substringIndex_.add(input.readInt32()); + break; + } + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) { + substringIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + while (input.getBytesUntilLimit() > 0) { + substringIndex_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 40: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + replaceChar_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + replaceChar_.add(input.readInt32()); + break; + } + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) { + replaceChar_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + while (input.getBytesUntilLimit() > 0) { + replaceChar_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + string_ = bs; + 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_ & 0x00000010) == 0x00000010)) { + substringIndex_ = java.util.Collections.unmodifiableList(substringIndex_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + replaceChar_ = java.util.Collections.unmodifiableList(replaceChar_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + + @Override + public Record parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Record(input, extensionRegistry); + } + }; + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.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; + + @Override + 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() { + + @Override + public Operation findValueByNumber(int number) { + return Operation.valueOf(number); + } + }; + + private final int value; + + @SuppressWarnings("UnusedVariable") + private Operation(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation) + } + + private int bitField0_; + 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
+       * 
+ */ + @Override + 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
+       * 
+ */ + @Override + public int getRange() { + return range_; + } + + 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
+       * 
+ */ + @Override + 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
+       * 
+ */ + @Override + public int getPredefinedIndex() { + return predefinedIndex_; + } + + public static final int STRING_FIELD_NUMBER = 6; + private Object string_; + /** + * optional string string = 6; + * + *
+       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+       * 
+ */ + @Override + public boolean hasString() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string string = 6; + * + *
+       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+       * 
+ */ + @Override + public String getString() { + Object ref = string_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + string_ = s; + } + return s; + } + } + /** + * optional string string = 6; + * + *
+       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+       * 
+ */ + @Override + public com.google.protobuf.ByteString + getStringBytes() { + Object ref = string_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + string_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATION_FIELD_NUMBER = 3; + private Operation operation_; + /** + * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + @Override + public boolean hasOperation() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+       * Perform a described operation on the string
+       * 
+ */ + @Override + public Operation getOperation() { + return operation_; + } + + 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
+       * 
+ */ + @Override + 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
+       * 
+ */ + @Override + 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
+       * 
+ */ + @Override + public int getSubstringIndex(int index) { + return substringIndex_.get(index); + } + private int substringIndexMemoizedSerializedSize = -1; + + 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
+       * 
+ */ + @Override + 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
+       * 
+ */ + @Override + 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
+       * 
+ */ + @Override + public int getReplaceChar(int index) { + return replaceChar_.get(index); + } + private int replaceCharMemoizedSerializedSize = -1; + + private void initFields() { + range_ = 1; + predefinedIndex_ = 0; + string_ = ""; + operation_ = Operation.NONE; + substringIndex_ = java.util.Collections.emptyList(); + replaceChar_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + 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_ & 0x00000008) == 0x00000008)) { + 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)); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(6, getStringBytes()); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + + @Override + 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_ & 0x00000008) == 0x00000008)) { + 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; + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, getStringBytes()); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static Record parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Record parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Record parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Record parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Record parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static Record parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static Record parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static Record parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static Record parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static 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(); } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(Record prototype) { + return newBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + Record, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) + RecordOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override + public Builder clear() { + super.clear(); + range_ = 1; + bitField0_ = (bitField0_ & ~0x00000001); + predefinedIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + string_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + operation_ = Operation.NONE; + bitField0_ = (bitField0_ & ~0x00000008); + substringIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + replaceChar_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override + public Record getDefaultInstanceForType() { + return Record.getDefaultInstance(); + } + + @Override + public Record build() { + Record result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Record buildPartial() { + Record result = new 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.string_ = string_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.operation_ = operation_; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + substringIndex_ = java.util.Collections.unmodifiableList(substringIndex_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.substringIndex_ = substringIndex_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + replaceChar_ = java.util.Collections.unmodifiableList(replaceChar_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.replaceChar_ = replaceChar_; + result.bitField0_ = to_bitField0_; + return result; + } + + @Override + public Builder mergeFrom(Record other) { + if (other == Record.getDefaultInstance()) return this; + if (other.hasRange()) { + setRange(other.getRange()); + } + if (other.hasPredefinedIndex()) { + setPredefinedIndex(other.getPredefinedIndex()); + } + if (other.hasString()) { + bitField0_ |= 0x00000004; + string_ = other.string_; + + } + if (other.hasOperation()) { + setOperation(other.getOperation()); + } + if (!other.substringIndex_.isEmpty()) { + if (substringIndex_.isEmpty()) { + substringIndex_ = other.substringIndex_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureSubstringIndexIsMutable(); + substringIndex_.addAll(other.substringIndex_); + } + + } + if (!other.replaceChar_.isEmpty()) { + if (replaceChar_.isEmpty()) { + replaceChar_ = other.replaceChar_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureReplaceCharIsMutable(); + replaceChar_.addAll(other.replaceChar_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Record parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Record) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + 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
+         * 
+ */ + @Override + 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
+         * 
+ */ + @Override + 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; + } + + private int predefinedIndex_ ; + /** + * optional int32 predefined_index = 2; + * + *
+         * Index of the predefined constant. If this field is present, the associated string is ignored
+         * 
+ */ + @Override + 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
+         * 
+ */ + @Override + 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; + } + + private Object string_ = ""; + /** + * optional string string = 6; + * + *
+         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+         * 
+ */ + @Override + public boolean hasString() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string string = 6; + * + *
+         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+         * 
+ */ + @Override + public String getString() { + Object ref = string_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + string_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + * optional string string = 6; + * + *
+         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+         * 
+ */ + @Override + public com.google.protobuf.ByteString + getStringBytes() { + Object ref = string_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + string_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string string = 6; + * + *
+         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+         * 
+ */ + public Builder setString( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + string_ = value; + + return this; + } + /** + * optional string string = 6; + * + *
+         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+         * 
+ */ + public Builder clearString() { + bitField0_ = (bitField0_ & ~0x00000004); + string_ = getDefaultInstance().getString(); + + return this; + } + /** + * optional string string = 6; + * + *
+         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
+         * 
+ */ + public Builder setStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + string_ = value; + + return this; + } + + private Operation operation_ = Operation.NONE; + /** + * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + @Override + public boolean hasOperation() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + @Override + public Operation getOperation() { + return operation_; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public Builder setOperation(Operation value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + operation_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; + * + *
+         * Perform a described operation on the string
+         * 
+ */ + public Builder clearOperation() { + bitField0_ = (bitField0_ & ~0x00000008); + operation_ = Operation.NONE; + + return this; + } + + private java.util.List substringIndex_ = java.util.Collections.emptyList(); + private void ensureSubstringIndexIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + substringIndex_ = new java.util.ArrayList(substringIndex_); + bitField0_ |= 0x00000010; + } + } + /** + * 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
+         * 
+ */ + @Override + 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
+         * 
+ */ + @Override + 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
+         * 
+ */ + @Override + 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( + Iterable values) { + ensureSubstringIndexIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.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_ & ~0x00000010); + + return this; + } + + private java.util.List replaceChar_ = java.util.Collections.emptyList(); + private void ensureReplaceCharIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + replaceChar_ = new java.util.ArrayList(replaceChar_); + bitField0_ |= 0x00000020; + } + } + /** + * 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
+         * 
+ */ + @Override + 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
+         * 
+ */ + @Override + 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
+         * 
+ */ + @Override + 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( + Iterable values) { + ensureReplaceCharIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.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_ & ~0x00000020); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) + } + + static { + defaultInstance = new Record(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) + } + + public static final int RECORD_FIELD_NUMBER = 1; + private java.util.List record_; + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + @Override + public java.util.List getRecordList() { + return record_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public java.util.List + getRecordOrBuilderList() { + return record_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + @Override + public int getRecordCount() { + return record_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + @Override + public Record getRecord(int index) { + return record_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public RecordOrBuilder getRecordOrBuilder( + int index) { + return record_.get(index); + } + + 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
+     * 
+ */ + @Override + 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
+     * 
+ */ + @Override + 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
+     * 
+ */ + @Override + 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; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + 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)); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + + @Override + 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 += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static StringTableTypes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static StringTableTypes parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static StringTableTypes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static StringTableTypes parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static StringTableTypes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static StringTableTypes parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static StringTableTypes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static StringTableTypes parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static StringTableTypes parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static 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(); } + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(StringTableTypes prototype) { + return newBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + StringTableTypes, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) + StringTableTypesOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override + public Builder clear() { + super.clear(); + record_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + localName_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override + public StringTableTypes getDefaultInstanceForType() { + return StringTableTypes.getDefaultInstance(); + } + + @Override + public StringTableTypes build() { + StringTableTypes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public StringTableTypes buildPartial() { + StringTableTypes result = new StringTableTypes(this); + 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; + } + + @Override + public Builder mergeFrom(StringTableTypes other) { + if (other == 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_); + } + + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + StringTableTypes parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (StringTableTypes) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + 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.metadata.jvm.StringTableTypes.Record record = 1; + */ + @Override + public java.util.List getRecordList() { + return java.util.Collections.unmodifiableList(record_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + @Override + public int getRecordCount() { + return record_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + @Override + public Record getRecord(int index) { + return record_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder setRecord( + int index, Record value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder setRecord( + int index, Record.Builder builderForValue) { + ensureRecordIsMutable(); + record_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord(Record value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + int index, Record value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecordIsMutable(); + record_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + Record.Builder builderForValue) { + ensureRecordIsMutable(); + record_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder addRecord( + int index, Record.Builder builderForValue) { + ensureRecordIsMutable(); + record_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder addAllRecord( + Iterable values) { + ensureRecordIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, record_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder clearRecord() { + record_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; + */ + public Builder removeRecord(int index) { + ensureRecordIsMutable(); + record_.remove(index); + + return this; + } + + 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
+       * 
+ */ + @Override + 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
+       * 
+ */ + @Override + 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
+       * 
+ */ + @Override + 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( + Iterable values) { + ensureLocalNameIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.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.metadata.jvm.StringTableTypes) + } + + static { + defaultInstance = new StringTableTypes(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) + } + + public interface JvmMethodSignatureOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional int32 name = 1; + */ + boolean hasName(); + /** + * optional int32 name = 1; + */ + int getName(); + + /** + * optional int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
+ */ + boolean hasDesc(); + /** + * optional int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
+ */ + int getDesc(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature} + */ + public static final class JvmMethodSignature extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) + JvmMethodSignatureOrBuilder { + // Use JvmMethodSignature.newBuilder() to construct. + private JvmMethodSignature(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private JvmMethodSignature(boolean noInit) { + + this.unknownFields = com.google.protobuf.ByteString.EMPTY; + } + + private static final JvmMethodSignature defaultInstance; + public static JvmMethodSignature getDefaultInstance() { + return defaultInstance; + } + + @Override + public JvmMethodSignature getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private JvmMethodSignature( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + name_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + desc_ = input.readInt32(); + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public JvmMethodSignature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new JvmMethodSignature(input, extensionRegistry); + } + }; + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private int name_; + /** + * optional int32 name = 1; + */ + @Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 name = 1; + */ + @Override + public int getName() { + return name_; + } + + public static final int DESC_FIELD_NUMBER = 2; + private int desc_; + /** + * optional int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
+ */ + @Override + public boolean hasDesc() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 desc = 2; + * + *
+     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+     * 
+ */ + @Override + public int getDesc() { + return desc_; + } + + private void initFields() { + name_ = 0; + desc_ = 0; + } + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, desc_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + + @Override + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, desc_); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static JvmMethodSignature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static JvmMethodSignature parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static JvmMethodSignature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static JvmMethodSignature parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static JvmMethodSignature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static JvmMethodSignature parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static JvmMethodSignature parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static JvmMethodSignature parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static JvmMethodSignature parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static JvmMethodSignature 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(); } + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(JvmMethodSignature prototype) { + return newBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + JvmMethodSignature, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) + JvmMethodSignatureOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.JvmMethodSignature.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override public Builder clear() { + super.clear(); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + desc_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @Override public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override + public JvmMethodSignature getDefaultInstanceForType() { + return JvmMethodSignature.getDefaultInstance(); + } + + @Override + public JvmMethodSignature build() { + JvmMethodSignature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public JvmMethodSignature buildPartial() { + JvmMethodSignature result = new JvmMethodSignature(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.desc_ = desc_; + result.bitField0_ = to_bitField0_; + return result; + } + + @Override + public Builder mergeFrom(JvmMethodSignature other) { + if (other == JvmMethodSignature.getDefaultInstance()) return this; + if (other.hasName()) { + setName(other.getName()); + } + if (other.hasDesc()) { + setDesc(other.getDesc()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + JvmMethodSignature parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (JvmMethodSignature) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int name_ ; + /** + * optional int32 name = 1; + */ + @Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 name = 1; + */ + @Override + public int getName() { + return name_; + } + /** + * optional int32 name = 1; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000001; + name_ = value; + + return this; + } + /** + * optional int32 name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; + + return this; + } + + private int desc_ ; + /** + * optional int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
+ */ + @Override + public boolean hasDesc() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
+ */ + @Override + public int getDesc() { + return desc_; + } + /** + * optional int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
+ */ + public Builder setDesc(int value) { + bitField0_ |= 0x00000002; + desc_ = value; + + return this; + } + /** + * optional int32 desc = 2; + * + *
+       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
+       * 
+ */ + public Builder clearDesc() { + bitField0_ = (bitField0_ & ~0x00000002); + desc_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) + } + + static { + defaultInstance = new JvmMethodSignature(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) + } + + public interface JvmFieldSignatureOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional int32 name = 1; + */ + boolean hasName(); + /** + * optional int32 name = 1; + */ + int getName(); + + /** + * optional int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
+ */ + boolean hasDesc(); + /** + * optional int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
+ */ + int getDesc(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature} + */ + public static final class JvmFieldSignature extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) + JvmFieldSignatureOrBuilder { + // Use JvmFieldSignature.newBuilder() to construct. + private JvmFieldSignature(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private JvmFieldSignature(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final JvmFieldSignature defaultInstance; + public static JvmFieldSignature getDefaultInstance() { + return defaultInstance; + } + + @Override + public JvmFieldSignature getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private JvmFieldSignature( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + name_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + desc_ = input.readInt32(); + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override public JvmFieldSignature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new JvmFieldSignature(input, extensionRegistry); + } + }; + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private int name_; + /** + * optional int32 name = 1; + */ + @Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 name = 1; + */ + @Override + public int getName() { + return name_; + } + + public static final int DESC_FIELD_NUMBER = 2; + private int desc_; + /** + * optional int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
+ */ + @Override + public boolean hasDesc() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 desc = 2; + * + *
+     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+     * 
+ */ + @Override + public int getDesc() { + return desc_; + } + + private void initFields() { + name_ = 0; + desc_ = 0; + } + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, desc_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + + @Override + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, name_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, desc_); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static JvmFieldSignature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static JvmFieldSignature parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static JvmFieldSignature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static JvmFieldSignature parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static JvmFieldSignature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static JvmFieldSignature parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static JvmFieldSignature parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static JvmFieldSignature parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static JvmFieldSignature parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static JvmFieldSignature 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(); } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(JvmFieldSignature prototype) { + return newBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + JvmFieldSignature, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) + JvmFieldSignatureOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.JvmFieldSignature.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override public Builder clear() { + super.clear(); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + desc_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @Override public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override + public JvmFieldSignature getDefaultInstanceForType() { + return JvmFieldSignature.getDefaultInstance(); + } + + @Override + public JvmFieldSignature build() { + JvmFieldSignature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public JvmFieldSignature buildPartial() { + JvmFieldSignature result = new JvmFieldSignature(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.desc_ = desc_; + result.bitField0_ = to_bitField0_; + return result; + } + + @Override + public Builder mergeFrom(JvmFieldSignature other) { + if (other == JvmFieldSignature.getDefaultInstance()) return this; + if (other.hasName()) { + setName(other.getName()); + } + if (other.hasDesc()) { + setDesc(other.getDesc()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + JvmFieldSignature parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (JvmFieldSignature) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int name_ ; + /** + * optional int32 name = 1; + */ + @Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 name = 1; + */ + @Override + public int getName() { + return name_; + } + /** + * optional int32 name = 1; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000001; + name_ = value; + + return this; + } + /** + * optional int32 name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; + + return this; + } + + private int desc_ ; + /** + * optional int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
+ */ + @Override + public boolean hasDesc() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
+ */ + @Override public int getDesc() { + return desc_; + } + /** + * optional int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
+ */ + public Builder setDesc(int value) { + bitField0_ |= 0x00000002; + desc_ = value; + + return this; + } + /** + * optional int32 desc = 2; + * + *
+       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
+       * 
+ */ + public Builder clearDesc() { + bitField0_ = (bitField0_ & ~0x00000002); + desc_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) + } + + static { + defaultInstance = new JvmFieldSignature(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) + } + + public interface JvmPropertySignatureOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + boolean hasField(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + JvmFieldSignature getField(); + + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+     * Annotations on properties are written on a synthetic method with this signature
+     * 
+ */ + boolean hasSyntheticMethod(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+     * Annotations on properties are written on a synthetic method with this signature
+     * 
+ */ + JvmMethodSignature getSyntheticMethod(); + + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + boolean hasGetter(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + JvmMethodSignature getGetter(); + + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + boolean hasSetter(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + JvmMethodSignature getSetter(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature} + */ + public static final class JvmPropertySignature extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) + JvmPropertySignatureOrBuilder { + // Use JvmPropertySignature.newBuilder() to construct. + private JvmPropertySignature(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private JvmPropertySignature(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final JvmPropertySignature defaultInstance; + public static JvmPropertySignature getDefaultInstance() { + return defaultInstance; + } + + @Override public JvmPropertySignature getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private JvmPropertySignature( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + JvmFieldSignature.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = field_.toBuilder(); + } + field_ = input.readMessage(JvmFieldSignature.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(field_); + field_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + JvmMethodSignature.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = syntheticMethod_.toBuilder(); + } + syntheticMethod_ = input.readMessage(JvmMethodSignature.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(syntheticMethod_); + syntheticMethod_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: { + JvmMethodSignature.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = getter_.toBuilder(); + } + getter_ = input.readMessage(JvmMethodSignature.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(getter_); + getter_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 34: { + JvmMethodSignature.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = setter_.toBuilder(); + } + setter_ = input.readMessage(JvmMethodSignature.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setter_); + setter_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override public JvmPropertySignature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new JvmPropertySignature(input, extensionRegistry); + } + }; + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int FIELD_FIELD_NUMBER = 1; + private JvmFieldSignature field_; + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + @Override public boolean hasField() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + @Override public JvmFieldSignature getField() { + return field_; + } + + public static final int SYNTHETIC_METHOD_FIELD_NUMBER = 2; + private JvmMethodSignature syntheticMethod_; + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+     * Annotations on properties are written on a synthetic method with this signature
+     * 
+ */ + @Override public boolean hasSyntheticMethod() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+     * Annotations on properties are written on a synthetic method with this signature
+     * 
+ */ + @Override public JvmMethodSignature getSyntheticMethod() { + return syntheticMethod_; + } + + public static final int GETTER_FIELD_NUMBER = 3; + private JvmMethodSignature getter_; + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + @Override public boolean hasGetter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + @Override public JvmMethodSignature getGetter() { + return getter_; + } + + public static final int SETTER_FIELD_NUMBER = 4; + private JvmMethodSignature setter_; + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + @Override public boolean hasSetter() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + @Override public JvmMethodSignature getSetter() { + return setter_; + } + + private void initFields() { + field_ = JvmFieldSignature.getDefaultInstance(); + syntheticMethod_ = JvmMethodSignature.getDefaultInstance(); + getter_ = JvmMethodSignature.getDefaultInstance(); + setter_ = JvmMethodSignature.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + @Override public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, field_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, syntheticMethod_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(3, getter_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(4, setter_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + @Override public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, field_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, syntheticMethod_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getter_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, setter_); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static JvmPropertySignature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static JvmPropertySignature parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static JvmPropertySignature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static JvmPropertySignature parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static JvmPropertySignature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static JvmPropertySignature parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static JvmPropertySignature parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static JvmPropertySignature parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static JvmPropertySignature parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static JvmPropertySignature 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(); } + @Override public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(JvmPropertySignature prototype) { + return newBuilder().mergeFrom(prototype); + } + @Override public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + JvmPropertySignature, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) + JvmPropertySignatureOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.JvmPropertySignature.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + @Override public Builder clear() { + super.clear(); + field_ = JvmFieldSignature.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + syntheticMethod_ = JvmMethodSignature.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + getter_ = JvmMethodSignature.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + setter_ = JvmMethodSignature.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @Override public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + @Override public JvmPropertySignature getDefaultInstanceForType() { + return JvmPropertySignature.getDefaultInstance(); + } + + @Override public JvmPropertySignature build() { + JvmPropertySignature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override public JvmPropertySignature buildPartial() { + JvmPropertySignature result = new JvmPropertySignature(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.field_ = field_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.syntheticMethod_ = syntheticMethod_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.getter_ = getter_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.setter_ = setter_; + result.bitField0_ = to_bitField0_; + return result; + } + + @Override public Builder mergeFrom(JvmPropertySignature other) { + if (other == JvmPropertySignature.getDefaultInstance()) return this; + if (other.hasField()) { + mergeField(other.getField()); + } + if (other.hasSyntheticMethod()) { + mergeSyntheticMethod(other.getSyntheticMethod()); + } + if (other.hasGetter()) { + mergeGetter(other.getGetter()); + } + if (other.hasSetter()) { + mergeSetter(other.getSetter()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + @Override public final boolean isInitialized() { + return true; + } + + @Override public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + JvmPropertySignature parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (JvmPropertySignature) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private JvmFieldSignature field_ = JvmFieldSignature.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + @Override public boolean hasField() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + @Override public JvmFieldSignature getField() { + return field_; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + public Builder setField(JvmFieldSignature value) { + if (value == null) { + throw new NullPointerException(); + } + field_ = value; + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + public Builder setField( + JvmFieldSignature.Builder builderForValue) { + field_ = builderForValue.build(); + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + public Builder mergeField(JvmFieldSignature value) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + field_ != JvmFieldSignature.getDefaultInstance()) { + field_ = + JvmFieldSignature.newBuilder(field_).mergeFrom(value).buildPartial(); + } else { + field_ = value; + } + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; + */ + public Builder clearField() { + field_ = JvmFieldSignature.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + private JvmMethodSignature syntheticMethod_ = JvmMethodSignature.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+       * Annotations on properties are written on a synthetic method with this signature
+       * 
+ */ + @Override public boolean hasSyntheticMethod() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+       * Annotations on properties are written on a synthetic method with this signature
+       * 
+ */ + @Override public JvmMethodSignature getSyntheticMethod() { + return syntheticMethod_; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+       * Annotations on properties are written on a synthetic method with this signature
+       * 
+ */ + public Builder setSyntheticMethod(JvmMethodSignature value) { + if (value == null) { + throw new NullPointerException(); + } + syntheticMethod_ = value; + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+       * Annotations on properties are written on a synthetic method with this signature
+       * 
+ */ + public Builder setSyntheticMethod( + JvmMethodSignature.Builder builderForValue) { + syntheticMethod_ = builderForValue.build(); + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+       * Annotations on properties are written on a synthetic method with this signature
+       * 
+ */ + public Builder mergeSyntheticMethod(JvmMethodSignature value) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + syntheticMethod_ != JvmMethodSignature.getDefaultInstance()) { + syntheticMethod_ = + JvmMethodSignature.newBuilder(syntheticMethod_).mergeFrom(value).buildPartial(); + } else { + syntheticMethod_ = value; + } + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; + * + *
+       * Annotations on properties are written on a synthetic method with this signature
+       * 
+ */ + public Builder clearSyntheticMethod() { + syntheticMethod_ = JvmMethodSignature.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + private JvmMethodSignature getter_ = JvmMethodSignature.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + @Override public boolean hasGetter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + @Override public JvmMethodSignature getGetter() { + return getter_; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + public Builder setGetter(JvmMethodSignature value) { + if (value == null) { + throw new NullPointerException(); + } + getter_ = value; + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + public Builder setGetter( + JvmMethodSignature.Builder builderForValue) { + getter_ = builderForValue.build(); + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + public Builder mergeGetter(JvmMethodSignature value) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + getter_ != JvmMethodSignature.getDefaultInstance()) { + getter_ = + JvmMethodSignature.newBuilder(getter_).mergeFrom(value).buildPartial(); + } else { + getter_ = value; + } + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; + */ + public Builder clearGetter() { + getter_ = JvmMethodSignature.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + private JvmMethodSignature setter_ = JvmMethodSignature.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + @Override public boolean hasSetter() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + @Override public JvmMethodSignature getSetter() { + return setter_; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + public Builder setSetter(JvmMethodSignature value) { + if (value == null) { + throw new NullPointerException(); + } + setter_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + public Builder setSetter( + JvmMethodSignature.Builder builderForValue) { + setter_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + public Builder mergeSetter(JvmMethodSignature value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + setter_ != JvmMethodSignature.getDefaultInstance()) { + setter_ = + JvmMethodSignature.newBuilder(setter_).mergeFrom(value).buildPartial(); + } else { + setter_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; + */ + public Builder clearSetter() { + setter_ = JvmMethodSignature.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) + } + + static { + defaultInstance = new JvmPropertySignature(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) + } + + public static final int CONSTRUCTOR_SIGNATURE_FIELD_NUMBER = 100; + /** + * extend .org.jetbrains.kotlin.metadata.Constructor { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor, + JvmMethodSignature> constructorSignature = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance(), + JvmMethodSignature.getDefaultInstance(), + JvmMethodSignature.getDefaultInstance(), + null, + 100, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + JvmMethodSignature.class); + public static final int METHOD_SIGNATURE_FIELD_NUMBER = 100; + /** + * extend .org.jetbrains.kotlin.metadata.Function { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Function, + JvmMethodSignature> methodSignature = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance(), + JvmMethodSignature.getDefaultInstance(), + JvmMethodSignature.getDefaultInstance(), + null, + 100, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + JvmMethodSignature.class); + public static final int LAMBDA_CLASS_ORIGIN_NAME_FIELD_NUMBER = 101; + /** + * extend .org.jetbrains.kotlin.metadata.Function { ... } + * + *
+   * For lambdas from bodies of inline functions copied to the use site, the JVM internal name of the original
+   * lambda class this class is copied from
+   * 
+ */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Function, + Integer> lambdaClassOriginName = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance(), + 0, + null, + null, + 101, + com.google.protobuf.WireFormat.FieldType.INT32, + Integer.class); + public static final int PROPERTY_SIGNATURE_FIELD_NUMBER = 100; + /** + * extend .org.jetbrains.kotlin.metadata.Property { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Property, + JvmPropertySignature> propertySignature = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(), + JvmPropertySignature.getDefaultInstance(), + JvmPropertySignature.getDefaultInstance(), + null, + 100, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + JvmPropertySignature.class); + public static final int FLAGS_FIELD_NUMBER = 101; + /** + * extend .org.jetbrains.kotlin.metadata.Property { ... } + * + *
+   **
+   *isMovedFromInterfaceCompanion   true if this property is declared in an interface companion, and the field is stored in the interface
+   * 
+ */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Property, + Integer> flags = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(), + 0, + null, + null, + 101, + com.google.protobuf.WireFormat.FieldType.INT32, + Integer.class); + public static final int TYPE_ANNOTATION_FIELD_NUMBER = 100; + /** + * extend .org.jetbrains.kotlin.metadata.Type { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Type, + java.util.List> typeAnnotation = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(), + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(), + null, + 100, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false, + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class); + public static final int IS_RAW_FIELD_NUMBER = 101; + /** + * extend .org.jetbrains.kotlin.metadata.Type { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Type, + Boolean> isRaw = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(), + false, + null, + null, + 101, + com.google.protobuf.WireFormat.FieldType.BOOL, + Boolean.class); + public static final int TYPE_PARAMETER_ANNOTATION_FIELD_NUMBER = 100; + /** + * extend .org.jetbrains.kotlin.metadata.TypeParameter { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter, + java.util.List> typeParameterAnnotation = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.getDefaultInstance(), + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(), + null, + 100, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false, + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class); + public static final int CLASS_MODULE_NAME_FIELD_NUMBER = 101; + /** + * extend .org.jetbrains.kotlin.metadata.Class { ... } + * + *
+   * If absent, assumed to be "main" (JvmProtoBufUtil.DEFAULT_MODULE_NAME)
+   * 
+ */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Class, + Integer> classModuleName = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(), + 0, + null, + null, + 101, + com.google.protobuf.WireFormat.FieldType.INT32, + Integer.class); + public static final int CLASS_LOCAL_VARIABLE_FIELD_NUMBER = 102; + /** + * extend .org.jetbrains.kotlin.metadata.Class { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Class, + java.util.List> classLocalVariable = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(), + org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(), + null, + 102, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false, + org.jetbrains.kotlin.metadata.ProtoBuf.Property.class); + public static final int ANONYMOUS_OBJECT_ORIGIN_NAME_FIELD_NUMBER = 103; + /** + * extend .org.jetbrains.kotlin.metadata.Class { ... } + * + *
+   * For anonymous objects from bodies of inline functions copied to the use site, the JVM internal name of the original
+   * anonymous object this class is copied from
+   * 
+ */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Class, + Integer> anonymousObjectOriginName = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(), + 0, + null, + null, + 103, + com.google.protobuf.WireFormat.FieldType.INT32, + Integer.class); + public static final int JVM_CLASS_FLAGS_FIELD_NUMBER = 104; + /** + * extend .org.jetbrains.kotlin.metadata.Class { ... } + * + *
+   * first bit: isFunctionBodyInInterface: 0 if actual body generated in DefaultImpl, 1 - otherwise (in interface default method)
+   * second bit: is all-compatibility mode or not, 1 - yes, 0 - no
+   * 
+ */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Class, + Integer> jvmClassFlags = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(), + 0, + null, + null, + 104, + com.google.protobuf.WireFormat.FieldType.INT32, + Integer.class); + public static final int PACKAGE_MODULE_NAME_FIELD_NUMBER = 101; + /** + * extend .org.jetbrains.kotlin.metadata.Package { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Package, + Integer> packageModuleName = com.google.protobuf.GeneratedMessageLite + .newSingularGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(), + 0, + null, + null, + 101, + com.google.protobuf.WireFormat.FieldType.INT32, + Integer.class); + public static final int PACKAGE_LOCAL_VARIABLE_FIELD_NUMBER = 102; + /** + * extend .org.jetbrains.kotlin.metadata.Package { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.kotlin.metadata.ProtoBuf.Package, + java.util.List> packageLocalVariable = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(), + org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(), + null, + 102, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false, + org.jetbrains.kotlin.metadata.ProtoBuf.Property.class); + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} \ No newline at end of file diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java new file mode 100644 index 0000000000..1fa961b25d --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java @@ -0,0 +1,276 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.jvm.deserialization; + +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; + +import static org.jetbrains.kotlin.metadata.jvm.deserialization.UtfEncodingKt.MAX_UTF8_INFO_LENGTH; + +public class BitEncoding { + private static final boolean FORCE_8TO7_ENCODING; + + static { + String use8to7; + try { + use8to7 = System.getProperty("kotlin.jvm.serialization.use8to7"); + } + catch (SecurityException e) { + use8to7 = null; + } + + FORCE_8TO7_ENCODING = "true".equals(use8to7); + } + + private static final char _8TO7_MODE_MARKER = (char) -1; + + private BitEncoding() { + } + + /** + * Converts a byte array of serialized data to an array of {@code String} satisfying JVM annotation value argument restrictions: + *
    + *
  1. Each string's length should be no more than 65535
  2. + *
  3. UTF-8 representation of each string cannot contain bytes in the range 0xf0..0xff
  4. + *
+ */ + @NotNull + public static String[] encodeBytes(@NotNull byte[] data) { + // TODO: try both encodings here and choose the best one (with the smallest size) + if (!FORCE_8TO7_ENCODING) { + return UtfEncodingKt.bytesToStrings(data); + } + byte[] bytes = encode8to7(data); + // Since 0x0 byte is encoded as two bytes in the Modified UTF-8 (0xc0 0x80) and zero is rather common to byte arrays, we increment + // every byte by one modulo max byte value, so that the less common value 0x7f will be represented as two bytes instead. + addModuloByte(bytes, 1); + return splitBytesToStringArray(bytes); + } + + /** + * Converts a byte array to another byte array, every element of which is in the range 0x0..0x7f. + * + * The conversion is equivalent to the following: input bytes are combined into one long bit string. This big string is then split into + * groups of 7 bits. Each resulting 7-bit chunk is then converted to a byte (with a leading bit = 0). The last chunk may have less than + * 7 bits, it's prepended with zeros to form a byte. The result is then the array of these bytes, each of which is obviously in the + * range 0x0..0x7f. + * + * Suppose the input of 4 bytes is given (bytes are listed from the beginning to the end, each byte from the least significant bit to + * the most significant bit, bits within each byte are numbered): + * + * 01234567 01234567 01234567 01234567 + * + * The output for this kind of input will be of the following form ('#' represents a zero bit): + * + * 0123456# 7012345# 6701234# 5670123# 4567#### + */ + @NotNull + private static byte[] encode8to7(@NotNull byte[] data) { + // ceil(data.length * 8 / 7) + int resultLength = (data.length * 8 + 6) / 7; + byte[] result = new byte[resultLength]; + + // We maintain a pointer to the bit in the input, which is represented by two numbers: index of the current byte in the input and + // the index of a bit inside this byte (0 is least significant, 7 is most significant) + int byteIndex = 0; + int bit = 0; + + // Write all resulting bytes except the last one. To do this we need to collect exactly 7 bits, starting from the current, into a + // byte. In almost all cases these 7 bits can be collected from two parts: the first is several (at least one) most significant bits + // from the current byte, the second is several (maybe zero) least significant bits from the next byte. The special case is when the + // current bit is the first (least significant) bit in its byte (bit == 0): then the 7 needed bits are just the 7 least significant + // of the current byte. + for (int i = 0; i < resultLength - 1; i++) { + if (bit == 0) { + result[i] = (byte) (data[byteIndex] & 0x7f); + bit = 7; + continue; + } + + int firstPart = (data[byteIndex] & 0xff) >>> bit; + int newBit = (bit + 7) & 7; + int secondPart = (data[++byteIndex] & ((1 << newBit) - 1)) << 8 - bit; + result[i] = (byte) (firstPart + secondPart); + bit = newBit; + } + + // Write the last byte, which is just several most significant bits of the last byte in the input, padded with zeros + if (resultLength > 0) { + assert bit != 0 : "The last chunk cannot start from the input byte since otherwise at least one bit will remain unprocessed"; + assert byteIndex == data.length - 1 : "The last 7-bit chunk should be encoded from the last input byte: " + + byteIndex + " != " + (data.length - 1); + result[resultLength - 1] = (byte) ((data[byteIndex] & 0xff) >>> bit); + } + + return result; + } + + private static void addModuloByte(@NotNull byte[] data, int increment) { + for (int i = 0, n = data.length; i < n; i++) { + data[i] = (byte) ((data[i] + increment) & 0x7f); + } + } + + /** + * Converts a big byte array into the array of strings, where each string, when written to the constant pool table in bytecode, produces + * a byte array of not more than MAX_UTF8_INFO_LENGTH. Each byte, except those which are 0x0, occupies exactly one byte in the constant + * pool table. Zero bytes occupy two bytes in the table each. + * + * When strings are constructed from the array of bytes here, they are encoded in the platform's default encoding. This is fine: the + * conversion to the Modified UTF-8 (which here would be equivalent to replacing each 0x0 with 0xc0 0x80) will happen later by ASM, when + * it writes these strings to the bytecode + */ + @NotNull + private static String[] splitBytesToStringArray(@NotNull byte[] data) { + List result = new ArrayList(); + + // The offset where the currently processed string starts + int off = 0; + + // The effective length the bytes of the current string would occupy in the constant pool table. + // 2 because the first char is -1 which denotes the encoding mode and occupies two bytes in Modified UTF-8 + int len = 2; + + boolean encodingModeAdded = false; + + for (int i = 0, n = data.length; i < n; i++) { + // When the effective length reaches at least MAX - 1, we add the current string to the result. Note that the effective length + // is at most MAX here: non-zero bytes occupy 1 byte and zero bytes occupy 2 bytes, so we couldn't jump over more than one byte + if (len >= MAX_UTF8_INFO_LENGTH - 1) { + assert len <= MAX_UTF8_INFO_LENGTH : "Produced strings cannot contain more than " + MAX_UTF8_INFO_LENGTH + " bytes: " + len; + String string = new String(data, off, i - off); + if (!encodingModeAdded) { + encodingModeAdded = true; + result.add(_8TO7_MODE_MARKER + string); + } + else { + result.add(string); + } + off = i; + len = 0; + } + + if (data[i] == 0) { + len += 2; + } + else { + len++; + } + } + + if (len >= 0) { + result.add(new String(data, off, data.length - off)); + } + + //noinspection SSBasedInspection + return result.toArray(new String[result.size()]); + } + + /** + * Converts encoded array of {@code String} obtained by {@link BitEncoding#encodeBytes(byte[])} back to a byte array. + */ + @NotNull + public static byte[] decodeBytes(@NotNull String[] data) { + if (data.length > 0 && !data[0].isEmpty()) { + char possibleMarker = data[0].charAt(0); + if (possibleMarker == UtfEncodingKt.UTF8_MODE_MARKER) { + return UtfEncodingKt.stringsToBytes(dropMarker(data)); + } + if (possibleMarker == _8TO7_MODE_MARKER) { + data = dropMarker(data); + } + } + + byte[] bytes = combineStringArrayIntoBytes(data); + // Adding 0x7f modulo max byte value is equivalent to subtracting 1 the same modulo, which is inverse to what happens in encodeBytes + addModuloByte(bytes, 0x7f); + return decode7to8(bytes); + } + + @NotNull + private static String[] dropMarker(@NotNull String[] data) { + // Clone because the clients should be able to use the passed array for their own purposes. + // This is cheap because the size of the array is 1 or 2 almost always. + String[] result = data.clone(); + result[0] = result[0].substring(1); + return result; + } + + /** + * Combines the array of strings resulted from encodeBytes() into one long byte array + */ + @NotNull + private static byte[] combineStringArrayIntoBytes(@NotNull String[] data) { + int resultLength = 0; + for (String s : data) { + assert s.length() <= MAX_UTF8_INFO_LENGTH : "String is too long: " + s.length(); + resultLength += s.length(); + } + + byte[] result = new byte[resultLength]; + int p = 0; + for (String s : data) { + for (int i = 0, n = s.length(); i < n; i++) { + result[p++] = (byte) s.charAt(i); + } + } + + return result; + } + + /** + * Decodes the byte array resulted from encode8to7(). + * + * Each byte of the input array has at most 7 valuable bits of information. So the decoding is equivalent to the following: least + * significant 7 bits of all input bytes are combined into one long bit string. This bit string is then split into groups of 8 bits, + * each of which forms a byte in the output. If there are any leftovers, they are ignored, since they were added just as a padding and + * do not comprise a full byte. + * + * Suppose the following encoded byte array is given (bits are numbered the same way as in encode8to7() doc): + * + * 01234567 01234567 01234567 01234567 + * + * The output of the following form would be produced: + * + * 01234560 12345601 23456012 + * + * Note how all most significant bits and leftovers are dropped, since they don't contain any useful information + */ + @NotNull + private static byte[] decode7to8(@NotNull byte[] data) { + // floor(7 * data.length / 8) + int resultLength = 7 * data.length / 8; + + byte[] result = new byte[resultLength]; + + // We maintain a pointer to an input bit in the same fashion as in encode8to7(): it's represented as two numbers: index of the + // current byte in the input and index of the bit in the byte + int byteIndex = 0; + int bit = 0; + + // A resulting byte is comprised of 8 bits, starting from the current bit. Since each input byte only "contains 7 bytes", a + // resulting byte always consists of two parts: several most significant bits of the current byte and several least significant bits + // of the next byte + for (int i = 0; i < resultLength; i++) { + int firstPart = (data[byteIndex] & 0xff) >>> bit; + byteIndex++; + int secondPart = (data[byteIndex] & ((1 << (bit + 1)) - 1)) << 7 - bit; + result[i] = (byte) (firstPart + secondPart); + + if (bit == 6) { + byteIndex++; + bit = 0; + } + else { + bit++; + } + } + + return result; + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt new file mode 100644 index 0000000000..db5dba08a8 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt @@ -0,0 +1,82 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.jvm.deserialization + +// The purpose of this class is to map Kotlin classes to JVM bytecode desc strings, as KotlinTypeMapper does in the backend. +// It's used as an optimization during serialization/deserialization: if there's no JVM signature for a method/property/constructor, +// it means that the JVM signature should be trivially computable from the Kotlin signature with this class. +// It's not required to support everything in KotlinTypeMapper, but the more it does, the more we save on JVM signatures in proto metadata. +// +// WARNING: improving the behavior of this class MAY BREAK BINARY COMPATIBILITY of code compiled by Kotlin, because it may make +// the new compiler skip writing the signatures it now thinks are trivial, and the old compiler would recreate them incorrectly. +object ClassMapperLite { + // Simply "kotlin", but to avoid being renamed by namespace relocation (e.g., Shadow.relocate gradle plugin) + private val kotlin = listOf('k', 'o', 't', 'l', 'i', 'n').joinToString(separator = "") + // Kotlin ClassId -> JVM desc + // e.g. "kotlin.IntArray" -> "[I" + // "kotlin.String.Companion" -> "Lkotlin/jvm/internal/StringCompanionObject" + // "kotlin/collections/Map.Entry" -> "Ljava/util/Map$Entry" + private val map: Map = mutableMapOf().apply { + val primitives = listOf( + "Boolean", "Z", + "Char", "C", + "Byte", "B", + "Short", "S", + "Int", "I", + "Float", "F", + "Long", "J", + "Double", "D" + ) + + for (i in primitives.indices step 2) { + put("$kotlin/${primitives[i]}", primitives[i + 1]) + put("$kotlin/${primitives[i]}Array", "[${primitives[i + 1]}") + } + + put("$kotlin/Unit", "V") + + fun add(kotlinSimpleName: String, javaInternalName: String) { + put("$kotlin/$kotlinSimpleName", "L$javaInternalName;") + } + + add("Any", "java/lang/Object") + add("Nothing", "java/lang/Void") + add("Annotation", "java/lang/annotation/Annotation") + + for (klass in listOf("String", "CharSequence", "Throwable", "Cloneable", "Number", "Comparable", "Enum")) { + add(klass, "java/lang/$klass") + } + + for (klass in listOf("Iterator", "Collection", "List", "Set", "Map", "ListIterator")) { + add("collections/$klass", "java/util/$klass") + add("collections/Mutable$klass", "java/util/$klass") + } + + add("collections/Iterable", "java/lang/Iterable") + add("collections/MutableIterable", "java/lang/Iterable") + add("collections/Map.Entry", "java/util/Map\$Entry") + add("collections/MutableMap.MutableEntry", "java/util/Map\$Entry") + + for (i in 0..22) { + add("Function$i", "$kotlin/jvm/functions/Function$i") + add("reflect/KFunction$i", "$kotlin/reflect/KFunction") + } + + //Boolean is purposefully omitted from this list, even though it has a Companion Object. + //This assures that an older compiler won't get confused by the new signature, preventing a bug in compatibility. + for (klass in listOf("Char", "Byte", "Short", "Int", "Float", "Long", "Double", "String", "Enum")) { + add("$klass.Companion", "$kotlin/jvm/internal/${klass}CompanionObject") + } + } + + /** + * @param classId the name of the class in the format: "org/foo/bar/Test.Inner" + */ + @JvmStatic + fun mapClass(classId: String): String { + return map[classId] ?: "L${classId.replace('.', '$')};" + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmFlags.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmFlags.kt new file mode 100644 index 0000000000..c1471b4cc1 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmFlags.kt @@ -0,0 +1,27 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.jvm.deserialization + +import org.jetbrains.kotlin.metadata.deserialization.Flags + +/** + * @see Flags + */ +object JvmFlags { + // Properties + val IS_MOVED_FROM_INTERFACE_COMPANION = Flags.FlagField.booleanFirst() + + //Class + val ARE_INTERFACE_METHOD_BODIES_INSIDE = Flags.FlagField.booleanFirst() + val IS_ALL_COMPATIBILITY_MODE = Flags.FlagField.booleanAfter(ARE_INTERFACE_METHOD_BODIES_INSIDE) + + fun getPropertyFlags(isMovedFromInterfaceCompanion: Boolean): Int = + IS_MOVED_FROM_INTERFACE_COMPANION.toFlags(isMovedFromInterfaceCompanion) + + fun getClassFlags(isAllInterfaceBodiesInside: Boolean, isAllCompatibilityMode: Boolean): Int = + ARE_INTERFACE_METHOD_BODIES_INSIDE.toFlags(isAllInterfaceBodiesInside) or IS_ALL_COMPATIBILITY_MODE.toFlags(isAllCompatibilityMode) + +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt new file mode 100644 index 0000000000..3d986ac8ed --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.jvm.deserialization + +/** + * A signature of JVM method or field + * + * @property name name of method or field + * @property desc JVM descriptor of a method, e.g. `(Ljava/lang/Object;)Z`, or a field type, e.g. `Ljava/lang/String;` + */ +sealed class JvmMemberSignature { + + abstract val name: String + abstract val desc: String + + data class Method(override val name: String, override val desc: String) : JvmMemberSignature() { + override fun asString() = name + desc + } + + data class Field(override val name: String, override val desc: String) : JvmMemberSignature() { + override fun asString() = "$name:$desc" + } + + final override fun toString() = asString() + abstract fun asString(): String +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt new file mode 100644 index 0000000000..22ae894022 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.jvm.deserialization + +import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion + +/** + * The version of the metadata serialized by the compiler and deserialized by the compiler and reflection. + * This version includes the version of the core protobuf messages (metadata.proto) as well as JVM extensions (jvm_metadata.proto). + */ +class JvmMetadataVersion(versionArray: IntArray, val isStrictSemantics: Boolean) : BinaryVersion(*versionArray) { + constructor(vararg numbers: Int) : this(numbers, isStrictSemantics = false) + + override fun isCompatible(): Boolean = + // NOTE: 1.0 is a pre-Kotlin-1.0 metadata version, with which the current compiler is incompatible + (major != 1 || minor != 0) && + if (isStrictSemantics) { + isCompatibleTo(INSTANCE) + } else { + // Kotlin 1.N is able to read metadata of versions up to Kotlin 1.{N+1} (unless the version has strict semantics). + major == INSTANCE.major && minor <= INSTANCE.minor + 1 + } + + companion object { + @JvmField + val INSTANCE = JvmMetadataVersion(1, 5, 1) + + @JvmField + val INVALID_VERSION = JvmMetadataVersion() + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt new file mode 100644 index 0000000000..45dfe1d8ea --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt @@ -0,0 +1,120 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.jvm.deserialization + +import org.jetbrains.kotlin.metadata.deserialization.NameResolver +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.* + +class JvmNameResolver( + val types: JvmProtoBuf.StringTableTypes, + 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 + // Note that as an optimization, range of each expanded record is equal to the original range, not 1. If correct ranges are needed, + // please use the original record representation in [types.recordList]. + 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 = when { + record.hasString() -> record.string + 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 getQualifiedClassName(index: Int): String = + getString(index) + + override fun isLocalClassName(index: Int): Boolean = + index in localNameIndices + + companion object { + // Simply "kotlin", but to avoid being renamed by namespace relocation (e.g., Shadow.relocate gradle plugin) + private val kotlin = listOf('k', 'o', 't', 'l', 'i', 'n').joinToString(separator = "") + + 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/collections/Iterable", "$kotlin/collections/MutableIterable", + "$kotlin/collections/Collection", "$kotlin/collections/MutableCollection", + "$kotlin/collections/List", "$kotlin/collections/MutableList", + "$kotlin/collections/Set", "$kotlin/collections/MutableSet", + "$kotlin/collections/Map", "$kotlin/collections/MutableMap", + "$kotlin/collections/Map.Entry", "$kotlin/collections/MutableMap.MutableEntry", + + "$kotlin/collections/Iterator", "$kotlin/collections/MutableIterator", + "$kotlin/collections/ListIterator", "$kotlin/collections/MutableListIterator" + ) + + private val PREDEFINED_STRINGS_MAP = PREDEFINED_STRINGS.withIndex().associateBy({ it.value }, { it.index }) + + fun getPredefinedStringIndex(string: String): Int? = PREDEFINED_STRINGS_MAP[string] + } +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt new file mode 100644 index 0000000000..1df851e6dd --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt @@ -0,0 +1,137 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.jvm.deserialization + +import com.google.protobuf.ExtensionRegistryLite +import com.google.protobuf.MessageLite +import org.jetbrains.kotlin.metadata.ProtoBuf +import org.jetbrains.kotlin.metadata.deserialization.* +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf +import org.jetbrains.kotlin.metadata.jvm.serialization.JvmStringTable +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream +import java.io.InputStream + + +object JvmProtoBufUtil { + val EXTENSION_REGISTRY: ExtensionRegistryLite = ExtensionRegistryLite.newInstance().apply(JvmProtoBuf::registerAllExtensions) + + const val PLATFORM_TYPE_ID = "kotlin.jvm.PlatformType" + + const val DEFAULT_MODULE_NAME = "main" + + @JvmStatic + fun readClassDataFrom(data: Array, strings: Array): Pair = + readClassDataFrom(BitEncoding.decodeBytes(data), strings) + + @JvmStatic + fun readClassDataFrom(bytes: ByteArray, strings: Array): Pair { + val input = ByteArrayInputStream(bytes) + return Pair(input.readNameResolver(strings), ProtoBuf.Class.parseFrom(input, EXTENSION_REGISTRY)) + } + + @JvmStatic + fun readPackageDataFrom(data: Array, strings: Array): Pair = + readPackageDataFrom(BitEncoding.decodeBytes(data), strings) + + @JvmStatic + fun readPackageDataFrom(bytes: ByteArray, strings: Array): Pair { + val input = ByteArrayInputStream(bytes) + return Pair(input.readNameResolver(strings), ProtoBuf.Package.parseFrom(input, EXTENSION_REGISTRY)) + } + + @JvmStatic + fun readFunctionDataFrom(data: Array, strings: Array): Pair { + val input = ByteArrayInputStream(BitEncoding.decodeBytes(data)) + return Pair(input.readNameResolver(strings), ProtoBuf.Function.parseFrom(input, EXTENSION_REGISTRY)) + } + + private fun InputStream.readNameResolver(strings: Array): JvmNameResolver = + JvmNameResolver(JvmProtoBuf.StringTableTypes.parseDelimitedFrom(this, EXTENSION_REGISTRY), strings) + + /** + * Serializes [message] and [stringTable] into a string array which must be further written to [Metadata.data1] + */ + @JvmStatic + fun writeData(message: MessageLite, stringTable: JvmStringTable): Array = + BitEncoding.encodeBytes(ByteArrayOutputStream().apply { + stringTable.serializeTo(this) + message.writeTo(this) + }.toByteArray()) + + // returns JVM signature in the format: "equals(Ljava/lang/Object;)Z" + fun getJvmMethodSignature( + proto: ProtoBuf.Function, + nameResolver: NameResolver, + typeTable: TypeTable + ): JvmMemberSignature.Method? { + val signature = proto.getExtensionOrNull(JvmProtoBuf.methodSignature) + val name = if (signature != null && signature.hasName()) signature.name else proto.name + val desc = if (signature != null && signature.hasDesc()) { + nameResolver.getString(signature.desc) + } else { + val parameterTypes = listOfNotNull(proto.receiverType(typeTable)) + proto.valueParameterList.map { it.type(typeTable) } + + val parametersDesc = parameterTypes.map { mapTypeDefault(it, nameResolver) ?: return null } + val returnTypeDesc = mapTypeDefault(proto.returnType(typeTable), nameResolver) ?: return null + + parametersDesc.joinToString(separator = "", prefix = "(", postfix = ")") + returnTypeDesc + } + return JvmMemberSignature.Method(nameResolver.getString(name), desc) + } + + fun getJvmConstructorSignature( + proto: ProtoBuf.Constructor, + nameResolver: NameResolver, + typeTable: TypeTable + ): JvmMemberSignature.Method? { + val signature = proto.getExtensionOrNull(JvmProtoBuf.constructorSignature) + val name = if (signature != null && signature.hasName()) { + nameResolver.getString(signature.name) + } else { + "" + } + val desc = if (signature != null && signature.hasDesc()) { + nameResolver.getString(signature.desc) + } else { + proto.valueParameterList.map { + mapTypeDefault(it.type(typeTable), nameResolver) ?: return null + }.joinToString(separator = "", prefix = "(", postfix = ")V") + } + return JvmMemberSignature.Method(name, desc) + } + + fun getJvmFieldSignature( + proto: ProtoBuf.Property, + nameResolver: NameResolver, + typeTable: TypeTable, + requireHasFieldFlag: Boolean = true + ): JvmMemberSignature.Field? { + val signature = proto.getExtensionOrNull(JvmProtoBuf.propertySignature) ?: return null + val field = if (signature.hasField()) signature.field else null + if (field == null && requireHasFieldFlag) return null + + val name = if (field != null && field.hasName()) field.name else proto.name + val desc = + if (field != null && field.hasDesc()) nameResolver.getString(field.desc) + else mapTypeDefault(proto.returnType(typeTable), nameResolver) ?: return null + + return JvmMemberSignature.Field(nameResolver.getString(name), desc) + } + + + private fun mapTypeDefault(type: ProtoBuf.Type, nameResolver: NameResolver): String? { + return if (type.hasClassName()) ClassMapperLite.mapClass(nameResolver.getQualifiedClassName(type.className)) else null + } + + @JvmStatic + fun isMovedFromInterfaceCompanion(proto: ProtoBuf.Property): Boolean = + JvmFlags.IS_MOVED_FROM_INTERFACE_COMPANION.get(proto.getExtension(JvmProtoBuf.flags)) + + @JvmStatic + fun isNewPlaceForBodyGeneration(proto: ProtoBuf.Class): Boolean = + JvmFlags.ARE_INTERFACE_METHOD_BODIES_INSIDE.get(proto.getExtension(JvmProtoBuf.jvmClassFlags)) +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt new file mode 100644 index 0000000000..9d8f3ad993 --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt @@ -0,0 +1,72 @@ +/* + * Copyright 2010-2016 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.metadata.jvm.deserialization + +import java.util.* + +// The maximum possible length of the byte array in the CONSTANT_Utf8_info structure in the bytecode, as per JVMS7 4.4.7 +const val MAX_UTF8_INFO_LENGTH = 65535 + +const val UTF8_MODE_MARKER = 0.toChar() + +fun bytesToStrings(bytes: ByteArray): Array { + val result = ArrayList(1) + val buffer = StringBuilder() + var bytesInBuffer = 0 + + buffer.append(UTF8_MODE_MARKER) + // Zeros effectively occupy two bytes because each 0x0 is converted to 0x80 0xc0 in Modified UTF-8, see JVMS7 4.4.7 + bytesInBuffer += 2 + + for (b in bytes) { + val c = b.toInt() and 0xFF // 0 <= c <= 255 + buffer.append(c.toChar()) + if (b in 1..127) { + bytesInBuffer++ + } else { + bytesInBuffer += 2 + } + + if (bytesInBuffer >= MAX_UTF8_INFO_LENGTH - 1) { + result.add(buffer.toString()) + buffer.setLength(0) + bytesInBuffer = 0 + } + } + + if (!buffer.isEmpty()) { + result.add(buffer.toString()) + } + + return result.toTypedArray() +} + +fun stringsToBytes(strings: Array): ByteArray { + val resultLength = strings.sumBy { it.length } + val result = ByteArray(resultLength) + + var i = 0 + for (s in strings) { + for (si in 0..s.length - 1) { + result[i++] = s[si].toInt().toByte() + } + } + + assert(i == result.size) { "Should have reached the end" } + + return result +} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/serialization/JvmStringTable.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/serialization/JvmStringTable.kt new file mode 100644 index 0000000000..d9676c752b --- /dev/null +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/serialization/JvmStringTable.kt @@ -0,0 +1,101 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.metadata.jvm.serialization + +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolver +import org.jetbrains.kotlin.metadata.serialization.StringTable +import java.io.OutputStream + +// TODO: optimize by reordering records to minimize storage of 'range' fields +open class JvmStringTable(nameResolver: JvmNameResolver? = null) : StringTable { + val strings = ArrayList() + private val records = ArrayList() + private val map = HashMap() + private val localNames = LinkedHashSet() + + init { + if (nameResolver != null) { + strings.addAll(nameResolver.strings) + nameResolver.types.recordList.mapTo(records, JvmProtoBuf.StringTableTypes.Record::toBuilder) + for (index in strings.indices) { + map[nameResolver.getString(index)] = index + } + localNames.addAll(nameResolver.types.localNameList) + } + } + + override fun getStringIndex(string: String): Int = + map.getOrPut(string) { + strings.size.apply { + strings.add(string) + + val lastRecord = records.lastOrNull() + if (lastRecord != null && lastRecord.isTrivial()) { + lastRecord.range = lastRecord.range + 1 + } else records.add(Record.newBuilder()) + } + } + + private fun Record.Builder.isTrivial(): Boolean { + return !hasPredefinedIndex() && !hasOperation() && substringIndexCount == 0 && replaceCharCount == 0 + } + + // We use the following format to encode ClassId: "pkg/Outer.Inner". + // It represents a unique name, but such names don't usually appear in the constant pool, so we're writing "Lpkg/Outer$Inner;" + // instead and an instruction to drop the first and the last character in this string and replace all '$' with '.'. + // This works most of the time, except in two rare cases: + // - the name of the class or any of its outer classes contains dollars. In this case we're just storing the described + // string literally: "pkg/Outer.Inner$with$dollars" + // - the class is local or nested in local. In this case we're also storing the literal string, and also storing the fact that + // this name represents a local class in a separate list + override fun getQualifiedClassNameIndex(className: String, isLocal: Boolean): Int { + map[className]?.let { recordedIndex -> + // If we already recorded such string, we only return its index if it's local and our name is local + // OR it's not local and our name is not local as well + if (isLocal == (recordedIndex in localNames)) { + return recordedIndex + } + } + + val index = strings.size + if (isLocal) { + localNames.add(index) + } + + val record = Record.newBuilder() + + // If the class is local or any of its outer class names contains '$', store a literal string + if (isLocal || '$' in className) { + strings.add(className) + } else { + val predefinedIndex = JvmNameResolver.getPredefinedStringIndex(className) + if (predefinedIndex != null) { + record.predefinedIndex = predefinedIndex + // 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.operation = Record.Operation.DESC_TO_CLASS_ID + strings.add("L${className.replace('.', '$')};") + } + } + + records.add(record) + + map[className] = index + + return index + } + + fun serializeTo(output: OutputStream) { + with(JvmProtoBuf.StringTableTypes.newBuilder()) { + addAllRecord(records.map { it.build() }) + addAllLocalName(localNames) + build().writeDelimitedTo(output) + } + } +} diff --git a/retrofit/src/main/java/retrofit2/HttpServiceMethod.java b/retrofit/src/main/java/retrofit2/HttpServiceMethod.java index 54ddc24724..b64bb315e9 100644 --- a/retrofit/src/main/java/retrofit2/HttpServiceMethod.java +++ b/retrofit/src/main/java/retrofit2/HttpServiceMethod.java @@ -15,6 +15,7 @@ */ package retrofit2; +import static retrofit2.KotlinExtensions.isReturnTypeNullable; import static retrofit2.Utils.getRawType; import static retrofit2.Utils.methodError; @@ -51,10 +52,7 @@ static HttpServiceMethod parseAnnotatio responseType = Utils.getParameterUpperBound(0, (ParameterizedType) responseType); continuationWantsResponse = true; } else { - // TODO figure out if type is nullable or not - // Metadata metadata = method.getDeclaringClass().getAnnotation(Metadata.class) - // Find the entry for method - // Determine if return type is nullable or not + continuationBodyNullable = isReturnTypeNullable(method); } adapterType = new Utils.ParameterizedTypeImpl(null, Call.class, responseType); diff --git a/retrofit/src/main/java/retrofit2/KotlinExtensions.kt b/retrofit/src/main/java/retrofit2/KotlinExtensions.kt index 6202abef76..f419786047 100644 --- a/retrofit/src/main/java/retrofit2/KotlinExtensions.kt +++ b/retrofit/src/main/java/retrofit2/KotlinExtensions.kt @@ -20,6 +20,12 @@ package retrofit2 import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.suspendCancellableCoroutine +import kotlinx.metadata.Flag +import kotlinx.metadata.KmClassifier +import kotlinx.metadata.jvm.KotlinClassHeader +import kotlinx.metadata.jvm.KotlinClassMetadata +import kotlinx.metadata.jvm.signature +import java.lang.reflect.Method import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED import kotlin.coroutines.intrinsics.intercepted import kotlin.coroutines.intrinsics.suspendCoroutineUninterceptedOrReturn @@ -117,3 +123,61 @@ internal suspend fun Exception.suspendAndThrow(): Nothing { COROUTINE_SUSPENDED } } + +internal fun isReturnTypeNullable(method: Method): Boolean { + val declaringClass = method.declaringClass + val metadataAnnotation = declaringClass.getAnnotation(Metadata::class.java) + + val header = KotlinClassHeader( + kind = metadataAnnotation.kind, + metadataVersion = metadataAnnotation.metadataVersion, + data1 = metadataAnnotation.data1, + data2 = metadataAnnotation.data2, + extraString = metadataAnnotation.extraString, + extraInt = metadataAnnotation.extraInt, + packageName = metadataAnnotation.packageName + ) + + val classMetadata = KotlinClassMetadata.read(header) + val kmClass = (classMetadata as KotlinClassMetadata.Class).toKmClass() + + val javaMethodSignature = method.createSignature() + val candidates = kmClass.functions.filter { it.signature?.asString() == javaMethodSignature } + + require(candidates.isNotEmpty()) { "No match found in metadata for '${method}'" } + require(candidates.size == 1) { "Multiple function matches found in metadata for '${method}'" } + val match = candidates.first() + + return Flag.Type.IS_NULLABLE(match.returnType.flags) || match.returnType.classifier == KmClassifier.Class("kotlin/Unit") +} + +private fun Method.createSignature() = buildString { + append(name) + append('(') + + parameterTypes.forEach { + append(it.typeToSignature()) + } + + append(')') + + append(returnType.typeToSignature()) +} + +private fun Class<*>.typeToSignature() = when { + isPrimitive -> javaTypesMap[name] + isArray -> name.replace('.', '/') + else -> "L${name.replace('.', '/')};" +} + +private val javaTypesMap = mapOf( + "int" to "I", + "long" to "J", + "boolean" to "Z", + "byte" to "B", + "char" to "C", + "float" to "F", + "double" to "D", + "short" to "S", + "void" to "V" +) diff --git a/retrofit/src/main/resources/META-INF/services/kotlinx.metadata.impl.extensions.MetadataExtensions b/retrofit/src/main/resources/META-INF/services/kotlinx.metadata.impl.extensions.MetadataExtensions new file mode 100644 index 0000000000..7ac2235c4e --- /dev/null +++ b/retrofit/src/main/resources/META-INF/services/kotlinx.metadata.impl.extensions.MetadataExtensions @@ -0,0 +1 @@ +kotlinx.metadata.jvm.impl.JvmMetadataExtensions diff --git a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt index 8c797cbb83..d3fe430ae5 100644 --- a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt +++ b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt @@ -16,7 +16,6 @@ package retrofit2 import kotlinx.coroutines.CoroutineDispatcher -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking @@ -35,6 +34,7 @@ import org.junit.Test import retrofit2.helpers.ToStringConverterFactory import retrofit2.http.GET import retrofit2.http.Path +import retrofit2.http.Query import java.io.IOException import java.lang.reflect.ParameterizedType import java.lang.reflect.Type @@ -46,6 +46,16 @@ class KotlinSuspendTest { interface Service { @GET("/") suspend fun body(): String @GET("/") suspend fun bodyNullable(): String? + @GET("/") suspend fun noBody() + @GET("/") suspend fun noBody(@Query("x") arg: String) + @GET("/") suspend fun noBody(@Query("x") arg: Int) + @GET("/") suspend fun noBody(@Query("x") arg: Array) + @GET("/") suspend fun noBody(@Query("x") arg: Array) + @GET("/") suspend fun noBody(@Query("x") arg: IntArray) + + @UseExperimental(ExperimentalUnsignedTypes::class) + @GET("/") suspend fun noBody(@Query("x") arg: UInt) + @GET("/") suspend fun response(): Response @GET("/{a}/{b}/{c}") @@ -122,7 +132,6 @@ class KotlinSuspendTest { } } - @Ignore("Not working yet") @Test fun bodyNullable() { val retrofit = Retrofit.Builder() .baseUrl(server.url("/")) @@ -136,6 +145,45 @@ class KotlinSuspendTest { assertThat(body).isNull() } + @Test fun noBody() { + val retrofit = Retrofit.Builder() + .baseUrl(server.url("/")) + .addConverterFactory(ToStringConverterFactory()) + .build() + val example = retrofit.create(Service::class.java) + + server.enqueue(MockResponse().setResponseCode(204)) + + val body = runBlocking { example.noBody(intArrayOf(1)) } + assertThat(body).isEqualTo(Unit) + } + + @Test fun signatureMatch() { + val retrofit = Retrofit.Builder() + .baseUrl(server.url("/")) + .addConverterFactory(ToStringConverterFactory()) + .build() + val example = retrofit.create(Service::class.java) + + server.enqueue(MockResponse()) + server.enqueue(MockResponse()) + server.enqueue(MockResponse()) + server.enqueue(MockResponse()) + server.enqueue(MockResponse()) + server.enqueue(MockResponse()) + server.enqueue(MockResponse()) + + runBlocking { + example.noBody() + example.noBody("") + example.noBody(1) + example.noBody(arrayOf(1)) + example.noBody(intArrayOf(1)) + example.noBody(arrayOf("")) + example.noBody(1u) + } + } + @Test fun response() { val retrofit = Retrofit.Builder() .baseUrl(server.url("/")) diff --git a/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java b/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java new file mode 100644 index 0000000000..3b01544eca --- /dev/null +++ b/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2015 Square, Inc. + * + * 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 retrofit2.helpers; + +import okhttp3.ResponseBody; +import retrofit2.Converter; +import retrofit2.Retrofit; + +import javax.annotation.Nullable; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + +public class ToNullStringResponseConverterFactory extends Converter.Factory { + + @Override + public @Nullable Converter responseBodyConverter( + Type type, Annotation[] annotations, Retrofit retrofit) { + if (String.class.equals(type)) { + return value -> null; + } + return null; + } +} From 2c163c7619f57f560b9a06e58e96c129c5899775 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Mon, 19 Apr 2021 15:17:18 +0200 Subject: [PATCH 02/15] Remove unused stuff --- .../com/google/protobuf/AbstractParser.java | 10 - .../main/java/com/google/protobuf/Parser.java | 64 - .../java/kotlinx/metadata.impl/readUtils.kt | 44 - .../java/kotlinx/metadata.impl/readers.kt | 465 +- .../main/java/kotlinx/metadata/ClassName.kt | 3 - .../src/main/java/kotlinx/metadata/Flag.kt | 456 - .../main/java/kotlinx/metadata/annotations.kt | 67 - .../impl/extensions/MetadataExtensions.kt | 30 +- .../impl/extensions/extensionNodes.kt | 6 +- .../metadata/jvm/JvmMemberSignature.kt | 13 - .../kotlinx/metadata/jvm/KotlinClassHeader.kt | 41 - .../jvm/impl/JvmMetadataExtensions.kt | 92 - .../metadata/jvm/impl/jvmExtensionNodes.kt | 31 - .../metadata/jvm/jvmExtensionVisitors.kt | 359 - .../src/main/java/kotlinx/metadata/nodes.kt | 885 +- .../main/java/kotlinx/metadata/visitors.kt | 838 +- .../kotlin/metadata.serialization/Interner.kt | 29 - .../metadata.serialization/MutableTable.kt | 62 - .../metadata.serialization/StringTable.kt | 15 - .../jetbrains/kotlin/metadata/ProtoBuf.java | 16019 +++++++--------- .../metadata/deserialization/BinaryVersion.kt | 32 - .../metadata/deserialization/Flags.java | 277 - .../metadata/deserialization/ProtoBufUtil.kt | 4 - .../deserialization/VersionRequirement.kt | 97 - .../deserialization/protoTypeTableUtil.kt | 78 - .../kotlin/metadata/jvm/JvmProtoBuf.java | 1816 +- .../jvm/deserialization/BitEncoding.java | 146 - .../metadata/jvm/deserialization/JvmFlags.kt | 27 - .../jvm/deserialization/JvmMetadataVersion.kt | 3 - .../jvm/deserialization/JvmNameResolver.kt | 4 - .../jvm/deserialization/JvmProtoBufUtil.kt | 81 - .../jvm/deserialization/utfEncoding.kt | 32 - .../jvm/serialization/JvmStringTable.kt | 101 - ...etadata.impl.extensions.MetadataExtensions | 1 - .../test/java/retrofit2/KotlinSuspendTest.kt | 17 +- 35 files changed, 6891 insertions(+), 15354 deletions(-) delete mode 100644 retrofit/src/main/java/kotlinx/metadata/annotations.kt delete mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/Interner.kt delete mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/MutableTable.kt delete mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/StringTable.kt delete mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmFlags.kt delete mode 100644 retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/serialization/JvmStringTable.kt delete mode 100644 retrofit/src/main/resources/META-INF/services/kotlinx.metadata.impl.extensions.MetadataExtensions diff --git a/retrofit/src/main/java/com/google/protobuf/AbstractParser.java b/retrofit/src/main/java/com/google/protobuf/AbstractParser.java index 1a4c63110a..2ff95c740a 100644 --- a/retrofit/src/main/java/com/google/protobuf/AbstractParser.java +++ b/retrofit/src/main/java/com/google/protobuf/AbstractParser.java @@ -198,11 +198,6 @@ public MessageType parsePartialFrom(InputStream input, return message; } - public MessageType parsePartialFrom(InputStream input) - throws InvalidProtocolBufferException { - return parsePartialFrom(input, EMPTY_REGISTRY); - } - public MessageType parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { @@ -233,11 +228,6 @@ public MessageType parsePartialDelimitedFrom( return parsePartialFrom(limitedInput, extensionRegistry); } - public MessageType parsePartialDelimitedFrom(InputStream input) - throws InvalidProtocolBufferException { - return parsePartialDelimitedFrom(input, EMPTY_REGISTRY); - } - public MessageType parseDelimitedFrom( InputStream input, ExtensionRegistryLite extensionRegistry) diff --git a/retrofit/src/main/java/com/google/protobuf/Parser.java b/retrofit/src/main/java/com/google/protobuf/Parser.java index f636014b5a..d852a5bb5f 100644 --- a/retrofit/src/main/java/com/google/protobuf/Parser.java +++ b/retrofit/src/main/java/com/google/protobuf/Parser.java @@ -61,14 +61,6 @@ public MessageType parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; - /** - * Like {@link #parseFrom(CodedInputStream)}, but does not throw an - * exception if the message is missing required fields. Instead, a partial - * message is returned. - */ - public MessageType parsePartialFrom(CodedInputStream input) - throws InvalidProtocolBufferException; - /** * Like {@link #parseFrom(CodedInputStream input, ExtensionRegistryLite)}, * but does not throw an exception if the message is missing required fields. @@ -97,14 +89,6 @@ public MessageType parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; - /** - * Like {@link #parseFrom(ByteString)}, but does not throw an - * exception if the message is missing required fields. Instead, a partial - * message is returned. - */ - public MessageType parsePartialFrom(ByteString data) - throws InvalidProtocolBufferException; - /** * Like {@link #parseFrom(ByteString, ExtensionRegistryLite)}, * but does not throw an exception if the message is missing required fields. @@ -114,13 +98,6 @@ public MessageType parsePartialFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; - /** - * Parses {@code data} as a message of {@code MessageType}. - * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. - */ - public MessageType parseFrom(byte[] data, int off, int len) - throws InvalidProtocolBufferException; - /** * Parses {@code data} as a message of {@code MessageType}. * This is just a small wrapper around @@ -146,14 +123,6 @@ public MessageType parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; - /** - * Like {@link #parseFrom(byte[], int, int)}, but does not throw an - * exception if the message is missing required fields. Instead, a partial - * message is returned. - */ - public MessageType parsePartialFrom(byte[] data, int off, int len) - throws InvalidProtocolBufferException; - /** * Like {@link #parseFrom(ByteString, ExtensionRegistryLite)}, * but does not throw an exception if the message is missing required fields. @@ -163,23 +132,6 @@ public MessageType parsePartialFrom(byte[] data, int off, int len, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; - /** - * Like {@link #parseFrom(byte[])}, but does not throw an - * exception if the message is missing required fields. Instead, a partial - * message is returned. - */ - public MessageType parsePartialFrom(byte[] data) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseFrom(byte[], ExtensionRegistryLite)}, - * but does not throw an exception if the message is missing required fields. - * Instead, a partial message is returned. - */ - public MessageType parsePartialFrom(byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - /** * Parse a message of {@code MessageType} from {@code input}. * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. @@ -203,14 +155,6 @@ public MessageType parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; - /** - * Like {@link #parseFrom(InputStream)}, but does not throw an - * exception if the message is missing required fields. Instead, a partial - * message is returned. - */ - public MessageType parsePartialFrom(InputStream input) - throws InvalidProtocolBufferException; - /** * Like {@link #parseFrom(InputStream, ExtensionRegistryLite)}, * but does not throw an exception if the message is missing required fields. @@ -241,14 +185,6 @@ public MessageType parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException; - /** - * Like {@link #parseDelimitedFrom(InputStream)}, but does not throw an - * exception if the message is missing required fields. Instead, a partial - * message is returned. - */ - public MessageType parsePartialDelimitedFrom(InputStream input) - throws InvalidProtocolBufferException; - /** * Like {@link #parseDelimitedFrom(InputStream, ExtensionRegistryLite)}, * but does not throw an exception if the message is missing required fields. diff --git a/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt b/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt index 8ce98f4e42..847b3b0c93 100644 --- a/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt +++ b/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt @@ -6,52 +6,8 @@ package kotlinx.metadata.impl import kotlinx.metadata.ClassName -import kotlinx.metadata.KmAnnotation -import kotlinx.metadata.KmAnnotationArgument -import org.jetbrains.kotlin.metadata.ProtoBuf -import org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.* -import org.jetbrains.kotlin.metadata.deserialization.Flags import org.jetbrains.kotlin.metadata.deserialization.NameResolver -fun ProtoBuf.Annotation.readAnnotation(strings: NameResolver): KmAnnotation = - KmAnnotation( - strings.getClassName(id), - argumentList.mapNotNull { argument -> - argument.value.readAnnotationArgument(strings)?.let { value -> - strings.getString(argument.nameId) to value - } - }.toMap() - ) - -fun ProtoBuf.Annotation.Argument.Value.readAnnotationArgument(strings: NameResolver): KmAnnotationArgument? { - if (Flags.IS_UNSIGNED[flags]) { - return when (type) { - BYTE -> KmAnnotationArgument.LiteralValue.UByteValue(intValue.toByte().toUByte()) - SHORT -> KmAnnotationArgument.LiteralValue.UShortValue(intValue.toShort().toUShort()) - INT -> KmAnnotationArgument.LiteralValue.UIntValue(intValue.toInt().toUInt()) - LONG -> KmAnnotationArgument.LiteralValue.ULongValue(intValue.toULong()) - else -> error("Cannot read value of unsigned type: $type") - } - } - - return when (type) { - BYTE -> KmAnnotationArgument.LiteralValue.ByteValue(intValue.toByte()) - CHAR -> KmAnnotationArgument.LiteralValue.CharValue(intValue.toInt().toChar()) - SHORT -> KmAnnotationArgument.LiteralValue.ShortValue(intValue.toShort()) - INT -> KmAnnotationArgument.LiteralValue.IntValue(intValue.toInt()) - LONG -> KmAnnotationArgument.LiteralValue.LongValue(intValue) - FLOAT -> KmAnnotationArgument.LiteralValue.FloatValue(floatValue) - DOUBLE -> KmAnnotationArgument.LiteralValue.DoubleValue(doubleValue) - BOOLEAN -> KmAnnotationArgument.LiteralValue.BooleanValue(intValue != 0L) - STRING -> KmAnnotationArgument.LiteralValue.StringValue(strings.getString(stringValue)) - CLASS -> KmAnnotationArgument.LiteralValue.KClassValue(strings.getClassName(classId), arrayDimensionCount) - ENUM -> KmAnnotationArgument.LiteralValue.EnumValue(strings.getClassName(classId), strings.getString(enumValueId)) - ANNOTATION -> KmAnnotationArgument.LiteralValue.AnnotationValue(annotation.readAnnotation(strings)) - ARRAY -> KmAnnotationArgument.LiteralValue.ArrayValue(arrayElementList.mapNotNull { it.readAnnotationArgument(strings) }) - null -> null - } -} - internal fun NameResolver.getClassName(index: Int): ClassName { val name = getQualifiedClassName(index) return if (isLocalClassName(index)) ".$name" else name diff --git a/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt b/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt index d1276f7ea2..ed8987426a 100644 --- a/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt +++ b/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt @@ -12,21 +12,10 @@ import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.metadata.deserialization.* import org.jetbrains.kotlin.metadata.deserialization.Flags as F -/** - * Allows to populate [ReadContext] with additional data - * that can be used when reading metadata in [MetadataExtensions]. - */ -interface ReadContextExtension - class ReadContext( val strings: NameResolver, - val types: TypeTable, - internal val versionRequirements: VersionRequirementTable, - private val parent: ReadContext? = null, - val contextExtensions: List = emptyList() + val types: TypeTable ) { - private val typeParameterNameToId = mutableMapOf() - internal val extensions = MetadataExtensions.INSTANCES operator fun get(index: Int): String = @@ -34,477 +23,41 @@ class ReadContext( fun className(index: Int): ClassName = strings.getClassName(index) - - fun getTypeParameterId(name: Int): Int? = - typeParameterNameToId[name] ?: parent?.getTypeParameterId(name) - - fun withTypeParameters(typeParameters: List): ReadContext = - ReadContext(strings, types, versionRequirements, this, contextExtensions).apply { - for (typeParameter in typeParameters) { - typeParameterNameToId[typeParameter.name] = typeParameter.id - } - } } fun ProtoBuf.Class.accept( v: KmClassVisitor, - strings: NameResolver, - contextExtensions: List = emptyList() -) { - val c = ReadContext( - strings, - TypeTable(typeTable), - VersionRequirementTable.create(versionRequirementTable), - contextExtensions = contextExtensions - ).withTypeParameters(typeParameterList) - - v.visit(flags, c.className(fqName)) - - for (typeParameter in typeParameterList) { - typeParameter.accept(v::visitTypeParameter, c) - } - - for (supertype in supertypes(c.types)) { - v.visitSupertype(supertype.typeFlags)?.let { supertype.accept(it, c) } - } - - for (constructor in constructorList) { - v.visitConstructor(constructor.flags)?.let { constructor.accept(it, c) } - } - - v.visitDeclarations(functionList, propertyList, typeAliasList, c) - - if (hasCompanionObjectName()) { - v.visitCompanionObject(c[companionObjectName]) - } - - for (nestedClassName in nestedClassNameList) { - v.visitNestedClass(c[nestedClassName]) - } - - for (enumEntry in enumEntryList) { - if (!enumEntry.hasName()) { - throw InconsistentKotlinMetadataException("No name for EnumEntry") - } - v.visitEnumEntry(c[enumEntry.name]) - } - - for (sealedSubclassFqName in sealedSubclassFqNameList) { - v.visitSealedSubclass(c.className(sealedSubclassFqName)) - } - - if (hasInlineClassUnderlyingPropertyName()) { - v.visitInlineClassUnderlyingPropertyName(c[inlineClassUnderlyingPropertyName]) - } - loadInlineClassUnderlyingType(c)?.let { underlyingType -> - v.visitInlineClassUnderlyingType(underlyingType.flags)?.let { underlyingType.accept(it, c) } - } - - for (versionRequirement in versionRequirementList) { - v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } - } - - for (extension in c.extensions) { - extension.readClassExtensions(v, this, c) - } - - v.visitEnd() -} - -private fun ProtoBuf.Class.loadInlineClassUnderlyingType(c: ReadContext): ProtoBuf.Type? { - val type = inlineClassUnderlyingType(c.types) - if (type != null) return type - - if (!hasInlineClassUnderlyingPropertyName()) return null - - // Kotlin compiler doesn't write underlying type to metadata in case it can be loaded from the underlying property. - return propertyList - .singleOrNull { it.receiverType(c.types) == null && c[it.name] == c[inlineClassUnderlyingPropertyName] } - ?.returnType(c.types) -} - -fun ProtoBuf.Package.accept( - v: KmPackageVisitor, - strings: NameResolver, - contextExtensions: List = emptyList() + strings: NameResolver ) { val c = ReadContext( strings, - TypeTable(typeTable), - VersionRequirementTable.create(versionRequirementTable), - contextExtensions = contextExtensions + TypeTable(typeTable) ) - v.visitDeclarations(functionList, propertyList, typeAliasList, c) - - for (extension in c.extensions) { - extension.readPackageExtensions(v, this, c) + for (function in functionList) { + v.visitFunction(function.flags, c[function.name])?.let { function.accept(it, c) } } - - v.visitEnd() -} - -fun ProtoBuf.PackageFragment.accept( - v: KmModuleFragmentVisitor, - strings: NameResolver, - contextExtensions: List = emptyList() -) { - val c = ReadContext( - strings, - TypeTable(ProtoBuf.TypeTable.newBuilder().build()), - VersionRequirementTable.EMPTY, - contextExtensions = contextExtensions - ) - - v.visitPackage()?.let { `package`.accept(it, strings, contextExtensions) } - - class_List.forEach { clazz -> - v.visitClass()?.let { clazz.accept(it, strings, contextExtensions) } - } - - for (extension in c.extensions) { - extension.readModuleFragmentExtensions(v, this, c) - } - - v.visitEnd() -} - -private fun KmDeclarationContainerVisitor.visitDeclarations( - functions: List, - properties: List, - typeAliases: List, - c: ReadContext -) { - for (function in functions) { - visitFunction(function.flags, c[function.name])?.let { function.accept(it, c) } - } - - for (property in properties) { - visitProperty( - property.flags, c[property.name], property.getPropertyGetterFlags(), property.getPropertySetterFlags() - )?.let { property.accept(it, c) } - } - - for (typeAlias in typeAliases) { - visitTypeAlias(typeAlias.flags, c[typeAlias.name])?.let { typeAlias.accept(it, c) } - } -} - -fun ProtoBuf.Function.accept(v: KmLambdaVisitor, strings: NameResolver) { - val c = ReadContext(strings, TypeTable(typeTable), VersionRequirementTable.EMPTY) - - v.visitFunction(flags, c[name])?.let { accept(it, c) } - - v.visitEnd() -} - -private fun ProtoBuf.Constructor.accept(v: KmConstructorVisitor, c: ReadContext) { - for (parameter in valueParameterList) { - v.visitValueParameter(parameter.flags, c[parameter.name])?.let { parameter.accept(it, c) } - } - - for (versionRequirement in versionRequirementList) { - v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } - } - - for (extension in c.extensions) { - extension.readConstructorExtensions(v, this, c) - } - - v.visitEnd() } private fun ProtoBuf.Function.accept(v: KmFunctionVisitor, outer: ReadContext) { - val c = outer.withTypeParameters(typeParameterList) - - for (typeParameter in typeParameterList) { - typeParameter.accept(v::visitTypeParameter, c) - } - - receiverType(c.types)?.let { receiverType -> - v.visitReceiverParameterType(receiverType.typeFlags)?.let { receiverType.accept(it, c) } - } - - for (parameter in valueParameterList) { - v.visitValueParameter(parameter.flags, c[parameter.name])?.let { parameter.accept(it, c) } - } - - returnType(c.types).let { returnType -> - v.visitReturnType(returnType.typeFlags)?.let { returnType.accept(it, c) } - } - - if (hasContract()) { - v.visitContract()?.let { contract.accept(it, c) } - } - - for (versionRequirement in versionRequirementList) { - v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } - } - - for (extension in c.extensions) { - extension.readFunctionExtensions(v, this, c) - } - - v.visitEnd() -} - -fun ProtoBuf.Property.accept(v: KmPropertyVisitor, outer: ReadContext) { - val c = outer.withTypeParameters(typeParameterList) - - for (typeParameter in typeParameterList) { - typeParameter.accept(v::visitTypeParameter, c) - } - - receiverType(c.types)?.let { receiverType -> - v.visitReceiverParameterType(receiverType.typeFlags)?.let { receiverType.accept(it, c) } - } - - if (hasSetterValueParameter()) { - val parameter = setterValueParameter - v.visitSetterParameter(parameter.flags, c[parameter.name])?.let { parameter.accept(it, c) } - } - - returnType(c.types).let { returnType -> - v.visitReturnType(returnType.typeFlags)?.let { returnType.accept(it, c) } - } - - for (versionRequirement in versionRequirementList) { - v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } - } - - for (extension in c.extensions) { - extension.readPropertyExtensions(v, this, c) - } - - v.visitEnd() -} - -private fun ProtoBuf.TypeAlias.accept(v: KmTypeAliasVisitor, outer: ReadContext) { - val c = outer.withTypeParameters(typeParameterList) - - for (typeParameter in typeParameterList) { - typeParameter.accept(v::visitTypeParameter, c) - } - - underlyingType(c.types).let { underlyingType -> - v.visitUnderlyingType(underlyingType.typeFlags)?.let { underlyingType.accept(it, c) } - } - - expandedType(c.types).let { expandedType -> - v.visitExpandedType(expandedType.typeFlags)?.let { expandedType.accept(it, c) } - } - - for (annotation in annotationList) { - v.visitAnnotation(annotation.readAnnotation(c.strings)) - } - - for (versionRequirement in versionRequirementList) { - v.visitVersionRequirement()?.let { acceptVersionRequirementVisitor(versionRequirement, it, c) } - } - - for (extension in c.extensions) { - extension.readTypeAliasExtensions(v, this, c) - } - - v.visitEnd() -} - -private fun ProtoBuf.ValueParameter.accept(v: KmValueParameterVisitor, c: ReadContext) { - type(c.types).let { type -> - v.visitType(type.typeFlags)?.let { type.accept(it, c) } - } - - varargElementType(c.types)?.let { varargElementType -> - v.visitVarargElementType(varargElementType.typeFlags)?.let { varargElementType.accept(it, c) } - } - - for (extension in c.extensions) { - extension.readValueParameterExtensions(v, this, c) - } - - v.visitEnd() -} - -private inline fun ProtoBuf.TypeParameter.accept( - visit: (flags: Flags, name: String, id: Int, variance: KmVariance) -> KmTypeParameterVisitor?, - c: ReadContext -) { - val variance = when (variance!!) { - ProtoBuf.TypeParameter.Variance.IN -> KmVariance.IN - ProtoBuf.TypeParameter.Variance.OUT -> KmVariance.OUT - ProtoBuf.TypeParameter.Variance.INV -> KmVariance.INVARIANT - } - - visit(typeParameterFlags, c[name], id, variance)?.let { accept(it, c) } -} - -private fun ProtoBuf.TypeParameter.accept(v: KmTypeParameterVisitor, c: ReadContext) { - for (upperBound in upperBounds(c.types)) { - v.visitUpperBound(upperBound.typeFlags)?.let { upperBound.accept(it, c) } + returnType(outer.types).let { returnType -> + v.visitReturnType(returnType.typeFlags)?.let { returnType.accept(it, outer) } } - for (extension in c.extensions) { - extension.readTypeParameterExtensions(v, this, c) + for (extension in outer.extensions) { + extension.readFunctionExtensions(v, this, outer) } - - v.visitEnd() } private fun ProtoBuf.Type.accept(v: KmTypeVisitor, c: ReadContext) { when { hasClassName() -> v.visitClass(c.className(className)) - hasTypeAliasName() -> v.visitTypeAlias(c.className(typeAliasName)) - hasTypeParameter() -> v.visitTypeParameter(typeParameter) - hasTypeParameterName() -> { - val id = c.getTypeParameterId(typeParameterName) - ?: throw InconsistentKotlinMetadataException("No type parameter id for ${c[typeParameterName]}") - v.visitTypeParameter(id) - } else -> { throw InconsistentKotlinMetadataException("No classifier (class, type alias or type parameter) recorded for Type") } } - - for (argument in argumentList) { - val variance = when (argument.projection!!) { - ProtoBuf.Type.Argument.Projection.IN -> KmVariance.IN - ProtoBuf.Type.Argument.Projection.OUT -> KmVariance.OUT - ProtoBuf.Type.Argument.Projection.INV -> KmVariance.INVARIANT - ProtoBuf.Type.Argument.Projection.STAR -> null - } - - if (variance != null) { - val argumentType = argument.type(c.types) - ?: throw InconsistentKotlinMetadataException("No type argument for non-STAR projection in Type") - v.visitArgument(argumentType.typeFlags, variance)?.let { argumentType.accept(it, c) } - } else { - v.visitStarProjection() - } - } - - abbreviatedType(c.types)?.let { abbreviatedType -> - v.visitAbbreviatedType(abbreviatedType.typeFlags)?.let { abbreviatedType.accept(it, c) } - } - - outerType(c.types)?.let { outerType -> - v.visitOuterType(outerType.typeFlags)?.let { outerType.accept(it, c) } - } - - flexibleUpperBound(c.types)?.let { upperBound -> - v.visitFlexibleTypeUpperBound( - upperBound.typeFlags, - if (hasFlexibleTypeCapabilitiesId()) c[flexibleTypeCapabilitiesId] else null - )?.let { upperBound.accept(it, c) } - } - - for (extension in c.extensions) { - extension.readTypeExtensions(v, this, c) - } - - v.visitEnd() -} - -private fun acceptVersionRequirementVisitor(id: Int, v: KmVersionRequirementVisitor, c: ReadContext) { - val message = VersionRequirement.create(id, c.strings, c.versionRequirements) - ?: throw InconsistentKotlinMetadataException("No VersionRequirement with the given id in the table") - - val kind = when (message.kind) { - ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION -> KmVersionRequirementVersionKind.LANGUAGE_VERSION - ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION -> KmVersionRequirementVersionKind.COMPILER_VERSION - ProtoBuf.VersionRequirement.VersionKind.API_VERSION -> KmVersionRequirementVersionKind.API_VERSION - } - - val level = when (message.level) { - DeprecationLevel.WARNING -> KmVersionRequirementLevel.WARNING - DeprecationLevel.ERROR -> KmVersionRequirementLevel.ERROR - DeprecationLevel.HIDDEN -> KmVersionRequirementLevel.HIDDEN - } - - v.visit(kind, level, message.errorCode, message.message) - - val (major, minor, patch) = message.version - v.visitVersion(major, minor, patch) - - v.visitEnd() -} - -private fun ProtoBuf.Contract.accept(v: KmContractVisitor, c: ReadContext) { - for (effect in effectList) { - if (!effect.hasEffectType()) continue - - val effectType = when (effect.effectType!!) { - ProtoBuf.Effect.EffectType.RETURNS_CONSTANT -> KmEffectType.RETURNS_CONSTANT - ProtoBuf.Effect.EffectType.CALLS -> KmEffectType.CALLS - ProtoBuf.Effect.EffectType.RETURNS_NOT_NULL -> KmEffectType.RETURNS_NOT_NULL - } - - val effectKind = if (!effect.hasKind()) null else when (effect.kind!!) { - ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE -> KmEffectInvocationKind.AT_MOST_ONCE - ProtoBuf.Effect.InvocationKind.EXACTLY_ONCE -> KmEffectInvocationKind.EXACTLY_ONCE - ProtoBuf.Effect.InvocationKind.AT_LEAST_ONCE -> KmEffectInvocationKind.AT_LEAST_ONCE - } - - v.visitEffect(effectType, effectKind)?.let { effect.accept(it, c) } - } - - v.visitEnd() -} - -private fun ProtoBuf.Effect.accept(v: KmEffectVisitor, c: ReadContext) { - for (constructorArgument in effectConstructorArgumentList) { - v.visitConstructorArgument()?.let { constructorArgument.accept(it, c) } - } - - if (hasConclusionOfConditionalEffect()) { - v.visitConclusionOfConditionalEffect()?.let { conclusionOfConditionalEffect.accept(it, c) } - } - - v.visitEnd() -} - -private fun ProtoBuf.Expression.accept(v: KmEffectExpressionVisitor, c: ReadContext) { - v.visit( - flags, - if (hasValueParameterReference()) valueParameterReference else null - ) - - if (hasConstantValue()) { - v.visitConstantValue( - when (constantValue!!) { - ProtoBuf.Expression.ConstantValue.TRUE -> true - ProtoBuf.Expression.ConstantValue.FALSE -> false - ProtoBuf.Expression.ConstantValue.NULL -> null - } - ) - } - - isInstanceType(c.types)?.let { type -> - v.visitIsInstanceType(type.typeFlags)?.let { type.accept(it, c) } - } - - for (andArgument in andArgumentList) { - v.visitAndArgument()?.let { andArgument.accept(it, c) } - } - - for (orArgument in orArgumentList) { - v.visitOrArgument()?.let { orArgument.accept(it, c) } - } - - v.visitEnd() } private val ProtoBuf.Type.typeFlags: Flags get() = (if (nullable) 1 shl 0 else 0) + (flags shl 1) - -private val ProtoBuf.TypeParameter.typeParameterFlags: Flags - get() = if (reified) 1 else 0 - -fun ProtoBuf.Property.getPropertyGetterFlags(): Flags = - if (hasGetterFlags()) getterFlags else getDefaultPropertyAccessorFlags(flags) - -fun ProtoBuf.Property.getPropertySetterFlags(): Flags = - if (hasSetterFlags()) setterFlags else getDefaultPropertyAccessorFlags(flags) - -private fun getDefaultPropertyAccessorFlags(flags: Flags): Flags = - F.getAccessorFlags(F.HAS_ANNOTATIONS.get(flags), F.VISIBILITY.get(flags), F.MODALITY.get(flags), false, false, false) diff --git a/retrofit/src/main/java/kotlinx/metadata/ClassName.kt b/retrofit/src/main/java/kotlinx/metadata/ClassName.kt index 51cadd7942..6cab65d134 100644 --- a/retrofit/src/main/java/kotlinx/metadata/ClassName.kt +++ b/retrofit/src/main/java/kotlinx/metadata/ClassName.kt @@ -18,6 +18,3 @@ package kotlinx.metadata */ // TODO: use inline class in 1.3 typealias ClassName = String - -val ClassName.isLocal: Boolean - get() = this.startsWith(".") diff --git a/retrofit/src/main/java/kotlinx/metadata/Flag.kt b/retrofit/src/main/java/kotlinx/metadata/Flag.kt index 42ebc9eea4..0c9e803094 100644 --- a/retrofit/src/main/java/kotlinx/metadata/Flag.kt +++ b/retrofit/src/main/java/kotlinx/metadata/Flag.kt @@ -51,399 +51,6 @@ class Flag(private val offset: Int, private val bitWidth: Int, private val value operator fun invoke(flags: Flags): Boolean = (flags ushr offset) and ((1 shl bitWidth) - 1) == value - companion object Common { - /** - * Signifies that the corresponding declaration has at least one annotation. - * - * This flag is useful for reading Kotlin metadata on JVM efficiently. On JVM, most of the annotations are written not to the Kotlin - * metadata, but directly on the corresponding declarations in the class file. This flag can be used as an optimization to avoid - * reading annotations from the class file (which can be slow) in case when a declaration has no annotations. - */ - @JvmField - val HAS_ANNOTATIONS = Flag(F.HAS_ANNOTATIONS) - - - /** - * A visibility flag, signifying that the corresponding declaration is `internal`. - */ - @JvmField - val IS_INTERNAL = Flag(F.VISIBILITY, Visibility.INTERNAL_VALUE) - - /** - * A visibility flag, signifying that the corresponding declaration is `private`. - */ - @JvmField - val IS_PRIVATE = Flag(F.VISIBILITY, Visibility.PRIVATE_VALUE) - - /** - * A visibility flag, signifying that the corresponding declaration is `protected`. - */ - @JvmField - val IS_PROTECTED = Flag(F.VISIBILITY, Visibility.PROTECTED_VALUE) - - /** - * A visibility flag, signifying that the corresponding declaration is `public`. - */ - @JvmField - val IS_PUBLIC = Flag(F.VISIBILITY, Visibility.PUBLIC_VALUE) - - /** - * A visibility flag, signifying that the corresponding declaration is "private-to-this", which is a non-denotable visibility of - * private members in Kotlin which are callable only on the same instance of the declaring class. - */ - @JvmField - val IS_PRIVATE_TO_THIS = Flag(F.VISIBILITY, Visibility.PRIVATE_TO_THIS_VALUE) - - /** - * A visibility flag, signifying that the corresponding declaration is local, i.e. declared inside a code block - * and not visible from the outside. - */ - @JvmField - val IS_LOCAL = Flag(F.VISIBILITY, Visibility.LOCAL_VALUE) - - - /** - * A modality flag, signifying that the corresponding declaration is `final`. - */ - @JvmField - val IS_FINAL = Flag(F.MODALITY, Modality.FINAL_VALUE) - - /** - * A modality flag, signifying that the corresponding declaration is `open`. - */ - @JvmField - val IS_OPEN = Flag(F.MODALITY, Modality.OPEN_VALUE) - - /** - * A modality flag, signifying that the corresponding declaration is `abstract`. - */ - @JvmField - val IS_ABSTRACT = Flag(F.MODALITY, Modality.ABSTRACT_VALUE) - - /** - * A modality flag, signifying that the corresponding declaration is `sealed`. - */ - @JvmField - val IS_SEALED = Flag(F.MODALITY, Modality.SEALED_VALUE) - } - - /** - * A container of flags applicable to Kotlin classes, including interfaces, objects, enum classes and annotation classes. - * - * In addition to the common flag groups, the following flag groups exist for class flags: - * * class kind flags: [IS_CLASS], [IS_INTERFACE], [IS_ENUM_CLASS], [IS_ENUM_ENTRY], [IS_ANNOTATION_CLASS], [IS_OBJECT], - * [IS_COMPANION_OBJECT] - */ - object Class { - /** - * A class kind flag, signifying that the corresponding class is a usual `class`. - */ - @JvmField - val IS_CLASS = Flag(F.CLASS_KIND, ClassKind.CLASS_VALUE) - - /** - * A class kind flag, signifying that the corresponding class is an `interface`. - */ - @JvmField - val IS_INTERFACE = Flag(F.CLASS_KIND, ClassKind.INTERFACE_VALUE) - - /** - * A class kind flag, signifying that the corresponding class is an `enum class`. - */ - @JvmField - val IS_ENUM_CLASS = Flag(F.CLASS_KIND, ClassKind.ENUM_CLASS_VALUE) - - /** - * A class kind flag, signifying that the corresponding class is an enum entry. - */ - @JvmField - val IS_ENUM_ENTRY = Flag(F.CLASS_KIND, ClassKind.ENUM_ENTRY_VALUE) - - /** - * A class kind flag, signifying that the corresponding class is an `annotation class`. - */ - @JvmField - val IS_ANNOTATION_CLASS = Flag(F.CLASS_KIND, ClassKind.ANNOTATION_CLASS_VALUE) - - /** - * A class kind flag, signifying that the corresponding class is a non-companion `object`. - */ - @JvmField - val IS_OBJECT = Flag(F.CLASS_KIND, ClassKind.OBJECT_VALUE) - - /** - * A class kind flag, signifying that the corresponding class is a `companion object`. - */ - @JvmField - val IS_COMPANION_OBJECT = Flag(F.CLASS_KIND, ClassKind.COMPANION_OBJECT_VALUE) - - - /** - * Signifies that the corresponding class is `inner`. - */ - @JvmField - val IS_INNER = Flag(F.IS_INNER) - - /** - * Signifies that the corresponding class is `data`. - */ - @JvmField - val IS_DATA = Flag(F.IS_DATA) - - /** - * Signifies that the corresponding class is `external`. - */ - @JvmField - val IS_EXTERNAL = Flag(F.IS_EXTERNAL_CLASS) - - /** - * Signifies that the corresponding class is `expect`. - */ - @JvmField - val IS_EXPECT = Flag(F.IS_EXPECT_CLASS) - - @JvmField - @Deprecated( - "Use IS_VALUE instead, which returns true if the class is either a pre-1.5 inline class, or a 1.5+ value class.", - level = DeprecationLevel.ERROR - ) - @Suppress("unused") - val IS_INLINE = Flag(F.IS_INLINE_CLASS) - - /** - * Signifies that the corresponding class is either a pre-Kotlin-1.5 `inline` class, or a 1.5+ `value` class. - */ - @JvmField - val IS_VALUE = Flag(F.IS_INLINE_CLASS) - - /** - * Signifies that the corresponding class is a functional interface, i.e. marked with the keyword `fun`. - */ - @JvmField - val IS_FUN = Flag(F.IS_FUN_INTERFACE) - } - - /** - * A container of flags applicable to Kotlin constructors. - */ - object Constructor { - @JvmField - @Deprecated("Use IS_SECONDARY which holds inverted value instead.", level = DeprecationLevel.ERROR) - @Suppress("unused") - val IS_PRIMARY = Flag(F.IS_SECONDARY, 0) - - /** - * Signifies that the corresponding constructor is secondary, i.e. declared not in the class header, but in the class body. - */ - @JvmField - val IS_SECONDARY = Flag(F.IS_SECONDARY) - - /** - * Signifies that the corresponding constructor has non-stable parameter names, i.e. cannot be called with named arguments. - */ - @JvmField - val HAS_NON_STABLE_PARAMETER_NAMES = Flag(F.IS_CONSTRUCTOR_WITH_NON_STABLE_PARAMETER_NAMES) - } - - /** - * A container of flags applicable to Kotlin functions. - * - * In addition to the common flag groups, the following flag groups exist for function flags: - * * member kind flags: [IS_DECLARATION], [IS_FAKE_OVERRIDE], [IS_DELEGATION], [IS_SYNTHESIZED] - */ - object Function { - /** - * A member kind flag, signifying that the corresponding function is explicitly declared in the containing class. - */ - @JvmField - val IS_DECLARATION = Flag(F.MEMBER_KIND, MemberKind.DECLARATION_VALUE) - - /** - * A member kind flag, signifying that the corresponding function exists in the containing class because a function with a suitable - * signature exists in a supertype. This flag is not written by the Kotlin compiler and its effects are unspecified. - */ - @JvmField - val IS_FAKE_OVERRIDE = Flag(F.MEMBER_KIND, MemberKind.FAKE_OVERRIDE_VALUE) - - /** - * A member kind flag, signifying that the corresponding function exists in the containing class because it has been produced - * by interface delegation (delegation "by"). - */ - @JvmField - val IS_DELEGATION = Flag(F.MEMBER_KIND, MemberKind.DELEGATION_VALUE) - - /** - * A member kind flag, signifying that the corresponding function exists in the containing class because it has been synthesized - * by the compiler and has no declaration in the source code. - */ - @JvmField - val IS_SYNTHESIZED = Flag(F.MEMBER_KIND, MemberKind.SYNTHESIZED_VALUE) - - - /** - * Signifies that the corresponding function is `operator`. - */ - @JvmField - val IS_OPERATOR = Flag(F.IS_OPERATOR) - - /** - * Signifies that the corresponding function is `infix`. - */ - @JvmField - val IS_INFIX = Flag(F.IS_INFIX) - - /** - * Signifies that the corresponding function is `inline`. - */ - @JvmField - val IS_INLINE = Flag(F.IS_INLINE) - - /** - * Signifies that the corresponding function is `tailrec`. - */ - @JvmField - val IS_TAILREC = Flag(F.IS_TAILREC) - - /** - * Signifies that the corresponding function is `external`. - */ - @JvmField - val IS_EXTERNAL = Flag(F.IS_EXTERNAL_FUNCTION) - - /** - * Signifies that the corresponding function is `suspend`. - */ - @JvmField - val IS_SUSPEND = Flag(F.IS_SUSPEND) - - /** - * Signifies that the corresponding function is `expect`. - */ - @JvmField - val IS_EXPECT = Flag(F.IS_EXPECT_FUNCTION) - - /** - * Signifies that the corresponding function has non-stable parameter names, i.e. cannot be called with named arguments. - */ - @JvmField - val HAS_NON_STABLE_PARAMETER_NAMES = Flag(F.IS_FUNCTION_WITH_NON_STABLE_PARAMETER_NAMES) - } - - /** - * A container of flags applicable to Kotlin properties. - * - * In addition to the common flag groups, the following flag groups exist for property flags: - * * member kind flags: [IS_DECLARATION], [IS_FAKE_OVERRIDE], [IS_DELEGATION], [IS_SYNTHESIZED] - */ - object Property { - /** - * A member kind flag, signifying that the corresponding property is explicitly declared in the containing class. - */ - @JvmField - val IS_DECLARATION = Flag(F.MEMBER_KIND, MemberKind.DECLARATION_VALUE) - - /** - * A member kind flag, signifying that the corresponding property exists in the containing class because a property with a suitable - * signature exists in a supertype. This flag is not written by the Kotlin compiler and its effects are unspecified. - */ - @JvmField - val IS_FAKE_OVERRIDE = Flag(F.MEMBER_KIND, MemberKind.FAKE_OVERRIDE_VALUE) - - /** - * A member kind flag, signifying that the corresponding property exists in the containing class because it has been produced - * by interface delegation (delegation "by"). - */ - @JvmField - val IS_DELEGATION = Flag(F.MEMBER_KIND, MemberKind.DELEGATION_VALUE) - - /** - * A member kind flag, signifying that the corresponding property exists in the containing class because it has been synthesized - * by the compiler and has no declaration in the source code. - */ - @JvmField - val IS_SYNTHESIZED = Flag(F.MEMBER_KIND, MemberKind.SYNTHESIZED_VALUE) - - - /** - * Signifies that the corresponding property is `var`. - */ - @JvmField - val IS_VAR = Flag(F.IS_VAR) - - /** - * Signifies that the corresponding property has a getter. - */ - @JvmField - val HAS_GETTER = Flag(F.HAS_GETTER) - - /** - * Signifies that the corresponding property has a setter. - */ - @JvmField - val HAS_SETTER = Flag(F.HAS_SETTER) - - /** - * Signifies that the corresponding property is `const`. - */ - @JvmField - val IS_CONST = Flag(F.IS_CONST) - - /** - * Signifies that the corresponding property is `lateinit`. - */ - @JvmField - val IS_LATEINIT = Flag(F.IS_LATEINIT) - - /** - * Signifies that the corresponding property has a constant value. On JVM, this flag allows an optimization similarly to - * [F.HAS_ANNOTATIONS]: constant values of properties are written to the bytecode directly, and this flag can be used to avoid - * reading the value from the bytecode in case there isn't one. - */ - @JvmField - val HAS_CONSTANT = Flag(F.HAS_CONSTANT) - - /** - * Signifies that the corresponding property is `external`. - */ - @JvmField - val IS_EXTERNAL = Flag(F.IS_EXTERNAL_PROPERTY) - - /** - * Signifies that the corresponding property is a delegated property. - */ - @JvmField - val IS_DELEGATED = Flag(F.IS_DELEGATED) - - /** - * Signifies that the corresponding property is `expect`. - */ - @JvmField - val IS_EXPECT = Flag(F.IS_EXPECT_PROPERTY) - } - - /** - * A container of flags applicable to Kotlin property getters and setters. - */ - object PropertyAccessor { - /** - * Signifies that the corresponding property accessor is not default, i.e. it has a body and/or annotations in the source code. - */ - @JvmField - val IS_NOT_DEFAULT = Flag(F.IS_NOT_DEFAULT) - - /** - * Signifies that the corresponding property accessor is `external`. - */ - @JvmField - val IS_EXTERNAL = Flag(F.IS_EXTERNAL_ACCESSOR) - - /** - * Signifies that the corresponding property accessor is `inline`. - */ - @JvmField - val IS_INLINE = Flag(F.IS_INLINE_ACCESSOR) - } - /** * A container of flags applicable to Kotlin types. */ @@ -453,68 +60,5 @@ class Flag(private val offset: Int, private val bitWidth: Int, private val value */ @JvmField val IS_NULLABLE = Flag(0, 1, 1) - - /** - * Signifies that the corresponding type is `suspend`. - */ - @JvmField - val IS_SUSPEND = Flag(F.SUSPEND_TYPE.offset + 1, F.SUSPEND_TYPE.bitWidth, 1) - } - - /** - * A container of flags applicable to Kotlin type parameters. - */ - object TypeParameter { - /** - * Signifies that the corresponding type parameter is `reified`. - */ - @JvmField - val IS_REIFIED = Flag(0, 1, 1) - } - - /** - * A container of flags applicable to Kotlin value parameters. - */ - object ValueParameter { - /** - * Signifies that the corresponding value parameter declares a default value. Note that the default value itself can be a complex - * expression and is not available via metadata. Also note that in case of an override of a parameter with default value, the - * parameter in the derived method does _not_ declare the default value ([DECLARES_DEFAULT_VALUE] == false), but the parameter is - * still optional at the call site because the default value from the base method is used. - */ - @JvmField - val DECLARES_DEFAULT_VALUE = Flag(F.DECLARES_DEFAULT_VALUE) - - /** - * Signifies that the corresponding value parameter is `crossinline`. - */ - @JvmField - val IS_CROSSINLINE = Flag(F.IS_CROSSINLINE) - - /** - * Signifies that the corresponding value parameter is `noinline`. - */ - @JvmField - val IS_NOINLINE = Flag(F.IS_NOINLINE) - } - - /** - * A container of flags applicable to Kotlin effect expressions. - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - */ - object EffectExpression { - /** - * Signifies that the corresponding effect expression should be negated to compute the proposition or the conclusion of an effect. - */ - @JvmField - val IS_NEGATED = Flag(F.IS_NEGATED) - - /** - * Signifies that the corresponding effect expression checks whether a value of some variable is `null`. - */ - @JvmField - val IS_NULL_CHECK_PREDICATE = Flag(F.IS_NULL_CHECK_PREDICATE) } } diff --git a/retrofit/src/main/java/kotlinx/metadata/annotations.kt b/retrofit/src/main/java/kotlinx/metadata/annotations.kt deleted file mode 100644 index ac81024e57..0000000000 --- a/retrofit/src/main/java/kotlinx/metadata/annotations.kt +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlinx.metadata - -/** - * Represents an annotation, written to the Kotlin metadata. Note that not all annotations are written to metadata on all platforms. - * For example, on JVM most of the annotations are written directly on the corresponding declarations in the class file, - * and entries in the metadata only have a flag ([Flag.HAS_ANNOTATIONS]) to signal if they do have annotations in the bytecode. - * On JVM, only annotations on type parameters and types are serialized to the Kotlin metadata. - * - * @param className the fully qualified name of the annotation class - * @param arguments explicitly specified arguments to the annotation; does not include default values for annotation parameters - * (specified in the annotation class declaration) - */ -data class KmAnnotation(val className: ClassName, val arguments: Map) - -/** - * Represents an argument to the annotation. - */ -sealed class KmAnnotationArgument { - /** - * A kind of annotation argument, whose value is directly accessible via [value]. - * This is possible for annotation arguments of primitive types, unsigned types and strings. - * - * @param T the type of the value of this argument - */ - sealed class LiteralValue : KmAnnotationArgument() { - /** - * The value of this argument. - */ - abstract val value: T - - data class ByteValue(override val value: Byte) : LiteralValue() - data class CharValue(override val value: Char) : LiteralValue() - data class ShortValue(override val value: Short) : LiteralValue() - data class IntValue(override val value: Int) : LiteralValue() - data class LongValue(override val value: Long) : LiteralValue() - data class FloatValue(override val value: Float) : LiteralValue() - data class DoubleValue(override val value: Double) : LiteralValue() - data class BooleanValue(override val value: Boolean) : LiteralValue() - - // TODO: remove @ExperimentalUnsignedTypes once bootstrap stdlib has stable unsigned types. - @ExperimentalUnsignedTypes - data class UByteValue(override val value: UByte) : LiteralValue() - - @ExperimentalUnsignedTypes - data class UShortValue(override val value: UShort) : LiteralValue() - - @ExperimentalUnsignedTypes - data class UIntValue(override val value: UInt) : LiteralValue() - - @ExperimentalUnsignedTypes - data class ULongValue(override val value: ULong) : LiteralValue() - - data class StringValue(override val value: String) : LiteralValue() - - data class KClassValue(val className: ClassName, val arrayDimensionCount: Int) : KmAnnotationArgument() - - data class EnumValue(val enumClassName: ClassName, val enumEntryName: String) : KmAnnotationArgument() - - data class AnnotationValue(val annotation: KmAnnotation) : KmAnnotationArgument() - data class ArrayValue(val elements: List) : KmAnnotationArgument() - } -} diff --git a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt index 139655460a..168f058813 100644 --- a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt +++ b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt @@ -7,45 +7,19 @@ package kotlinx.metadata.impl.extensions import kotlinx.metadata.* import kotlinx.metadata.impl.ReadContext +import kotlinx.metadata.jvm.impl.JvmMetadataExtensions import org.jetbrains.kotlin.metadata.ProtoBuf import java.util.* interface MetadataExtensions { - fun readClassExtensions(v: KmClassVisitor, proto: ProtoBuf.Class, c: ReadContext) - - fun readPackageExtensions(v: KmPackageVisitor, proto: ProtoBuf.Package, c: ReadContext) - - fun readModuleFragmentExtensions(v: KmModuleFragmentVisitor, proto: ProtoBuf.PackageFragment, c: ReadContext) fun readFunctionExtensions(v: KmFunctionVisitor, proto: ProtoBuf.Function, c: ReadContext) - fun readPropertyExtensions(v: KmPropertyVisitor, proto: ProtoBuf.Property, c: ReadContext) - - fun readConstructorExtensions(v: KmConstructorVisitor, proto: ProtoBuf.Constructor, c: ReadContext) - - fun readTypeParameterExtensions(v: KmTypeParameterVisitor, proto: ProtoBuf.TypeParameter, c: ReadContext) - - fun readTypeExtensions(v: KmTypeVisitor, proto: ProtoBuf.Type, c: ReadContext) - - fun readTypeAliasExtensions(v: KmTypeAliasVisitor, proto: ProtoBuf.TypeAlias, c: ReadContext) - - fun readValueParameterExtensions(v: KmValueParameterVisitor, proto: ProtoBuf.ValueParameter, c: ReadContext) - fun createFunctionExtension(): KmFunctionExtension - fun createTypeExtension(): KmTypeExtension - - fun createValueParameterExtension(): KmValueParameterExtension - companion object { val INSTANCES: List by lazy { - ServiceLoader.load(MetadataExtensions::class.java, MetadataExtensions::class.java.classLoader).toList().also { - if (it.isEmpty()) error( - "No MetadataExtensions instances found in the classpath. Please ensure that the META-INF/services/ " + - "is not stripped from your application and that the Java virtual machine is not running " + - "under a security manager" - ) - } + listOf(JvmMetadataExtensions()) } } } diff --git a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt index de57491bd9..ab5db69d3f 100644 --- a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt +++ b/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt @@ -11,8 +11,4 @@ interface KmExtension : KmExtensionVisitor { fun accept(visitor: V) } -interface KmFunctionExtension : KmFunctionExtensionVisitor, KmExtension - -interface KmTypeExtension : KmTypeExtensionVisitor, KmExtension - -interface KmValueParameterExtension : KmValueParameterExtensionVisitor, KmExtension \ No newline at end of file +interface KmFunctionExtension : KmFunctionExtensionVisitor, KmExtension \ No newline at end of file diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt index 0992b18c6e..61aada5654 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt @@ -41,17 +41,4 @@ data class JvmMethodSignature(override val name: String, override val desc: Stri override fun asString() = name + desc } -/** - * A signature of a JVM field in the JVM-based format. - * - * Example: `JvmFieldSignature("value", "Ljava/lang/String;")`. - * - * @see JvmMemberSignature - */ -data class JvmFieldSignature(override val name: String, override val desc: String) : JvmMemberSignature() { - override fun asString() = "$name:$desc" -} - - internal fun JvmMemberSignatureImpl.Method.wrapAsPublic() = JvmMethodSignature(name, desc) -internal fun JvmMemberSignatureImpl.Field.wrapAsPublic() = JvmFieldSignature(name, desc) diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt index cb48be85dd..67c6f08f9f 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt @@ -15,7 +15,6 @@ import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion * * @param kind see [kind] * @param metadataVersion see [metadataVersion] - * @param bytecodeVersion see [bytecodeVersion] * @param data1 see [data1] * @param data2 see [data2] * @param extraString see [extraString] @@ -23,31 +22,15 @@ import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion * @param extraInt see [extraInt] */ class KotlinClassHeader -@Deprecated( - "Use another constructor, which doesn't take bytecodeVersion as a parameter.", - ReplaceWith("KotlinClassHeader(kind, metadataVersion, data1, data2, extraString, packageName, extraInt)"), - DeprecationLevel.ERROR -) constructor( kind: Int?, metadataVersion: IntArray?, - bytecodeVersion: IntArray?, data1: Array?, data2: Array?, extraString: String?, packageName: String?, extraInt: Int? ) { - @Suppress("DEPRECATION_ERROR") - constructor( - kind: Int?, - metadataVersion: IntArray?, - data1: Array?, - data2: Array?, - extraString: String?, - packageName: String?, - extraInt: Int? - ) : this(kind, metadataVersion, null, data1, data2, extraString, packageName, extraInt) /** * A kind of the metadata this header encodes. @@ -69,18 +52,6 @@ constructor( */ val metadataVersion: IntArray = metadataVersion ?: intArrayOf() - /** - * The version of the bytecode interface (naming conventions, signatures) of the corresponding class file. - * - * @see Metadata.bytecodeVersion - * @see COMPATIBLE_BYTECODE_VERSION - */ - @Deprecated( - "Bytecode version had no significant use in Kotlin metadata and it will be removed in a future version.", - level = DeprecationLevel.ERROR - ) - val bytecodeVersion: IntArray = bytecodeVersion ?: intArrayOf() - /** * The first array of strings used to encode the metadata. * @@ -163,17 +134,5 @@ constructor( */ @JvmField val COMPATIBLE_METADATA_VERSION = JvmMetadataVersion.INSTANCE.toArray().copyOf() - - /** - * The latest bytecode version supported by this version of the library. - * - * @see bytecodeVersion - */ - @Deprecated( - "Bytecode version had no significant use in Kotlin metadata and it will be removed in a future version.", - level = DeprecationLevel.ERROR - ) - @JvmField - val COMPATIBLE_BYTECODE_VERSION = intArrayOf(1, 0, 3) } } diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt index 8c7ee9b682..2f235755f8 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt @@ -15,105 +15,13 @@ import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil internal class JvmMetadataExtensions : MetadataExtensions { - override fun readClassExtensions(v: KmClassVisitor, proto: ProtoBuf.Class, c: ReadContext) { - val ext = v.visitExtensions(JvmClassExtensionVisitor.TYPE) as? JvmClassExtensionVisitor ?: return - - val anonymousObjectOriginName = proto.getExtensionOrNull(JvmProtoBuf.anonymousObjectOriginName) - if (anonymousObjectOriginName != null) { - ext.visitAnonymousObjectOriginName(c[anonymousObjectOriginName]) - } - - for (property in proto.getExtension(JvmProtoBuf.classLocalVariable)) { - ext.visitLocalDelegatedProperty( - property.flags, c[property.name], property.getPropertyGetterFlags(), property.getPropertySetterFlags() - )?.let { property.accept(it, c) } - } - - ext.visitModuleName(proto.getExtensionOrNull(JvmProtoBuf.classModuleName)?.let(c::get) ?: JvmProtoBufUtil.DEFAULT_MODULE_NAME) - - ext.visitEnd() - } - - override fun readPackageExtensions(v: KmPackageVisitor, proto: ProtoBuf.Package, c: ReadContext) { - val ext = v.visitExtensions(JvmPackageExtensionVisitor.TYPE) as? JvmPackageExtensionVisitor ?: return - - for (property in proto.getExtension(JvmProtoBuf.packageLocalVariable)) { - ext.visitLocalDelegatedProperty( - property.flags, c[property.name], property.getPropertyGetterFlags(), property.getPropertySetterFlags() - )?.let { property.accept(it, c) } - } - - ext.visitModuleName(proto.getExtensionOrNull(JvmProtoBuf.packageModuleName)?.let(c::get) ?: JvmProtoBufUtil.DEFAULT_MODULE_NAME) - - ext.visitEnd() - } - - // ModuleFragment is not used by JVM backend. - override fun readModuleFragmentExtensions(v: KmModuleFragmentVisitor, proto: ProtoBuf.PackageFragment, c: ReadContext) {} override fun readFunctionExtensions(v: KmFunctionVisitor, proto: ProtoBuf.Function, c: ReadContext) { val ext = v.visitExtensions(JvmFunctionExtensionVisitor.TYPE) as? JvmFunctionExtensionVisitor ?: return ext.visit(JvmProtoBufUtil.getJvmMethodSignature(proto, c.strings, c.types)?.wrapAsPublic()) - val lambdaClassOriginName = proto.getExtensionOrNull(JvmProtoBuf.lambdaClassOriginName) - if (lambdaClassOriginName != null) { - ext.visitLambdaClassOriginName(c[lambdaClassOriginName]) - } - ext.visitEnd() } - override fun readPropertyExtensions(v: KmPropertyVisitor, proto: ProtoBuf.Property, c: ReadContext) { - val ext = v.visitExtensions(JvmPropertyExtensionVisitor.TYPE) as? JvmPropertyExtensionVisitor ?: return - val fieldSignature = JvmProtoBufUtil.getJvmFieldSignature(proto, c.strings, c.types) - val propertySignature = proto.getExtensionOrNull(JvmProtoBuf.propertySignature) - val getterSignature = - if (propertySignature != null && propertySignature.hasGetter()) propertySignature.getter else null - val setterSignature = - if (propertySignature != null && propertySignature.hasSetter()) propertySignature.setter else null - ext.visit( - proto.getExtension(JvmProtoBuf.flags), - fieldSignature?.wrapAsPublic(), - getterSignature?.run { JvmMethodSignature(c[name], c[desc]) }, - setterSignature?.run { JvmMethodSignature(c[name], c[desc]) } - ) - - val syntheticMethod = - if (propertySignature != null && propertySignature.hasSyntheticMethod()) propertySignature.syntheticMethod else null - ext.visitSyntheticMethodForAnnotations(syntheticMethod?.run { JvmMethodSignature(c[name], c[desc]) }) - - ext.visitEnd() - } - - override fun readConstructorExtensions(v: KmConstructorVisitor, proto: ProtoBuf.Constructor, c: ReadContext) { - val ext = v.visitExtensions(JvmConstructorExtensionVisitor.TYPE) as? JvmConstructorExtensionVisitor ?: return - ext.visit(JvmProtoBufUtil.getJvmConstructorSignature(proto, c.strings, c.types)?.wrapAsPublic()) - } - - override fun readTypeParameterExtensions(v: KmTypeParameterVisitor, proto: ProtoBuf.TypeParameter, c: ReadContext) { - val ext = v.visitExtensions(JvmTypeParameterExtensionVisitor.TYPE) as? JvmTypeParameterExtensionVisitor ?: return - for (annotation in proto.getExtension(JvmProtoBuf.typeParameterAnnotation)) { - ext.visitAnnotation(annotation.readAnnotation(c.strings)) - } - ext.visitEnd() - } - - override fun readTypeExtensions(v: KmTypeVisitor, proto: ProtoBuf.Type, c: ReadContext) { - val ext = v.visitExtensions(JvmTypeExtensionVisitor.TYPE) as? JvmTypeExtensionVisitor ?: return - ext.visit(proto.getExtension(JvmProtoBuf.isRaw)) - for (annotation in proto.getExtension(JvmProtoBuf.typeAnnotation)) { - ext.visitAnnotation(annotation.readAnnotation(c.strings)) - } - ext.visitEnd() - } - - override fun readTypeAliasExtensions(v: KmTypeAliasVisitor, proto: ProtoBuf.TypeAlias, c: ReadContext) {} - - override fun readValueParameterExtensions(v: KmValueParameterVisitor, proto: ProtoBuf.ValueParameter, c: ReadContext) {} - override fun createFunctionExtension(): KmFunctionExtension = JvmFunctionExtension() - - override fun createTypeExtension(): KmTypeExtension = JvmTypeExtension() - - override fun createValueParameterExtension(): KmValueParameterExtension = JvmValueParameterExtension() } diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt index 5c0f99fbe1..00df1ce54c 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt @@ -14,47 +14,16 @@ internal val KmFunction.jvm: JvmFunctionExtension internal class JvmFunctionExtension : JvmFunctionExtensionVisitor(), KmFunctionExtension { var signature: JvmMethodSignature? = null - var lambdaClassOriginName: String? = null override fun visit(signature: JvmMethodSignature?) { this.signature = signature } - override fun visitLambdaClassOriginName(internalName: String) { - this.lambdaClassOriginName = internalName - } override fun accept(visitor: KmFunctionExtensionVisitor) { require(visitor is JvmFunctionExtensionVisitor) visitor.visit(signature) - lambdaClassOriginName?.let(visitor::visitLambdaClassOriginName) visitor.visitEnd() } } -internal class JvmTypeExtension : JvmTypeExtensionVisitor(), KmTypeExtension { - var isRaw: Boolean = false - val annotations: MutableList = mutableListOf() - - override fun visit(isRaw: Boolean) { - this.isRaw = isRaw - } - - override fun visitAnnotation(annotation: KmAnnotation) { - annotations.add(annotation) - } - - override fun accept(visitor: KmTypeExtensionVisitor) { - require(visitor is JvmTypeExtensionVisitor) - visitor.visit(isRaw) - annotations.forEach(visitor::visitAnnotation) - visitor.visitEnd() - } -} - -internal class JvmValueParameterExtension : JvmValueParameterExtensionVisitor(), KmValueParameterExtension { - override fun accept(visitor: KmValueParameterExtensionVisitor) { - require(visitor is JvmValueParameterExtensionVisitor) - visitor.visitEnd() - } -} diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt b/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt index 7d16c7bffb..2c0789d247 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt +++ b/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt @@ -6,109 +6,6 @@ package kotlinx.metadata.jvm import kotlinx.metadata.* -import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil -import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.* - -/** - * A visitor containing the common code to visit JVM extensions for Kotlin declaration containers, such as classes and package fragments. - */ -abstract class JvmDeclarationContainerExtensionVisitor @JvmOverloads constructor( - protected open val delegate: JvmDeclarationContainerExtensionVisitor? = null -) : KmDeclarationContainerExtensionVisitor { - /** - * Visits the metadata of a local delegated property used somewhere inside this container (but not in a nested declaration container). - * Note that for classes produced by the Kotlin compiler, such properties will have default accessors. - * - * The order of visited local delegated properties is important. The Kotlin compiler generates the corresponding property's index - * at the call site, so that reflection would be able to load the metadata of the property with that index at runtime. - * If an incorrect index is used, either the `KProperty<*>` object passed to delegate methods will point to the wrong property - * at runtime, or an exception will be thrown. - * - * @param flags property flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Property] flags - * @param name the name of the property - * @param getterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag - * and [Flag.PropertyAccessor] flags - * @param setterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag - * and [Flag.PropertyAccessor] flags - */ - open fun visitLocalDelegatedProperty(flags: Flags, name: String, getterFlags: Flags, setterFlags: Flags): KmPropertyVisitor? = - delegate?.visitLocalDelegatedProperty(flags, name, getterFlags, setterFlags) - - /** - * Visits the name of the module where this container is declared. - */ - open fun visitModuleName(name: String) { - delegate?.visitModuleName(name) - } -} - -/** - * A visitor to visit JVM extensions for a class. - */ -open class JvmClassExtensionVisitor @JvmOverloads constructor( - delegate: JvmClassExtensionVisitor? = null -) : KmClassExtensionVisitor, JvmDeclarationContainerExtensionVisitor(delegate) { - override val delegate: JvmClassExtensionVisitor? - get() = super.delegate as JvmClassExtensionVisitor? - - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits the JVM internal name of the original class this anonymous object is copied from. This method is called for - * anonymous objects copied from bodies of inline functions to the use site by the Kotlin compiler. - */ - open fun visitAnonymousObjectOriginName(internalName: String) { - delegate?.visitAnonymousObjectOriginName(internalName) - } - - /** - * Visits the end of JVM extensions for the class. - */ - open fun visitEnd() { - delegate?.visitEnd() - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmClassExtensionVisitor::class) - } -} - -/** - * A visitor to visit JVM extensions for a package fragment. - */ -open class JvmPackageExtensionVisitor @JvmOverloads constructor( - delegate: JvmPackageExtensionVisitor? = null -) : KmPackageExtensionVisitor, JvmDeclarationContainerExtensionVisitor(delegate) { - override val delegate: JvmPackageExtensionVisitor? - get() = super.delegate as JvmPackageExtensionVisitor? - - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits the end of JVM extensions for the package fragment. - */ - open fun visitEnd() { - delegate?.visitEnd() - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmPackageExtensionVisitor::class) - } -} /** * A visitor to visit JVM extensions for a function. @@ -130,14 +27,6 @@ open class JvmFunctionExtensionVisitor @JvmOverloads constructor( delegate?.visit(signature) } - /** - * Visits the JVM internal name of the original class the lambda class for this function is copied from. - * This information is present for lambdas copied from bodies of inline functions to the use site by the Kotlin compiler. - */ - open fun visitLambdaClassOriginName(internalName: String) { - delegate?.visitLambdaClassOriginName(internalName) - } - /** * Visits the end of JVM extensions for the function. */ @@ -155,251 +44,3 @@ open class JvmFunctionExtensionVisitor @JvmOverloads constructor( val TYPE: KmExtensionType = KmExtensionType(JvmFunctionExtensionVisitor::class) } } - -/** - * A visitor to visit JVM extensions for a property. - */ -open class JvmPropertyExtensionVisitor @JvmOverloads constructor( - private val delegate: JvmPropertyExtensionVisitor? = null -) : KmPropertyExtensionVisitor { - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits JVM signatures of field and accessors generated for the property. - * - * @param jvmFlags JVM-specific flags of the property, consisting of [JvmFlag.Property] flags - * @param fieldSignature the signature of the backing field of the property, or `null` if this property has no backing field. - * Example: `JvmFieldSignature("X", "Ljava/lang/Object;")` - * @param getterSignature the signature of the property getter, or `null` if this property has no getter or its signature is unknown. - * Example: `JvmMethodSignature("getX", "()Ljava/lang/Object;")` - * @param setterSignature the signature of the property setter, or `null` if this property has no setter or its signature is unknown. - * Example: `JvmMethodSignature("setX", "(Ljava/lang/Object;)V")` - */ - open fun visit( - jvmFlags: Flags, - fieldSignature: JvmFieldSignature?, - getterSignature: JvmMethodSignature?, - setterSignature: JvmMethodSignature? - ) { - delegate?.visit(jvmFlags, fieldSignature, getterSignature, setterSignature) - - @Suppress("DEPRECATION_ERROR") - visit(fieldSignature, getterSignature, setterSignature) - } - - @Deprecated( - "Use visit(Flags, JvmFieldSignature?, JvmMethodSignature?, JvmMethodSignature?) instead.", - level = DeprecationLevel.ERROR, - replaceWith = ReplaceWith("visit(flagsOf(), fieldSignature, getterSignature, setterSignature)", "kotlinx.metadata.flagsOf") - ) - open fun visit( - fieldSignature: JvmFieldSignature?, - getterSignature: JvmMethodSignature?, - setterSignature: JvmMethodSignature? - ) { - @Suppress("DEPRECATION_ERROR") - delegate?.visit(fieldSignature, getterSignature, setterSignature) - } - - /** - * Visits the JVM signature of a synthetic method which is generated to store annotations on a property in the bytecode. - * - * Example: `JvmMethodSignature("getX$annotations", "()V")` - * - * @param signature the signature of the synthetic method - */ - open fun visitSyntheticMethodForAnnotations(signature: JvmMethodSignature?) { - delegate?.visitSyntheticMethodForAnnotations(signature) - } - - /** - * Visits the end of JVM extensions for the property. - */ - open fun visitEnd() { - delegate?.visitEnd() - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmPropertyExtensionVisitor::class) - } -} - -/** - * A visitor to visit JVM extensions for a constructor. - */ -open class JvmConstructorExtensionVisitor @JvmOverloads constructor( - private val delegate: JvmConstructorExtensionVisitor? = null -) : KmConstructorExtensionVisitor { - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits the JVM signature of the constructor, or null if the JVM signature of this constructor is unknown. - * - * Example: `JvmMethodSignature("", "(Ljava/lang/Object;)V")` - * - * @param signature the signature of the constructor - */ - open fun visit(signature: JvmMethodSignature?) { - delegate?.visit(signature) - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmConstructorExtensionVisitor::class) - } -} - -/** - * A visitor to visit JVM extensions for a type parameter. - */ -open class JvmTypeParameterExtensionVisitor @JvmOverloads constructor( - private val delegate: JvmTypeParameterExtensionVisitor? = null -) : KmTypeParameterExtensionVisitor { - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits an annotation on the type parameter. - * - * @param annotation the annotation on the type parameter - */ - open fun visitAnnotation(annotation: KmAnnotation) { - delegate?.visitAnnotation(annotation) - } - - /** - * Visits the end of JVM extensions for the type parameter. - */ - open fun visitEnd() { - delegate?.visitEnd() - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmTypeParameterExtensionVisitor::class) - } -} - -/** - * A visitor to visit JVM extensions for a type. - */ -open class JvmTypeExtensionVisitor @JvmOverloads constructor( - private val delegate: JvmTypeExtensionVisitor? = null -) : KmTypeExtensionVisitor { - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits the JVM-specific flags of a type. - * - * @param isRaw whether the type is seen as a raw type in Java - */ - open fun visit(isRaw: Boolean) { - delegate?.visit(isRaw) - } - - /** - * Visits an annotation on the type. - * - * @param annotation the annotation on the type - */ - open fun visitAnnotation(annotation: KmAnnotation) { - delegate?.visitAnnotation(annotation) - } - - /** - * Visits the end of JVM extensions for the type parameter. - */ - open fun visitEnd() { - delegate?.visitEnd() - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmTypeExtensionVisitor::class) - - /** - * The type flexibility id, signifying that the visited type is a JVM platform type. - * - * @see KmTypeVisitor.visitFlexibleTypeUpperBound - */ - const val PLATFORM_TYPE_ID = JvmProtoBufUtil.PLATFORM_TYPE_ID - } -} - -/** - * A visitor to visit JVM extensions for a type alias. - */ -open class JvmTypeAliasExtensionVisitor @JvmOverloads constructor( - private val delegate: JvmTypeAliasExtensionVisitor? = null -) : KmTypeAliasExtensionVisitor { - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits the end of JVM extensions for the type alias. - */ - open fun visitEnd() { - delegate?.visitEnd() - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmTypeAliasExtensionVisitor::class) - } -} - -/** - * A visitor to visit JVM extensions for a value parameter. - */ -open class JvmValueParameterExtensionVisitor @JvmOverloads constructor( - private val delegate: JvmValueParameterExtensionVisitor? = null -) : KmTypeAliasExtensionVisitor { - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits the end of JVM extensions for the value parameter. - */ - open fun visitEnd() { - delegate?.visitEnd() - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmValueParameterExtensionVisitor::class) - } -} diff --git a/retrofit/src/main/java/kotlinx/metadata/nodes.kt b/retrofit/src/main/java/kotlinx/metadata/nodes.kt index 4d6f7582af..137f074b9c 100644 --- a/retrofit/src/main/java/kotlinx/metadata/nodes.kt +++ b/retrofit/src/main/java/kotlinx/metadata/nodes.kt @@ -8,6 +8,7 @@ package kotlinx.metadata import kotlinx.metadata.impl.extensions.* +import java.lang.IllegalStateException /** * Represents a Kotlin declaration container, such as a class or a package fragment. @@ -17,308 +18,28 @@ interface KmDeclarationContainer { * Functions in the container. */ val functions: MutableList - - /** - * Properties in the container. - */ - val properties: MutableList - - /** - * Type aliases in the container. - */ - val typeAliases: MutableList } /** * Represents a Kotlin class. */ class KmClass : KmClassVisitor(), KmDeclarationContainer { - /** - * Class flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Class] flags. - */ - var flags: Flags = flagsOf() - - /** - * Name of the class. - */ - lateinit var name: ClassName - - /** - * Type parameters of the class. - */ - val typeParameters: MutableList = ArrayList(0) - - /** - * Supertypes of the class. - */ - val supertypes: MutableList = ArrayList(1) /** * Functions in the class. */ override val functions: MutableList = ArrayList() - /** - * Properties in the class. - */ - override val properties: MutableList = ArrayList() - - /** - * Type aliases in the class. - */ - override val typeAliases: MutableList = ArrayList(0) - - /** - * Constructors of the class. - */ - val constructors: MutableList = ArrayList(1) - - /** - * Name of the companion object of this class, if it has one. - */ - var companionObject: String? = null - - /** - * Names of nested classes of this class. - */ - val nestedClasses: MutableList = ArrayList(0) - - /** - * Names of enum entries, if this class is an enum class. - */ - val enumEntries: MutableList = ArrayList(0) - - /** - * Names of direct subclasses of this class, if this class is `sealed`. - */ - val sealedSubclasses: MutableList = ArrayList(0) - - /** - * Name of the underlying property, if this class is `inline`. - */ - var inlineClassUnderlyingPropertyName: String? = null - - /** - * Type of the underlying property, if this class is `inline`. - */ - var inlineClassUnderlyingType: KmType? = null - - /** - * Version requirements on this class. - */ - val versionRequirements: MutableList = ArrayList(0) - -// private val extensions: List = -// MetadataExtensions.INSTANCES.map(MetadataExtensions::createClassExtension) - - override fun visit(flags: Flags, name: ClassName) { - this.flags = flags - this.name = name - } - - override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor = - KmTypeParameter(flags, name, id, variance).addTo(typeParameters) - - override fun visitSupertype(flags: Flags): KmTypeVisitor = - KmType(flags).addTo(supertypes) - override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor = KmFunction(flags, name).addTo(functions) - override fun visitProperty(flags: Flags, name: String, getterFlags: Flags, setterFlags: Flags): KmPropertyVisitor = - KmProperty(flags, name, getterFlags, setterFlags).addTo(properties) - - override fun visitTypeAlias(flags: Flags, name: String): KmTypeAliasVisitor = - KmTypeAlias(flags, name).addTo(typeAliases) - - override fun visitConstructor(flags: Flags): KmConstructorVisitor = - KmConstructor(flags).addTo(constructors) - - override fun visitCompanionObject(name: String) { - this.companionObject = name - } - - override fun visitNestedClass(name: String) { - nestedClasses.add(name) - } - - override fun visitEnumEntry(name: String) { - enumEntries.add(name) - } - - override fun visitSealedSubclass(name: ClassName) { - sealedSubclasses.add(name) - } - - override fun visitInlineClassUnderlyingPropertyName(name: String) { - inlineClassUnderlyingPropertyName = name - } - - override fun visitInlineClassUnderlyingType(flags: Flags): KmTypeVisitor = - KmType(flags).also { inlineClassUnderlyingType = it } - - override fun visitVersionRequirement(): KmVersionRequirementVisitor = - KmVersionRequirement().addTo(versionRequirements) - - override fun visitExtensions(type: KmExtensionType): KmClassExtensionVisitor = object : KmClassExtensionVisitor { - override val type: KmExtensionType - get() = type - } -// extensions.singleOfType(type) - /** * Populates the given visitor with data in this class. * * @param visitor the visitor which will visit data in this class */ fun accept(visitor: KmClassVisitor) { - visitor.visit(flags, name) - typeParameters.forEach { visitor.visitTypeParameter(it.flags, it.name, it.id, it.variance)?.let(it::accept) } - supertypes.forEach { visitor.visitSupertype(it.flags)?.let(it::accept) } - functions.forEach { visitor.visitFunction(it.flags, it.name)?.let(it::accept) } - properties.forEach { visitor.visitProperty(it.flags, it.name, it.getterFlags, it.setterFlags)?.let(it::accept) } - typeAliases.forEach { visitor.visitTypeAlias(it.flags, it.name)?.let(it::accept) } - constructors.forEach { visitor.visitConstructor(it.flags)?.let(it::accept) } - companionObject?.let(visitor::visitCompanionObject) - nestedClasses.forEach(visitor::visitNestedClass) - enumEntries.forEach(visitor::visitEnumEntry) - sealedSubclasses.forEach(visitor::visitSealedSubclass) - inlineClassUnderlyingPropertyName?.let(visitor::visitInlineClassUnderlyingPropertyName) - inlineClassUnderlyingType?.let { visitor.visitInlineClassUnderlyingType(it.flags)?.let(it::accept) } - versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } -// extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents a Kotlin package fragment, including single file facades and multi-file class parts. - */ -class KmPackage : KmPackageVisitor(), KmDeclarationContainer { - /** - * Functions in the package fragment. - */ - override val functions: MutableList = ArrayList() - - /** - * Properties in the package fragment. - */ - override val properties: MutableList = ArrayList() - - /** - * Type aliases in the package fragment. - */ - override val typeAliases: MutableList = ArrayList(0) - - override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor = - KmFunction(flags, name).addTo(functions) - - override fun visitProperty(flags: Flags, name: String, getterFlags: Flags, setterFlags: Flags): KmPropertyVisitor = - KmProperty(flags, name, getterFlags, setterFlags).addTo(properties) - - override fun visitTypeAlias(flags: Flags, name: String): KmTypeAliasVisitor = - KmTypeAlias(flags, name).addTo(typeAliases) - - /** - * Populates the given visitor with data in this package fragment. - * - * @param visitor the visitor which will visit data in this package fragment - */ - fun accept(visitor: KmPackageVisitor) { functions.forEach { visitor.visitFunction(it.flags, it.name)?.let(it::accept) } - properties.forEach { visitor.visitProperty(it.flags, it.name, it.getterFlags, it.setterFlags)?.let(it::accept) } - typeAliases.forEach { visitor.visitTypeAlias(it.flags, it.name)?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents a Kotlin module fragment. This is used to represent metadata of a part of a module on platforms other than JVM. - */ -class KmModuleFragment : KmModuleFragmentVisitor() { - - /** - * Top-level functions, type aliases and properties in the module fragment. - */ - var pkg: KmPackage? = null - - /** - * Classes in the module fragment. - */ - val classes: MutableList = ArrayList() - - override fun visitPackage(): KmPackageVisitor? = - KmPackage().also { pkg = it } - - override fun visitClass(): KmClassVisitor? = - KmClass().addTo(classes) - - /** - * Populates the given visitor with data in this module fragment. - * - * @param visitor the visitor which will visit data in the module fragment. - */ - fun accept(visitor: KmModuleFragmentVisitor) { - pkg?.let { visitor.visitPackage()?.let(it::accept) } - classes.forEach { visitor.visitClass()?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents a synthetic class generated for a Kotlin lambda. - */ -class KmLambda : KmLambdaVisitor() { - /** - * Signature of the synthetic anonymous function, representing the lambda. - */ - lateinit var function: KmFunction - - override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor = - KmFunction(flags, name).also { function = it } - - /** - * Populates the given visitor with data in this lambda. - * - * @param visitor the visitor which will visit data in this lambda - */ - fun accept(visitor: KmLambdaVisitor) { - visitor.visitFunction(function.flags, function.name)?.let(function::accept) - visitor.visitEnd() - } -} - -/** - * Represents a constructor of a Kotlin class. - * - * @property flags constructor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag and [Flag.Constructor] flags - */ -class KmConstructor(var flags: Flags) : KmConstructorVisitor() { - /** - * Value parameters of the constructor. - */ - val valueParameters: MutableList = ArrayList() - - /** - * Version requirements on the constructor. - */ - val versionRequirements: MutableList = ArrayList(0) - - override fun visitValueParameter(flags: Flags, name: String): KmValueParameterVisitor = - KmValueParameter(flags, name).addTo(valueParameters) - - override fun visitVersionRequirement(): KmVersionRequirementVisitor = - KmVersionRequirement().addTo(versionRequirements) - - /** - * Populates the given visitor with data in this constructor. - * - * @param visitor the visitor which will visit data in this class - */ - fun accept(visitor: KmConstructorVisitor) { - valueParameters.forEach { visitor.visitValueParameter(it.flags, it.name)?.let(it::accept) } - versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } - visitor.visitEnd() } } @@ -332,57 +53,18 @@ class KmFunction( var flags: Flags, var name: String ) : KmFunctionVisitor() { - /** - * Type parameters of the function. - */ - val typeParameters: MutableList = ArrayList(0) - - /** - * Type of the receiver of the function, if this is an extension function. - */ - var receiverParameterType: KmType? = null - - /** - * Value parameters of the function. - */ - val valueParameters: MutableList = ArrayList() /** * Return type of the function. */ lateinit var returnType: KmType - /** - * Version requirements on the function. - */ - val versionRequirements: MutableList = ArrayList(0) - - /** - * Contract of the function. - */ - var contract: KmContract? = null - private val extensions: List = MetadataExtensions.INSTANCES.map(MetadataExtensions::createFunctionExtension) - override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor = - KmTypeParameter(flags, name, id, variance).addTo(typeParameters) - - override fun visitReceiverParameterType(flags: Flags): KmTypeVisitor = - KmType(flags).also { receiverParameterType = it } - - override fun visitValueParameter(flags: Flags, name: String): KmValueParameterVisitor = - KmValueParameter(flags, name).addTo(valueParameters) - override fun visitReturnType(flags: Flags): KmTypeVisitor = KmType(flags).also { returnType = it } - override fun visitVersionRequirement(): KmVersionRequirementVisitor = - KmVersionRequirement().addTo(versionRequirements) - - override fun visitContract(): KmContractVisitor = - KmContract().also { contract = it } - override fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor = extensions.singleOfType(type) @@ -392,231 +74,8 @@ class KmFunction( * @param visitor the visitor which will visit data in this function */ fun accept(visitor: KmFunctionVisitor) { - typeParameters.forEach { visitor.visitTypeParameter(it.flags, it.name, it.id, it.variance)?.let(it::accept) } - receiverParameterType?.let { visitor.visitReceiverParameterType(it.flags)?.let(it::accept) } - valueParameters.forEach { visitor.visitValueParameter(it.flags, it.name)?.let(it::accept) } - visitor.visitReturnType(returnType.flags)?.let(returnType::accept) - versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } - contract?.let { visitor.visitContract()?.let(it::accept) } - extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents a Kotlin property declaration. - * - * @property flags property flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Property] flags - * @property name the name of the property - * @property getterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag - * and [Flag.PropertyAccessor] flags - * @property setterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag - * and [Flag.PropertyAccessor] flags - */ -class KmProperty( - var flags: Flags, - var name: String, - var getterFlags: Flags, - var setterFlags: Flags -) : KmPropertyVisitor() { - /** - * Type parameters of the property. - */ - val typeParameters: MutableList = ArrayList(0) - - /** - * Type of the receiver of the property, if this is an extension property. - */ - var receiverParameterType: KmType? = null - - /** - * Value parameter of the setter of this property, if this is a `var` property. - */ - var setterParameter: KmValueParameter? = null - - /** - * Type of the property. - */ - lateinit var returnType: KmType - - /** - * Version requirements on the property. - */ - val versionRequirements: MutableList = ArrayList(0) - - override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor = - KmTypeParameter(flags, name, id, variance).addTo(typeParameters) - - override fun visitReceiverParameterType(flags: Flags): KmTypeVisitor = - KmType(flags).also { receiverParameterType = it } - - override fun visitSetterParameter(flags: Flags, name: String): KmValueParameterVisitor = - KmValueParameter(flags, name).also { setterParameter = it } - - override fun visitReturnType(flags: Flags): KmTypeVisitor = - KmType(flags).also { returnType = it } - - override fun visitVersionRequirement(): KmVersionRequirementVisitor = - KmVersionRequirement().addTo(versionRequirements) - - /** - * Populates the given visitor with data in this property. - * - * @param visitor the visitor which will visit data in this property - */ - fun accept(visitor: KmPropertyVisitor) { - typeParameters.forEach { visitor.visitTypeParameter(it.flags, it.name, it.id, it.variance)?.let(it::accept) } - receiverParameterType?.let { visitor.visitReceiverParameterType(it.flags)?.let(it::accept) } - setterParameter?.let { visitor.visitSetterParameter(it.flags, it.name)?.let(it::accept) } visitor.visitReturnType(returnType.flags)?.let(returnType::accept) - versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents a Kotlin type alias declaration. - * - * @property flags type alias flags, consisting of [Flag.HAS_ANNOTATIONS] and visibility flag - * @property name the name of the type alias - */ -class KmTypeAlias( - var flags: Flags, - var name: String -) : KmTypeAliasVisitor() { - /** - * Type parameters of the type alias. - */ - val typeParameters: MutableList = ArrayList(0) - - /** - * Underlying type of the type alias, i.e. the type in the right-hand side of the type alias declaration. - */ - lateinit var underlyingType: KmType - - /** - * Expanded type of the type alias, i.e. the full expansion of the underlying type, where all type aliases are substituted - * with their expanded types. If no type aliases are used in the underlying type, expanded type is equal to the underlying type. - */ - lateinit var expandedType: KmType - - /** - * Annotations on the type alias. - */ - val annotations: MutableList = ArrayList(0) - - /** - * Version requirements on the type alias. - */ - val versionRequirements: MutableList = ArrayList(0) - - override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor = - KmTypeParameter(flags, name, id, variance).addTo(typeParameters) - - override fun visitUnderlyingType(flags: Flags): KmTypeVisitor = - KmType(flags).also { underlyingType = it } - - override fun visitExpandedType(flags: Flags): KmTypeVisitor = - KmType(flags).also { expandedType = it } - - override fun visitAnnotation(annotation: KmAnnotation) { - annotations.add(annotation) - } - - override fun visitVersionRequirement(): KmVersionRequirementVisitor = - KmVersionRequirement().addTo(versionRequirements) - - /** - * Populates the given visitor with data in this type alias. - * - * @param visitor the visitor which will visit data in this type alias - */ - fun accept(visitor: KmTypeAliasVisitor) { - typeParameters.forEach { visitor.visitTypeParameter(it.flags, it.name, it.id, it.variance)?.let(it::accept) } - visitor.visitUnderlyingType(underlyingType.flags)?.let(underlyingType::accept) - visitor.visitExpandedType(expandedType.flags)?.let(expandedType::accept) - annotations.forEach(visitor::visitAnnotation) - versionRequirements.forEach { visitor.visitVersionRequirement()?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents a value parameter of a Kotlin constructor, function or property setter. - * - * @property flags value parameter flags, consisting of [Flag.ValueParameter] flags - * @property name the name of the value parameter - */ -class KmValueParameter( - var flags: Flags, - var name: String -) : KmValueParameterVisitor() { - /** - * Type of the value parameter, if this is **not** a `vararg` parameter. - */ - var type: KmType? = null - - /** - * Type of the value parameter, if this is a `vararg` parameter. - */ - var varargElementType: KmType? = null - - private val extensions: List = - MetadataExtensions.INSTANCES.map(MetadataExtensions::createValueParameterExtension) - - override fun visitType(flags: Flags): KmTypeVisitor = - KmType(flags).also { type = it } - - override fun visitVarargElementType(flags: Flags): KmTypeVisitor = - KmType(flags).also { varargElementType = it } - - override fun visitExtensions(type: KmExtensionType): KmValueParameterExtensionVisitor? = - extensions.singleOfType(type) - - /** - * Populates the given visitor with data in this value parameter. - * - * @param visitor the visitor which will visit data in this value parameter - */ - fun accept(visitor: KmValueParameterVisitor) { - type?.let { visitor.visitType(it.flags)?.let(it::accept) } - varargElementType?.let { visitor.visitVarargElementType(it.flags)?.let(it::accept) } extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents a type parameter of a Kotlin class, function, property or type alias. - * - * @property flags type parameter flags, consisting of [Flag.TypeParameter] flags - * @property name the name of the type parameter - * @property id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where - * the name isn't enough (e.g. `class A { fun foo(t: T) }`) - * @property variance the declaration-site variance of the type parameter - */ -class KmTypeParameter( - var flags: Flags, - var name: String, - var id: Int, - var variance: KmVariance -) : KmTypeParameterVisitor() { - /** - * Upper bounds of the type parameter. - */ - val upperBounds: MutableList = ArrayList(1) - - override fun visitUpperBound(flags: Flags): KmTypeVisitor = - KmType(flags).addTo(upperBounds) - - /** - * Populates the given visitor with data in this type parameter. - * - * @param visitor the visitor which will visit data in this type parameter - */ - fun accept(visitor: KmTypeParameterVisitor) { - upperBounds.forEach { visitor.visitUpperBound(it.flags)?.let(it::accept) } - visitor.visitEnd() } } @@ -631,75 +90,10 @@ class KmType(var flags: Flags) : KmTypeVisitor() { */ lateinit var classifier: KmClassifier - /** - * Arguments of the type, if the type's classifier is a class or a type alias. - */ - val arguments: MutableList = ArrayList(0) - - /** - * Abbreviation of this type. Note that all types are expanded for metadata produced by the Kotlin compiler. For example: - * - * typealias A = MutableList - * - * fun foo(a: A) {} - * - * The type of the `foo`'s parameter in the metadata is actually `MutableList`, and its abbreviation is `A`. - */ - var abbreviatedType: KmType? = null - - /** - * Outer type of this type, if this type's classifier is an inner class. For example: - * - * class A { inner class B } - * - * fun foo(a: A<*>.B) {} - * - * The type of the `foo`'s parameter in the metadata is `B` (a type whose classifier is class `B`, and it has one type argument, - * type `Byte?`), and its outer type is `A<*>` (a type whose classifier is class `A`, and it has one type argument, star projection). - */ - var outerType: KmType? = null - - /** - * Upper bound of this type, if this type is flexible. In that case, all other data refers to the lower bound of the type. - * - * Flexible types in Kotlin include platform types in Kotlin/JVM and `dynamic` type in Kotlin/JS. - */ - var flexibleTypeUpperBound: KmFlexibleTypeUpperBound? = null - - private val extensions: List = - MetadataExtensions.INSTANCES.map(MetadataExtensions::createTypeExtension) - override fun visitClass(name: ClassName) { classifier = KmClassifier.Class(name) } - override fun visitTypeAlias(name: ClassName) { - classifier = KmClassifier.TypeAlias(name) - } - - override fun visitTypeParameter(id: Int) { - classifier = KmClassifier.TypeParameter(id) - } - - override fun visitArgument(flags: Flags, variance: KmVariance): KmTypeVisitor = - KmType(flags).also { arguments.add(KmTypeProjection(variance, it)) } - - override fun visitStarProjection() { - arguments.add(KmTypeProjection.STAR) - } - - override fun visitAbbreviatedType(flags: Flags): KmTypeVisitor = - KmType(flags).also { abbreviatedType = it } - - override fun visitOuterType(flags: Flags): KmTypeVisitor = - KmType(flags).also { outerType = it } - - override fun visitFlexibleTypeUpperBound(flags: Flags, typeFlexibilityId: String?): KmTypeVisitor = - KmType(flags).also { flexibleTypeUpperBound = KmFlexibleTypeUpperBound(it, typeFlexibilityId) } - - override fun visitExtensions(type: KmExtensionType): KmTypeExtension = - extensions.singleOfType(type) - /** * Populates the given visitor with data in this type. * @@ -708,220 +102,8 @@ class KmType(var flags: Flags) : KmTypeVisitor() { fun accept(visitor: KmTypeVisitor) { when (val classifier = classifier) { is KmClassifier.Class -> visitor.visitClass(classifier.name) - is KmClassifier.TypeParameter -> visitor.visitTypeParameter(classifier.id) - is KmClassifier.TypeAlias -> visitor.visitTypeAlias(classifier.name) + else -> throw IllegalStateException("Invalid classifier type: ${classifier::class}") } - arguments.forEach { argument -> - if (argument == KmTypeProjection.STAR) visitor.visitStarProjection() - else { - val (variance, type) = argument - if (variance == null || type == null) - throw InconsistentKotlinMetadataException("Variance and type must be set for non-star type projection") - visitor.visitArgument(type.flags, variance)?.let(type::accept) - } - } - abbreviatedType?.let { visitor.visitAbbreviatedType(it.flags)?.let(it::accept) } - outerType?.let { visitor.visitOuterType(it.flags)?.let(it::accept) } - flexibleTypeUpperBound?.let { visitor.visitFlexibleTypeUpperBound(it.type.flags, it.typeFlexibilityId)?.let(it.type::accept) } - extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents a version requirement on a Kotlin declaration. - * - * Version requirement is an internal feature of the Kotlin compiler and the standard Kotlin library, - * enabled for example with the internal [kotlin.internal.RequireKotlin] annotation. - */ -class KmVersionRequirement : KmVersionRequirementVisitor() { - /** - * Kind of the version that this declaration requires. - */ - lateinit var kind: KmVersionRequirementVersionKind - - /** - * Level of the diagnostic that must be reported on the usages of the declaration in case the version requirement is not satisfied. - */ - lateinit var level: KmVersionRequirementLevel - - /** - * Optional error code to be displayed in the diagnostic. - */ - var errorCode: Int? = null - - /** - * Optional message to be displayed in the diagnostic. - */ - var message: String? = null - - /** - * Version required by this requirement. - */ - lateinit var version: KmVersion - - override fun visit(kind: KmVersionRequirementVersionKind, level: KmVersionRequirementLevel, errorCode: Int?, message: String?) { - this.kind = kind - this.level = level - this.errorCode = errorCode - this.message = message - } - - override fun visitVersion(major: Int, minor: Int, patch: Int) { - this.version = KmVersion(major, minor, patch) - } - - /** - * Populates the given visitor with data in this version requirement. - * - * @param visitor the visitor which will visit data in this version requirement - */ - fun accept(visitor: KmVersionRequirementVisitor) { - visitor.visit(kind, level, errorCode, message) - visitor.visitVersion(version.major, version.minor, version.patch) - visitor.visitEnd() - } -} - -/** - * Represents a contract of a Kotlin function. - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - */ -class KmContract : KmContractVisitor() { - /** - * Effects of this contract. - */ - val effects: MutableList = ArrayList(1) - - override fun visitEffect(type: KmEffectType, invocationKind: KmEffectInvocationKind?): KmEffectVisitor = - KmEffect(type, invocationKind).addTo(effects) - - /** - * Populates the given visitor with data in this contract. - * - * @param visitor the visitor which will visit data in this contract - */ - fun accept(visitor: KmContractVisitor) { - effects.forEach { visitor.visitEffect(it.type, it.invocationKind)?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents an effect (a part of the contract of a Kotlin function). - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - * - * @property type type of the effect - * @property invocationKind optional number of invocations of the lambda parameter of this function, - * specified further in the effect expression - */ -class KmEffect( - var type: KmEffectType, - var invocationKind: KmEffectInvocationKind? -) : KmEffectVisitor() { - /** - * Arguments of the effect constructor, i.e. the constant value for the [KmEffectType.RETURNS_CONSTANT] effect, - * or the parameter reference for the [KmEffectType.CALLS] effect. - */ - val constructorArguments: MutableList = ArrayList(1) - - /** - * Conclusion of the effect. If this value is set, the effect represents an implication with this value as the right-hand side. - */ - var conclusion: KmEffectExpression? = null - - override fun visitConstructorArgument(): KmEffectExpressionVisitor = - KmEffectExpression().addTo(constructorArguments) - - override fun visitConclusionOfConditionalEffect(): KmEffectExpressionVisitor = - KmEffectExpression().also { conclusion = it } - - /** - * Populates the given visitor with data in this effect. - * - * @param visitor the visitor which will visit data in this effect - */ - fun accept(visitor: KmEffectVisitor) { - constructorArguments.forEach { visitor.visitConstructorArgument()?.let(it::accept) } - conclusion?.let { visitor.visitConclusionOfConditionalEffect()?.let(it::accept) } - visitor.visitEnd() - } -} - -/** - * Represents an effect expression, the contents of an effect (a part of the contract of a Kotlin function). - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - */ -class KmEffectExpression : KmEffectExpressionVisitor() { - /** - * Effect expression flags, consisting of [Flag.EffectExpression] flags. - */ - var flags: Flags = flagsOf() - - /** - * Optional 1-based index of the value parameter of the function, for effects which assert something about - * the function parameters. The index 0 means the extension receiver parameter. - */ - var parameterIndex: Int? = null - - /** - * Constant value used in the effect expression. - */ - var constantValue: KmConstantValue? = null - - /** - * Type used as the target of an `is`-expression in the effect expression. - */ - var isInstanceType: KmType? = null - - /** - * Arguments of an `&&`-expression. If this list is non-empty, the resulting effect expression is a conjunction of this expression - * and elements of the list. - */ - val andArguments: MutableList = ArrayList(0) - - /** - * Arguments of an `||`-expression. If this list is non-empty, the resulting effect expression is a disjunction of this expression - * and elements of the list. - */ - val orArguments: MutableList = ArrayList(0) - - override fun visit(flags: Flags, parameterIndex: Int?) { - this.flags = flags - this.parameterIndex = parameterIndex - } - - override fun visitConstantValue(value: Any?) { - constantValue = KmConstantValue(value) - } - - override fun visitIsInstanceType(flags: Flags): KmTypeVisitor = - KmType(flags).also { isInstanceType = it } - - override fun visitAndArgument(): KmEffectExpressionVisitor = - KmEffectExpression().addTo(andArguments) - - override fun visitOrArgument(): KmEffectExpressionVisitor = - KmEffectExpression().addTo(orArguments) - - /** - * Populates the given visitor with data in this effect expression. - * - * @param visitor the visitor which will visit data in this effect expression - */ - fun accept(visitor: KmEffectExpressionVisitor) { - visitor.visit(flags, parameterIndex) - constantValue?.let { visitor.visitConstantValue(it.value) } - isInstanceType?.let { visitor.visitIsInstanceType(it.flags)?.let(it::accept) } - andArguments.forEach { visitor.visitAndArgument()?.let(it::accept) } - orArguments.forEach { visitor.visitOrArgument()?.let(it::accept) } - visitor.visitEnd() } } @@ -936,71 +118,8 @@ sealed class KmClassifier { * @property name the name of the class */ data class Class(val name: ClassName) : KmClassifier() - - /** - * Represents a type parameter used as a classifier in a type. - * - * @property id id of the type parameter - */ - data class TypeParameter(val id: Int) : KmClassifier() - - /** - * Represents a type alias used as a classifier in a type. Note that all types are expanded for metadata produced - * by the Kotlin compiler, so the type with a type alias classifier may only appear in [KmType.abbreviatedType]. - * - * @property name the name of the type alias - */ - data class TypeAlias(val name: ClassName) : KmClassifier() -} - -/** - * Represents type projection used in a type argument of the type based on a class or on a type alias. - * For example, in `MutableMap`, `in String?` is the type projection which is the first type argument of the type. - * - * @property variance the variance of the type projection, or `null` if this is a star projection - * @property type the projected type, or `null` if this is a star projection - */ -data class KmTypeProjection(var variance: KmVariance?, var type: KmType?) { - companion object { - /** - * Star projection (`*`). - * For example, in `MutableMap`, `*` is the star projection which is the second type argument of the type. - */ - @JvmField - val STAR = KmTypeProjection(null, null) - } -} - -/** - * Represents an upper bound of a flexible Kotlin type. - * - * @property type upper bound of the flexible type - * @property typeFlexibilityId id of the kind of flexibility this type has. For example, "kotlin.jvm.PlatformType" for JVM platform types, - * or "kotlin.DynamicType" for JS dynamic type - */ -data class KmFlexibleTypeUpperBound(var type: KmType, var typeFlexibilityId: String?) - -/** - * Represents a version used in a version requirement. - * - * @property major the major component of the version (e.g. "1" in "1.2.3") - * @property minor the minor component of the version (e.g. "2" in "1.2.3") - * @property patch the patch component of the version (e.g. "3" in "1.2.3") - */ -data class KmVersion(val major: Int, val minor: Int, val patch: Int) { - override fun toString(): String = "$major.$minor.$patch" } -/** - * Represents a constant value used in an effect expression. - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - * - * @property value the constant value. May be `true`, `false` or `null` - */ -data class KmConstantValue(val value: Any?) - internal fun T.addTo(collection: MutableCollection): T { collection.add(this) return this diff --git a/retrofit/src/main/java/kotlinx/metadata/visitors.kt b/retrofit/src/main/java/kotlinx/metadata/visitors.kt index 2863b893a6..b07c810d5b 100644 --- a/retrofit/src/main/java/kotlinx/metadata/visitors.kt +++ b/retrofit/src/main/java/kotlinx/metadata/visitors.kt @@ -5,291 +5,22 @@ package kotlinx.metadata -/** - * A visitor containing the common code to visit Kotlin declaration containers, such as classes and package fragments. - */ -abstract class KmDeclarationContainerVisitor @JvmOverloads constructor(protected open val delegate: KmDeclarationContainerVisitor? = null) { - /** - * Visits a function in the container. - * - * @param flags function flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Function] flags - * @param name the name of the function - */ - open fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? = - delegate?.visitFunction(flags, name) - - /** - * Visits a property in the container. - * - * @param flags property flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Property] flags - * @param name the name of the property - * @param getterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag - * and [Flag.PropertyAccessor] flags - * @param setterFlags property accessor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag - * and [Flag.PropertyAccessor] flags - */ - open fun visitProperty(flags: Flags, name: String, getterFlags: Flags, setterFlags: Flags): KmPropertyVisitor? = - delegate?.visitProperty(flags, name, getterFlags, setterFlags) - - /** - * Visits a type alias in the container. - * - * @param flags type alias flags, consisting of [Flag.HAS_ANNOTATIONS] and visibility flag - * @param name the name of the type alias - */ - open fun visitTypeAlias(flags: Flags, name: String): KmTypeAliasVisitor? = - delegate?.visitTypeAlias(flags, name) - - /** - * Visits the extensions of the given type on the container. - * - * @param type the type of extension visitor to be returned - */ - abstract fun visitExtensions(type: KmExtensionType): KmDeclarationContainerExtensionVisitor? -} - /** * A visitor to visit Kotlin classes, including interfaces, objects, enum classes and annotation classes. * * When using this class, [visit] must be called first, followed by zero or more [visitTypeParameter] calls, followed by zero or more calls * to other visit* methods, followed by [visitEnd]. */ -abstract class KmClassVisitor @JvmOverloads constructor(delegate: KmClassVisitor? = null) : KmDeclarationContainerVisitor(delegate) { - override val delegate: KmClassVisitor? - get() = super.delegate as KmClassVisitor? - - /** - * Visits the basic information about the class. - * - * @param flags class flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Class] flags - * @param name the name of the class - */ - open fun visit(flags: Flags, name: ClassName) { - delegate?.visit(flags, name) - } - - /** - * Visits a type parameter of the class. - * - * @param flags type parameter flags, consisting of [Flag.TypeParameter] flags - * @param name the name of the type parameter - * @param id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where - * the name isn't enough (e.g. `class A { fun foo(t: T) }`) - * @param variance the declaration-site variance of the type parameter - */ - open fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = - delegate?.visitTypeParameter(flags, name, id, variance) - - /** - * Visits a supertype of the class. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitSupertype(flags: Flags): KmTypeVisitor? = - delegate?.visitSupertype(flags) - - /** - * Visits a constructor of the class. - * - * @param flags constructor flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag and [Flag.Constructor] flags - */ - open fun visitConstructor(flags: Flags): KmConstructorVisitor? = - delegate?.visitConstructor(flags) - - /** - * Visits the name of the companion object of this class, if it has one. - * - * @param name the name of the companion object - */ - open fun visitCompanionObject(name: String) { - delegate?.visitCompanionObject(name) - } - - /** - * Visits the name of a nested class of this class. - * - * @param name the name of a nested class - */ - open fun visitNestedClass(name: String) { - delegate?.visitNestedClass(name) - } - - /** - * Visits the name of an enum entry, if this class is an enum class. - * - * @param name the name of an enum entry - */ - open fun visitEnumEntry(name: String) { - delegate?.visitEnumEntry(name) - } - - /** - * Visits the name of a direct subclass of this class, if this class is `sealed`. - * - * @param name the name of a direct subclass - */ - open fun visitSealedSubclass(name: ClassName) { - delegate?.visitSealedSubclass(name) - } - - /** - * Visits the name of the underlying property, if this class is `inline`. - * - * @param name the name of the underlying property. - */ - open fun visitInlineClassUnderlyingPropertyName(name: String) { - delegate?.visitInlineClassUnderlyingPropertyName(name) - } - - /** - * Visits the type of the underlying property, if this class is `inline`. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitInlineClassUnderlyingType(flags: Flags): KmTypeVisitor? = - delegate?.visitInlineClassUnderlyingType(flags) - - /** - * Visits the version requirement on this class. - */ - open fun visitVersionRequirement(): KmVersionRequirementVisitor? = - delegate?.visitVersionRequirement() - - /** - * Visits the extensions of the given type on the class. - * - * @param type the type of extension visitor to be returned - */ - override fun visitExtensions(type: KmExtensionType): KmClassExtensionVisitor? = - delegate?.visitExtensions(type) - - /** - * Visits the end of the class. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit Kotlin package fragments, including single file facades and multi-file class parts. - * - * When using this class, [visitEnd] must be called exactly once and after calls to all other visit* methods. - */ -abstract class KmPackageVisitor @JvmOverloads constructor(delegate: KmPackageVisitor? = null) : KmDeclarationContainerVisitor(delegate) { - override val delegate: KmPackageVisitor? - get() = super.delegate as KmPackageVisitor? - - /** - * Visits the extensions of the given type on the package fragment. - * - * @param type the type of extension visitor to be returned - */ - override fun visitExtensions(type: KmExtensionType): KmPackageExtensionVisitor? = - delegate?.visitExtensions(type) - - /** - * Visits the end of the package fragment. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit module fragments. The module fragment can have no more than one package, and any number of classes, - * and must have at least one declaration. - * - * When using this class, [visitEnd] must be called exactly once and after calls to all other visit* methods. - */ -abstract class KmModuleFragmentVisitor @JvmOverloads constructor(private val delegate: KmModuleFragmentVisitor? = null) { - - /** - * Visits a package within the module fragment. - */ - open fun visitPackage(): KmPackageVisitor? = - delegate?.visitPackage() - - /** - * Visits a class within the module fragment. - */ - open fun visitClass(): KmClassVisitor? = - delegate?.visitClass() - - /** - * Visits the extensions of the given type on the module fragment. - * - * @param type the type of extension visitor to be returned. - */ - open fun visitExtensions(type: KmExtensionType): KmModuleFragmentExtensionVisitor? = - delegate?.visitExtensions(type) +abstract class KmClassVisitor @JvmOverloads constructor(private val delegate: KmClassVisitor? = null) { /** - * Visits the end of the module fragment. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit the metadata of a synthetic class generated for a Kotlin lambda. - * - * When using this class, [visitFunction] must be called first, followed by [visitEnd]. - */ -abstract class KmLambdaVisitor @JvmOverloads constructor(private val delegate: KmLambdaVisitor? = null) { - /** - * Visits the signature of a synthetic anonymous function, representing the lambda. + * Visits a function in the container. * * @param flags function flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Function] flags - * @param name the name of the function (usually `""` or `""` for lambdas emitted by the Kotlin compiler) + * @param name the name of the function */ open fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? = delegate?.visitFunction(flags, name) - - /** - * Visits the end of the lambda. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit a constructor of a Kotlin class. - * - * When using this class, [visitEnd] must be called exactly once and after calls to all other visit* methods. - */ -abstract class KmConstructorVisitor @JvmOverloads constructor(private val delegate: KmConstructorVisitor? = null) { - /** - * Visits a value parameter of the constructor. - * - * @param flags value parameter flags, consisting of [Flag.ValueParameter] flags - * @param name the name of the value parameter - */ - open fun visitValueParameter(flags: Flags, name: String): KmValueParameterVisitor? = - delegate?.visitValueParameter(flags, name) - - /** - * Visits the version requirement on this constructor. - */ - open fun visitVersionRequirement(): KmVersionRequirementVisitor? = - delegate?.visitVersionRequirement() - - /** - * Visits the extensions of the given type on the constructor. - * - * @param type the type of extension visitor to be returned - */ - open fun visitExtensions(type: KmExtensionType): KmConstructorExtensionVisitor? = - delegate?.visitExtensions(type) - - /** - * Visits the end of the constructor. - */ - open fun visitEnd() { - delegate?.visitEnd() - } } /** @@ -299,34 +30,6 @@ abstract class KmConstructorVisitor @JvmOverloads constructor(private val delega * to other visit* methods, followed by [visitEnd]. */ abstract class KmFunctionVisitor @JvmOverloads constructor(private val delegate: KmFunctionVisitor? = null) { - /** - * Visits a type parameter of the function. - * - * @param flags type parameter flags, consisting of [Flag.TypeParameter] flags - * @param name the name of the type parameter - * @param id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where - * the name isn't enough (e.g. `class A { fun foo(t: T) }`) - * @param variance the declaration-site variance of the type parameter - */ - open fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = - delegate?.visitTypeParameter(flags, name, id, variance) - - /** - * Visits the type of the receiver of the function, if this is an extension function. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitReceiverParameterType(flags: Flags): KmTypeVisitor? = - delegate?.visitReceiverParameterType(flags) - - /** - * Visits a value parameter of the function. - * - * @param flags value parameter flags, consisting of [Flag.ValueParameter] flags - * @param name the name of the value parameter - */ - open fun visitValueParameter(flags: Flags, name: String): KmValueParameterVisitor? = - delegate?.visitValueParameter(flags, name) /** * Visits the return type of the function. @@ -336,18 +39,6 @@ abstract class KmFunctionVisitor @JvmOverloads constructor(private val delegate: open fun visitReturnType(flags: Flags): KmTypeVisitor? = delegate?.visitReturnType(flags) - /** - * Visits the version requirement on this function. - */ - open fun visitVersionRequirement(): KmVersionRequirementVisitor? = - delegate?.visitVersionRequirement() - - /** - * Visits the contract of the function. - */ - open fun visitContract(): KmContractVisitor? = - delegate?.visitContract() - /** * Visits the extensions of the given type on the function. * @@ -355,215 +46,6 @@ abstract class KmFunctionVisitor @JvmOverloads constructor(private val delegate: */ open fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor? = delegate?.visitExtensions(type) - - /** - * Visits the end of the function. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit a Kotlin property declaration. - * - * When using this class, zero or more calls to [visitTypeParameter] must be done first, followed by zero or more calls - * to other visit* methods, followed by [visitEnd]. - */ -abstract class KmPropertyVisitor @JvmOverloads constructor(private val delegate: KmPropertyVisitor? = null) { - /** - * Visits a type parameter of the property. - * - * @param flags type parameter flags, consisting of [Flag.TypeParameter] flags - * @param name the name of the type parameter - * @param id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where - * the name isn't enough (e.g. `class A { fun foo(t: T) }`) - * @param variance the declaration-site variance of the type parameter - */ - open fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = - delegate?.visitTypeParameter(flags, name, id, variance) - - /** - * Visits the type of the receiver of the property, if this is an extension property. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitReceiverParameterType(flags: Flags): KmTypeVisitor? = - delegate?.visitReceiverParameterType(flags) - - /** - * Visits a value parameter of the setter of this property, if this is a `var` property. - * - * @param flags value parameter flags, consisting of [Flag.ValueParameter] flags - * @param name the name of the value parameter (`""` for properties emitted by the Kotlin compiler) - */ - open fun visitSetterParameter(flags: Flags, name: String): KmValueParameterVisitor? = - delegate?.visitSetterParameter(flags, name) - - /** - * Visits the type of the property. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitReturnType(flags: Flags): KmTypeVisitor? = - delegate?.visitReturnType(flags) - - /** - * Visits the version requirement on this property. - */ - open fun visitVersionRequirement(): KmVersionRequirementVisitor? = - delegate?.visitVersionRequirement() - - /** - * Visits the extensions of the given type on the property. - * - * @param type the type of extension visitor to be returned - */ - open fun visitExtensions(type: KmExtensionType): KmPropertyExtensionVisitor? = - delegate?.visitExtensions(type) - - /** - * Visits the end of the property. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit a Kotlin type alias declaration. - * - * When using this class, zero or more calls to [visitTypeParameter] must be done first, followed by zero or more calls - * to other visit* methods, followed by [visitEnd]. - */ -abstract class KmTypeAliasVisitor @JvmOverloads constructor(private val delegate: KmTypeAliasVisitor? = null) { - /** - * Visits a type parameter of the type alias. - * - * @param flags type parameter flags, consisting of [Flag.TypeParameter] flags - * @param name the name of the type parameter - * @param id the id of the type parameter, useful to be able to uniquely identify the type parameter in different contexts where - * the name isn't enough (e.g. `class A { fun foo(t: T) }`) - * @param variance the declaration-site variance of the type parameter - */ - open fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = - delegate?.visitTypeParameter(flags, name, id, variance) - - /** - * Visits the underlying type of the type alias, i.e. the type in the right-hand side of the type alias declaration. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitUnderlyingType(flags: Flags): KmTypeVisitor? = - delegate?.visitUnderlyingType(flags) - - /** - * Visits the expanded type of the type alias, i.e. the full expansion of the underlying type, where all type aliases are substituted - * with their expanded types. If no type aliases are used in the underlying type, expanded type is equal to the underlying type. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitExpandedType(flags: Flags): KmTypeVisitor? = - delegate?.visitExpandedType(flags) - - /** - * Visits the annotation on the type alias. - * - * @param annotation annotation on the type alias - */ - open fun visitAnnotation(annotation: KmAnnotation) { - delegate?.visitAnnotation(annotation) - } - - /** - * Visits the version requirement on this type alias. - */ - open fun visitVersionRequirement(): KmVersionRequirementVisitor? = - delegate?.visitVersionRequirement() - - /** - * Visits the extensions of the given type on the type alias. - * - * @param type the type of extension visitor to be returned - */ - open fun visitExtensions(type: KmExtensionType): KmTypeAliasExtensionVisitor? = - delegate?.visitExtensions(type) - - /** - * Visits the end of the type alias. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit a value parameter of a Kotlin constructor, function or property setter. - * - * When using this class, either [visitType] or [visitVarargElementType] must be called first (depending on whether the value parameter - * is `vararg` or not), followed by [visitEnd]. - */ -abstract class KmValueParameterVisitor @JvmOverloads constructor(private val delegate: KmValueParameterVisitor? = null) { - /** - * Visits the type of the value parameter, if this is **not** a `vararg` parameter. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitType(flags: Flags): KmTypeVisitor? = - delegate?.visitType(flags) - - /** - * Visits the type of the value parameter, if this is a `vararg` parameter. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitVarargElementType(flags: Flags): KmTypeVisitor? = - delegate?.visitVarargElementType(flags) - - /** - * Visits the extensions of the given type on the value parameter. - * - * @param type the type of extension visitor to be returned - */ - open fun visitExtensions(type: KmExtensionType): KmValueParameterExtensionVisitor? = - delegate?.visitExtensions(type) - - /** - * Visits the end of the value parameter. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit a type parameter of a Kotlin class, function, property or type alias. - * - * When using this class, zero or more [visitUpperBound] calls must be done first, followed by [visitEnd]. - */ -abstract class KmTypeParameterVisitor @JvmOverloads constructor(private val delegate: KmTypeParameterVisitor? = null) { - /** - * Visits the upper bound of the type parameter. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitUpperBound(flags: Flags): KmTypeVisitor? = - delegate?.visitUpperBound(flags) - - /** - * Visits the extensions of the given type on the type parameter. - * - * @param type the type of extension visitor to be returned - */ - open fun visitExtensions(type: KmExtensionType): KmTypeParameterExtensionVisitor? = - delegate?.visitExtensions(type) - - /** - * Visits the end of the type parameter. - */ - open fun visitEnd() { - delegate?.visitEnd() - } } /** @@ -586,318 +68,4 @@ abstract class KmTypeVisitor @JvmOverloads constructor(private val delegate: KmT open fun visitClass(name: ClassName) { delegate?.visitClass(name) } - - /** - * Visits the name of the type alias, if this type's classifier is a type alias. Note that all types are expanded for metadata produced - * by the Kotlin compiler, so the type with a type alias classifier may only appear in a call to [visitAbbreviatedType]. - * - * @param name the name of the type alias - */ - open fun visitTypeAlias(name: ClassName) { - delegate?.visitTypeAlias(name) - } - - /** - * Visits the id of the type parameter, if this type's classifier is a type parameter. - * - * @param id id of the type parameter - */ - open fun visitTypeParameter(id: Int) { - delegate?.visitTypeParameter(id) - } - - /** - * Visits the type projection used in a type argument of the type based on a class or on a type alias. - * For example, in `MutableMap`, `in String?` is the type projection which is the first type argument of the type. - * - * @param flags type flags, consisting of [Flag.Type] flags - * @param variance the variance of the type projection - */ - open fun visitArgument(flags: Flags, variance: KmVariance): KmTypeVisitor? = - delegate?.visitArgument(flags, variance) - - /** - * Visits the star (`*`) projection used in a type argument of the type based on a class or on a type alias. - * For example, in `MutableMap`, `*` is the star projection which is the second type argument of the type. - */ - open fun visitStarProjection() { - delegate?.visitStarProjection() - } - - /** - * Visits the abbreviation of this type. Note that all types are expanded for metadata produced by the Kotlin compiler. For example: - * - * typealias A = MutableList - * - * fun foo(a: A) {} - * - * The type of the `foo`'s parameter in the metadata is actually `MutableList`, and its abbreviation is `A`. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitAbbreviatedType(flags: Flags): KmTypeVisitor? = - delegate?.visitAbbreviatedType(flags) - - /** - * Visits the outer type, if this type's classifier is an inner class. For example: - * - * class A { inner class B } - * - * fun foo(a: A<*>.B) {} - * - * The type of the `foo`'s parameter in the metadata is `B` (a type whose classifier is class `B`, and it has one type argument, - * type `Byte?`), and its outer type is `A<*>` (a type whose classifier is class `A`, and it has one type argument, star projection). - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitOuterType(flags: Flags): KmTypeVisitor? = - delegate?.visitOuterType(flags) - - /** - * Visits the upper bound of the type, marking it as flexible and its contents as the lower bound. Flexible types in Kotlin include - * platform types in Kotlin/JVM and `dynamic` type in Kotlin/JS. - * - * @param flags type flags, consisting of [Flag.Type] flags - * @param typeFlexibilityId id of the kind of flexibility this type has. For example, "kotlin.jvm.PlatformType" for JVM platform types, - * or "kotlin.DynamicType" for JS dynamic type - */ - open fun visitFlexibleTypeUpperBound(flags: Flags, typeFlexibilityId: String?): KmTypeVisitor? = - delegate?.visitFlexibleTypeUpperBound(flags, typeFlexibilityId) - - /** - * Visits the extensions of the given type on the type. - * - * @param type the type of extension visitor to be returned - */ - open fun visitExtensions(type: KmExtensionType): KmTypeExtensionVisitor? = - delegate?.visitExtensions(type) - - /** - * Visits the end of the type. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit the contents of a version requirement on a Kotlin declaration. - * - * Version requirement is an internal feature of the Kotlin compiler and the standard Kotlin library, - * enabled for example with the internal [kotlin.internal.RequireKotlin] annotation. - * - * When using this class, [visit] must be called first, followed by [visitVersion], followed by [visitEnd]. - */ -abstract class KmVersionRequirementVisitor @JvmOverloads constructor(private val delegate: KmVersionRequirementVisitor? = null) { - /** - * Visits the description of this version requirement. - * - * @param kind the kind of the version that this declaration requires: compiler, language or API version - * @param level the level of the diagnostic that must be reported on the usages of the declaration in case - * the version requirement is not satisfied - * @param errorCode optional error code to be displayed in the diagnostic - * @param message optional message to be displayed in the diagnostic - */ - open fun visit(kind: KmVersionRequirementVersionKind, level: KmVersionRequirementLevel, errorCode: Int?, message: String?) { - delegate?.visit(kind, level, errorCode, message) - } - - /** - * Visits the version required by this requirement. - * - * @param major the major component of the version (e.g. "1" in "1.2.3") - * @param minor the minor component of the version (e.g. "2" in "1.2.3") - * @param patch the patch component of the version (e.g. "3" in "1.2.3") - */ - open fun visitVersion(major: Int, minor: Int, patch: Int) { - delegate?.visitVersion(major, minor, patch) - } - - /** - * Visits the end of the version requirement. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit the contents of the contract of a Kotlin function. - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - * - * When using this class, zero or more calls to [visitEffect] must be done first, followed by [visitEnd]. - */ -abstract class KmContractVisitor @JvmOverloads constructor(private val delegate: KmContractVisitor? = null) { - /** - * Visits an effect of this contract. - * - * @param type type of the effect - * @param invocationKind optional number of invocations of the lambda parameter of this function, - * specified further in the effect expression - */ - open fun visitEffect(type: KmEffectType, invocationKind: KmEffectInvocationKind?): KmEffectVisitor? = - delegate?.visitEffect(type, invocationKind) - - /** - * Visits the end of the contract. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit an effect (a part of the contract of a Kotlin function). - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - * - * When using this class, zero or more calls to [visitConstructorArgument] or [visitConclusionOfConditionalEffect] must be done first, - * followed by [visitEnd]. - */ -abstract class KmEffectVisitor @JvmOverloads constructor(private val delegate: KmEffectVisitor? = null) { - /** - * Visits the optional argument of the effect constructor, i.e. the constant value for the [KmEffectType.RETURNS_CONSTANT] effect, - * or the parameter reference for the [KmEffectType.CALLS] effect. - */ - open fun visitConstructorArgument(): KmEffectExpressionVisitor? = - delegate?.visitConstructorArgument() - - /** - * Visits the optional conclusion of the effect. If this method is called, the effect represents an implication with the - * right-hand side handled by the returned visitor. - */ - open fun visitConclusionOfConditionalEffect(): KmEffectExpressionVisitor? = - delegate?.visitConclusionOfConditionalEffect() - - /** - * Visits the end of the effect. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * A visitor to visit the effect expression, the contents of an effect (a part of the contract of a Kotlin function). - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - * - * When using this class, [visit] must be called first, followed by zero or more calls to other visit* methods, followed by [visitEnd]. - */ -abstract class KmEffectExpressionVisitor @JvmOverloads constructor(private val delegate: KmEffectExpressionVisitor? = null) { - /** - * Visits the basic information of the effect expression. - * - * @param flags effect expression flags, consisting of [Flag.EffectExpression] flags - * @param parameterIndex optional 1-based index of the value parameter of the function, for effects which assert something about - * the function parameters. The index 0 means the extension receiver parameter - */ - open fun visit(flags: Flags, parameterIndex: Int?) { - delegate?.visit(flags, parameterIndex) - } - - /** - * Visits the constant value used in the effect expression. May be `true`, `false` or `null`. - * - * @param value the constant value - */ - open fun visitConstantValue(value: Any?) { - delegate?.visitConstantValue(value) - } - - /** - * Visits the type used as the target of an `is`-expression in the effect expression. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitIsInstanceType(flags: Flags): KmTypeVisitor? = - delegate?.visitIsInstanceType(flags) - - /** - * Visits the argument of an `&&`-expression. If this method is called, the expression represents the left-hand side and - * the returned visitor handles the right-hand side. - */ - open fun visitAndArgument(): KmEffectExpressionVisitor? = - delegate?.visitAndArgument() - - /** - * Visits the argument of an `||`-expression. If this method is called, the expression represents the left-hand side and - * the returned visitor handles the right-hand side. - */ - open fun visitOrArgument(): KmEffectExpressionVisitor? = - delegate?.visitOrArgument() - - /** - * Visits the end of the effect expression. - */ - open fun visitEnd() { - delegate?.visitEnd() - } -} - -/** - * Variance applied to a type parameter on the declaration site (*declaration-site variance*), - * or to a type in a projection (*use-site variance*). - */ -enum class KmVariance { - /** - * The affected type parameter or type is *invariant*, which means it has no variance applied to it. - */ - INVARIANT, - - /** - * The affected type parameter or type is *contravariant*. Denoted by the `in` modifier in the source code. - */ - IN, - - /** - * The affected type parameter or type is *covariant*. Denoted by the `out` modifier in the source code. - */ - OUT, -} - -/** - * Type of an effect (a part of the contract of a Kotlin function). - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - */ -enum class KmEffectType { - RETURNS_CONSTANT, - CALLS, - RETURNS_NOT_NULL, -} - -/** - * Number of invocations of a lambda parameter specified by an effect (a part of the contract of a Kotlin function). - * - * Contracts are an internal feature of the standard Kotlin library, and their behavior and/or binary format - * may change in a subsequent release. - */ -enum class KmEffectInvocationKind { - AT_MOST_ONCE, - EXACTLY_ONCE, - AT_LEAST_ONCE, -} - -/** - * Severity of the diagnostic reported by the compiler when a version requirement is not satisfied. - */ -enum class KmVersionRequirementLevel { - WARNING, - ERROR, - HIDDEN, -} - -/** - * The kind of the version that is required by a version requirement. - */ -enum class KmVersionRequirementVersionKind { - LANGUAGE_VERSION, - COMPILER_VERSION, - API_VERSION, } diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/Interner.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/Interner.kt deleted file mode 100644 index cc8faf86b6..0000000000 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/Interner.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.metadata.serialization - -class Interner(private val parent: Interner? = null) { - private val firstIndex: Int = parent?.run { interned.size + firstIndex } ?: 0 - private val interned = hashMapOf() - - val allInternedObjects: List - get() = interned.keys.sortedBy(interned::get) - - val isEmpty: Boolean - get() = interned.isEmpty() && parent?.isEmpty != false - - private fun find(obj: T): Int? { - assert(parent == null || parent.interned.size + parent.firstIndex == firstIndex) { - "Parent changed in parallel with child: indexes will be wrong" - } - return parent?.find(obj) ?: interned[obj] - } - - fun intern(obj: T): Int = - find(obj) ?: (firstIndex + interned.size).also { - interned[obj] = it - } -} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/MutableTable.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/MutableTable.kt deleted file mode 100644 index f2ac8becd0..0000000000 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/MutableTable.kt +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:Suppress("FINITE_BOUNDS_VIOLATION_IN_JAVA") - -package org.jetbrains.kotlin.metadata.serialization - -import com.google.protobuf.GeneratedMessageLite -import org.jetbrains.kotlin.metadata.ProtoBuf - -private class TableElementWrapper>(val builder: Element) { - // If you'll try to optimize it using structured equals/hashCode, pay attention to extensions present in proto messages - private val bytes: ByteArray = builder.build().toByteArray() - private val hashCode: Int = bytes.contentHashCode() - - override fun hashCode() = hashCode - - override fun equals(other: Any?) = other is TableElementWrapper<*> && bytes.contentEquals(other.bytes) -} - -abstract class MutableTable - where Element : GeneratedMessageLite.Builder<*, Element>, - Table : GeneratedMessageLite, - TableBuilder : GeneratedMessageLite.Builder { - - private val interner = Interner>() - - protected abstract fun createTableBuilder(): TableBuilder - - protected abstract fun addElement(builder: TableBuilder, element: Element) - - operator fun get(type: Element): Int = - interner.intern(TableElementWrapper(type)) - - @Suppress("UNCHECKED_CAST") - fun serialize(): Table? = - if (interner.isEmpty) null - else createTableBuilder().apply { - for (obj in interner.allInternedObjects) { - addElement(this, obj.builder) - } - }.build() as Table -} - -class MutableTypeTable : MutableTable() { - override fun createTableBuilder(): ProtoBuf.TypeTable.Builder = ProtoBuf.TypeTable.newBuilder() - - override fun addElement(builder: ProtoBuf.TypeTable.Builder, element: ProtoBuf.Type.Builder) { - builder.addType(element) - } -} - -class MutableVersionRequirementTable : - MutableTable() { - override fun createTableBuilder(): ProtoBuf.VersionRequirementTable.Builder = ProtoBuf.VersionRequirementTable.newBuilder() - - override fun addElement(builder: ProtoBuf.VersionRequirementTable.Builder, element: ProtoBuf.VersionRequirement.Builder) { - builder.addRequirement(element) - } -} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/StringTable.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/StringTable.kt deleted file mode 100644 index 26abfdded3..0000000000 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata.serialization/StringTable.kt +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.metadata.serialization - -interface StringTable { - fun getStringIndex(string: String): Int - - /** - * @param className the fully qualified name of some class in the format: `org/foo/bar/Test.Inner` - */ - fun getQualifiedClassNameIndex(className: String, isLocal: Boolean): Int -} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java index 7527b5e982..329ba88bfb 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java @@ -5,275 +5,6 @@ public final class ProtoBuf { private ProtoBuf() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.Modality} - */ - public enum Modality - implements com.google.protobuf.Internal.EnumLite { - /** - * FINAL = 0; - * - *
-     * 2 bits
-     * 
- */ - FINAL(0, 0), - /** - * OPEN = 1; - */ - OPEN(1, 1), - /** - * ABSTRACT = 2; - */ - ABSTRACT(2, 2), - /** - * SEALED = 3; - */ - SEALED(3, 3), - ; - - /** - * FINAL = 0; - * - *
-     * 2 bits
-     * 
- */ - public static final int FINAL_VALUE = 0; - /** - * OPEN = 1; - */ - public static final int OPEN_VALUE = 1; - /** - * ABSTRACT = 2; - */ - public static final int ABSTRACT_VALUE = 2; - /** - * SEALED = 3; - */ - public static final int SEALED_VALUE = 3; - - - @Override public final int getNumber() { return value; } - - public static Modality valueOf(int value) { - switch (value) { - case 0: return FINAL; - case 1: return OPEN; - case 2: return ABSTRACT; - case 3: return SEALED; - 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() { - @Override public Modality findValueByNumber(int number) { - return Modality.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Modality(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Modality) - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.Visibility} - */ - public enum Visibility - implements com.google.protobuf.Internal.EnumLite { - /** - * INTERNAL = 0; - * - *
-     * 3 bits
-     * 
- */ - INTERNAL(0, 0), - /** - * PRIVATE = 1; - */ - PRIVATE(1, 1), - /** - * PROTECTED = 2; - */ - PROTECTED(2, 2), - /** - * PUBLIC = 3; - */ - PUBLIC(3, 3), - /** - * PRIVATE_TO_THIS = 4; - */ - PRIVATE_TO_THIS(4, 4), - /** - * LOCAL = 5; - */ - LOCAL(5, 5), - ; - - /** - * INTERNAL = 0; - * - *
-     * 3 bits
-     * 
- */ - public static final int INTERNAL_VALUE = 0; - /** - * PRIVATE = 1; - */ - public static final int PRIVATE_VALUE = 1; - /** - * PROTECTED = 2; - */ - public static final int PROTECTED_VALUE = 2; - /** - * PUBLIC = 3; - */ - public static final int PUBLIC_VALUE = 3; - /** - * PRIVATE_TO_THIS = 4; - */ - public static final int PRIVATE_TO_THIS_VALUE = 4; - /** - * LOCAL = 5; - */ - public static final int LOCAL_VALUE = 5; - - - @Override public final int getNumber() { return value; } - - public static Visibility valueOf(int value) { - switch (value) { - case 0: return INTERNAL; - case 1: return PRIVATE; - case 2: return PROTECTED; - case 3: return PUBLIC; - case 4: return PRIVATE_TO_THIS; - case 5: return LOCAL; - 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() { - @Override public Visibility findValueByNumber(int number) { - return Visibility.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Visibility(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Visibility) - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.MemberKind} - */ - public enum MemberKind - implements com.google.protobuf.Internal.EnumLite { - /** - * DECLARATION = 0; - * - *
-     * 2 bits
-     * 
- */ - DECLARATION(0, 0), - /** - * FAKE_OVERRIDE = 1; - */ - FAKE_OVERRIDE(1, 1), - /** - * DELEGATION = 2; - */ - DELEGATION(2, 2), - /** - * SYNTHESIZED = 3; - */ - SYNTHESIZED(3, 3), - ; - - /** - * DECLARATION = 0; - * - *
-     * 2 bits
-     * 
- */ - public static final int DECLARATION_VALUE = 0; - /** - * FAKE_OVERRIDE = 1; - */ - public static final int FAKE_OVERRIDE_VALUE = 1; - /** - * DELEGATION = 2; - */ - public static final int DELEGATION_VALUE = 2; - /** - * SYNTHESIZED = 3; - */ - public static final int SYNTHESIZED_VALUE = 3; - - - @Override public final int getNumber() { return value; } - - public static MemberKind valueOf(int value) { - switch (value) { - case 0: return DECLARATION; - case 1: return FAKE_OVERRIDE; - case 2: return DELEGATION; - case 3: return SYNTHESIZED; - 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() { - @Override public MemberKind findValueByNumber(int number) { - return MemberKind.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private MemberKind(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.MemberKind) - } public interface StringTableOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.StringTable) @@ -1862,7 +1593,7 @@ public interface AnnotationOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - java.util.List + java.util.List getArgumentList(); /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; @@ -2195,7 +1926,7 @@ public interface ValueOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - java.util.List + java.util.List getArrayElementList(); /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; @@ -2724,7 +2455,7 @@ private Type(int index, int value) { /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - public java.util.List + public java.util.List getArrayElementOrBuilderList() { return arrayElement_; } @@ -3156,7 +2887,7 @@ private static Builder create() { ensureArrayElementIsMutable(); arrayElement_.addAll(other.arrayElement_); } - + } if (other.hasArrayDimensionCount()) { setArrayDimensionCount(other.getArrayDimensionCount()); @@ -3172,13 +2903,13 @@ private static Builder create() { @Override public final boolean isInitialized() { if (hasAnnotation()) { if (!getAnnotation().isInitialized()) { - + return false; } } for (int i = 0; i < getArrayElementCount(); i++) { if (!getArrayElement(i).isInitialized()) { - + return false; } } @@ -3244,7 +2975,7 @@ public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argumen } bitField0_ |= 0x00000001; type_ = value; - + return this; } /** @@ -3259,7 +2990,7 @@ public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argumen public Builder clearType() { bitField0_ = (bitField0_ & ~0x00000001); type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; - + return this; } @@ -3282,7 +3013,7 @@ public Builder clearType() { public Builder setIntValue(long value) { bitField0_ |= 0x00000002; intValue_ = value; - + return this; } /** @@ -3291,7 +3022,7 @@ public Builder setIntValue(long value) { public Builder clearIntValue() { bitField0_ = (bitField0_ & ~0x00000002); intValue_ = 0L; - + return this; } @@ -3314,7 +3045,7 @@ public Builder clearIntValue() { public Builder setFloatValue(float value) { bitField0_ |= 0x00000004; floatValue_ = value; - + return this; } /** @@ -3323,7 +3054,7 @@ public Builder setFloatValue(float value) { public Builder clearFloatValue() { bitField0_ = (bitField0_ & ~0x00000004); floatValue_ = 0F; - + return this; } @@ -3346,7 +3077,7 @@ public Builder clearFloatValue() { public Builder setDoubleValue(double value) { bitField0_ |= 0x00000008; doubleValue_ = value; - + return this; } /** @@ -3355,7 +3086,7 @@ public Builder setDoubleValue(double value) { public Builder clearDoubleValue() { bitField0_ = (bitField0_ & ~0x00000008); doubleValue_ = 0D; - + return this; } @@ -3378,7 +3109,7 @@ public Builder clearDoubleValue() { public Builder setStringValue(int value) { bitField0_ |= 0x00000010; stringValue_ = value; - + return this; } /** @@ -3387,7 +3118,7 @@ public Builder setStringValue(int value) { public Builder clearStringValue() { bitField0_ = (bitField0_ & ~0x00000010); stringValue_ = 0; - + return this; } @@ -3422,7 +3153,7 @@ public Builder clearStringValue() { public Builder setClassId(int value) { bitField0_ |= 0x00000020; classId_ = value; - + return this; } /** @@ -3435,7 +3166,7 @@ public Builder setClassId(int value) { public Builder clearClassId() { bitField0_ = (bitField0_ & ~0x00000020); classId_ = 0; - + return this; } @@ -3458,7 +3189,7 @@ public Builder clearClassId() { public Builder setEnumValueId(int value) { bitField0_ |= 0x00000040; enumValueId_ = value; - + return this; } /** @@ -3467,7 +3198,7 @@ public Builder setEnumValueId(int value) { public Builder clearEnumValueId() { bitField0_ = (bitField0_ & ~0x00000040); enumValueId_ = 0; - + return this; } @@ -3711,7 +3442,7 @@ public Builder removeArrayElement(int index) { public Builder setArrayDimensionCount(int value) { bitField0_ |= 0x00000200; arrayDimensionCount_ = value; - + return this; } /** @@ -3732,7 +3463,7 @@ public Builder setArrayDimensionCount(int value) { public Builder clearArrayDimensionCount() { bitField0_ = (bitField0_ & ~0x00000200); arrayDimensionCount_ = 0; - + return this; } @@ -3767,7 +3498,7 @@ public Builder clearArrayDimensionCount() { public Builder setFlags(int value) { bitField0_ |= 0x00000400; flags_ = value; - + return this; } /** @@ -3780,7 +3511,7 @@ public Builder setFlags(int value) { public Builder clearFlags() { bitField0_ = (bitField0_ & ~0x00000400); flags_ = 0; - + return this; } @@ -4026,15 +3757,15 @@ public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argum public final boolean isInitialized() { if (!hasNameId()) { - + return false; } if (!hasValue()) { - + return false; } if (!getValue().isInitialized()) { - + return false; } return true; @@ -4078,7 +3809,7 @@ public int getNameId() { public Builder setNameId(int value) { bitField0_ |= 0x00000001; nameId_ = value; - + return this; } /** @@ -4087,7 +3818,7 @@ public Builder setNameId(int value) { public Builder clearNameId() { bitField0_ = (bitField0_ & ~0x00000001); nameId_ = 0; - + return this; } @@ -4189,7 +3920,7 @@ public java.util.Listrepeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - public java.util.List + public java.util.List getArgumentOrBuilderList() { return argument_; } @@ -4410,7 +4141,7 @@ public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation other ensureArgumentIsMutable(); argument_.addAll(other.argument_); } - + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -4419,12 +4150,12 @@ public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation other public final boolean isInitialized() { if (!hasId()) { - + return false; } for (int i = 0; i < getArgumentCount(); i++) { if (!getArgument(i).isInitialized()) { - + return false; } } @@ -4469,7 +4200,7 @@ public int getId() { public Builder setId(int value) { bitField0_ |= 0x00000001; id_ = value; - + return this; } /** @@ -4478,7 +4209,7 @@ public Builder setId(int value) { public Builder clearId() { bitField0_ = (bitField0_ & ~0x00000001); id_ = 0; - + return this; } @@ -11790,98 +11521,69 @@ public Builder clearVersionRequirementTable() { // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Class) } - public interface PackageOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Package) - com.google.protobuf.GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; - */ - java.util.List - getFunctionList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; - */ - int getFunctionCount(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - java.util.List - getPropertyList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - int getPropertyCount(); + public interface TypeTableOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeTable) + com.google.protobuf.MessageLiteOrBuilder { /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - java.util.List - getTypeAliasList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - int getTypeAliasCount(); - + java.util.List + getTypeList(); /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - boolean hasTypeTable(); + org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index); /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable(); + int getTypeCount(); /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + * optional int32 first_nullable = 2 [default = -1]; + * + *
+     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * 
*/ - boolean hasVersionRequirementTable(); + boolean hasFirstNullable(); /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + * optional int32 first_nullable = 2 [default = -1]; + * + *
+     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * 
*/ - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable(); + int getFirstNullable(); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Package} + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} */ - public static final class Package extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< - Package> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Package) - PackageOrBuilder { - // Use Package.newBuilder() to construct. - private Package(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); + public static final class TypeTable extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeTable) + TypeTableOrBuilder { + // Use TypeTable.newBuilder() to construct. + private TypeTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Package(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private TypeTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - private static final Package defaultInstance; - public static Package getDefaultInstance() { + private static final TypeTable defaultInstance; + public static TypeTable getDefaultInstance() { return defaultInstance; } - public Package getDefaultInstanceForType() { + public TypeTable getDefaultInstanceForType() { return defaultInstance; } private final com.google.protobuf.ByteString unknownFields; - private Package( + private TypeTable( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -11907,54 +11609,17 @@ private Package( } break; } - case 26: { + case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - function_ = new java.util.ArrayList(); + type_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - function_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Function.PARSER, extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - property_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - property_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Property.PARSER, extensionRegistry)); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - typeAlias_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - typeAlias_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.PARSER, extensionRegistry)); + type_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); break; } - case 242: { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = typeTable_.toBuilder(); - } - typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(typeTable_); - typeTable_ = subBuilder.buildPartial(); - } + case 16: { bitField0_ |= 0x00000001; - break; - } - case 258: { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = versionRequirementTable_.toBuilder(); - } - versionRequirementTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(versionRequirementTable_); - versionRequirementTable_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; + firstNullable_ = input.readInt32(); break; } } @@ -11966,13 +11631,7 @@ private Package( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - function_ = java.util.Collections.unmodifiableList(function_); - } - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - property_ = java.util.Collections.unmodifiableList(property_); - } - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - typeAlias_ = java.util.Collections.unmodifiableList(typeAlias_); + type_ = java.util.Collections.unmodifiableList(type_); } try { unknownFieldsCodedOutput.flush(); @@ -11984,163 +11643,85 @@ private Package( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Package parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TypeTable parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Package(input, extensionRegistry); + return new TypeTable(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } private int bitField0_; - public static final int FUNCTION_FIELD_NUMBER = 3; - private java.util.List function_; - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; - */ - public java.util.List getFunctionList() { - return function_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; - */ - public java.util.List - getFunctionOrBuilderList() { - return function_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; - */ - public int getFunctionCount() { - return function_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index) { - return function_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.FunctionOrBuilder getFunctionOrBuilder( - int index) { - return function_.get(index); - } - - public static final int PROPERTY_FIELD_NUMBER = 4; - private java.util.List property_; - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public java.util.List getPropertyList() { - return property_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public java.util.List - getPropertyOrBuilderList() { - return property_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public int getPropertyCount() { - return property_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index) { - return property_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.PropertyOrBuilder getPropertyOrBuilder( - int index) { - return property_.get(index); - } - - public static final int TYPE_ALIAS_FIELD_NUMBER = 5; - private java.util.List typeAlias_; + public static final int TYPE_FIELD_NUMBER = 1; + private java.util.List type_; /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public java.util.List getTypeAliasList() { - return typeAlias_; + public java.util.List getTypeList() { + return type_; } /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public java.util.List - getTypeAliasOrBuilderList() { - return typeAlias_; + public java.util.List + getTypeOrBuilderList() { + return type_; } /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public int getTypeAliasCount() { - return typeAlias_.size(); + public int getTypeCount() { + return type_.size(); } /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index) { - return typeAlias_.get(index); + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index) { + return type_.get(index); } /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAliasOrBuilder getTypeAliasOrBuilder( + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getTypeOrBuilder( int index) { - return typeAlias_.get(index); + return type_.get(index); } - public static final int TYPE_TABLE_FIELD_NUMBER = 30; - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; + public static final int FIRST_NULLABLE_FIELD_NUMBER = 2; + private int firstNullable_; /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + * optional int32 first_nullable = 2 [default = -1]; + * + *
+     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * 
*/ - public boolean hasTypeTable() { + public boolean hasFirstNullable() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { - return typeTable_; - } - - public static final int VERSION_REQUIREMENT_TABLE_FIELD_NUMBER = 32; - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable versionRequirementTable_; - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public boolean hasVersionRequirementTable() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; + * optional int32 first_nullable = 2 [default = -1]; + * + *
+     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * 
*/ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable() { - return versionRequirementTable_; + public int getFirstNullable() { + return firstNullable_; } private void initFields() { - function_ = java.util.Collections.emptyList(); - property_ = java.util.Collections.emptyList(); - typeAlias_ = java.util.Collections.emptyList(); - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + type_ = java.util.Collections.emptyList(); + firstNullable_ = -1; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -12148,34 +11729,12 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; - for (int i = 0; i < getFunctionCount(); i++) { - if (!getFunction(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getPropertyCount(); i++) { - if (!getProperty(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getTypeAliasCount(); i++) { - if (!getTypeAlias(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasTypeTable()) { - if (!getTypeTable().isInitialized()) { + for (int i = 0; i < getTypeCount(); i++) { + if (!getType(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } memoizedIsInitialized = 1; return true; } @@ -12183,25 +11742,12 @@ public final boolean isInitialized() { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - for (int i = 0; i < function_.size(); i++) { - output.writeMessage(3, function_.get(i)); - } - for (int i = 0; i < property_.size(); i++) { - output.writeMessage(4, property_.get(i)); - } - for (int i = 0; i < typeAlias_.size(); i++) { - output.writeMessage(5, typeAlias_.get(i)); + for (int i = 0; i < type_.size(); i++) { + output.writeMessage(1, type_.get(i)); } if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(30, typeTable_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(32, versionRequirementTable_); + output.writeInt32(2, firstNullable_); } - extensionWriter.writeUntil(200, output); output.writeRawBytes(unknownFields); } @@ -12211,27 +11757,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - for (int i = 0; i < function_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, function_.get(i)); - } - for (int i = 0; i < property_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, property_.get(i)); - } - for (int i = 0; i < typeAlias_.size(); i++) { + for (int i = 0; i < type_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, typeAlias_.get(i)); + .computeMessageSize(1, type_.get(i)); } if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(30, typeTable_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(32, versionRequirementTable_); + .computeInt32Size(2, firstNullable_); } - size += extensionsSerializedSize(); size += unknownFields.size(); memoizedSerializedSize = size; return size; @@ -12244,53 +11777,53 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable 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.metadata.ProtoBuf.Package parseFrom(byte[] data) + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseDelimitedFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseDelimitedFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -12299,20 +11832,21 @@ public static org.jetbrains.kotlin.metadata.ProtoBuf.Package parseFrom( public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Package prototype) { + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Package} + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.Package, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Package) - org.jetbrains.kotlin.metadata.ProtoBuf.PackageOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Package.newBuilder() + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeTable) + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTableOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -12325,16 +11859,10 @@ private static Builder create() { public Builder clear() { super.clear(); - function_ = java.util.Collections.emptyList(); + type_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); - property_ = java.util.Collections.emptyList(); + firstNullable_ = -1; bitField0_ = (bitField0_ & ~0x00000002); - typeAlias_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000010); return this; } @@ -12342,122 +11870,62 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Package getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Package build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Package result = buildPartial(); + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable build() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Package buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Package result = new org.jetbrains.kotlin.metadata.ProtoBuf.Package(this); + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - function_ = java.util.Collections.unmodifiableList(function_); + type_ = java.util.Collections.unmodifiableList(type_); bitField0_ = (bitField0_ & ~0x00000001); } - result.function_ = function_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - property_ = java.util.Collections.unmodifiableList(property_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.property_ = property_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - typeAlias_ = java.util.Collections.unmodifiableList(typeAlias_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.typeAlias_ = typeAlias_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + result.type_ = type_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000001; } - result.typeTable_ = typeTable_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000002; - } - result.versionRequirementTable_ = versionRequirementTable_; + result.firstNullable_ = firstNullable_; result.bitField0_ = to_bitField0_; return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Package other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance()) return this; - if (!other.function_.isEmpty()) { - if (function_.isEmpty()) { - function_ = other.function_; + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) return this; + if (!other.type_.isEmpty()) { + if (type_.isEmpty()) { + type_ = other.type_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureFunctionIsMutable(); - function_.addAll(other.function_); - } - - } - if (!other.property_.isEmpty()) { - if (property_.isEmpty()) { - property_ = other.property_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensurePropertyIsMutable(); - property_.addAll(other.property_); - } - - } - if (!other.typeAlias_.isEmpty()) { - if (typeAlias_.isEmpty()) { - typeAlias_ = other.typeAlias_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureTypeAliasIsMutable(); - typeAlias_.addAll(other.typeAlias_); + ensureTypeIsMutable(); + type_.addAll(other.type_); } } - if (other.hasTypeTable()) { - mergeTypeTable(other.getTypeTable()); - } - if (other.hasVersionRequirementTable()) { - mergeVersionRequirementTable(other.getVersionRequirementTable()); + if (other.hasFirstNullable()) { + setFirstNullable(other.getFirstNullable()); } - this.mergeExtensionFields(other); setUnknownFields( getUnknownFields().concat(other.unknownFields)); return this; } public final boolean isInitialized() { - for (int i = 0; i < getFunctionCount(); i++) { - if (!getFunction(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getPropertyCount(); i++) { - if (!getProperty(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getTypeAliasCount(); i++) { - if (!getTypeAlias(i).isInitialized()) { - - return false; - } - } - if (hasTypeTable()) { - if (!getTypeTable().isInitialized()) { + for (int i = 0; i < getTypeCount(); i++) { + if (!getType(i).isInitialized()) { return false; } } - if (!extensionsAreInitialized()) { - - return false; - } return true; } @@ -12465,11 +11933,11 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Package parsedMessage = null; + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Package) e.getUnfinishedMessage(); + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -12480,575 +11948,288 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List function_ = + private java.util.List type_ = java.util.Collections.emptyList(); - private void ensureFunctionIsMutable() { + private void ensureTypeIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { - function_ = new java.util.ArrayList(function_); + type_ = new java.util.ArrayList(type_); bitField0_ |= 0x00000001; } } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public java.util.List getFunctionList() { - return java.util.Collections.unmodifiableList(function_); + public java.util.List getTypeList() { + return java.util.Collections.unmodifiableList(type_); } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public int getFunctionCount() { - return function_.size(); + public int getTypeCount() { + return type_.size(); } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index) { - return function_.get(index); + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index) { + return type_.get(index); } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder setFunction( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + public Builder setType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } - ensureFunctionIsMutable(); - function_.set(index, value); + ensureTypeIsMutable(); + type_.set(index, value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder setFunction( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { - ensureFunctionIsMutable(); - function_.set(index, builderForValue.build()); + public Builder setType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureTypeIsMutable(); + type_.set(index, builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder addFunction(org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + public Builder addType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } - ensureFunctionIsMutable(); - function_.add(value); + ensureTypeIsMutable(); + type_.add(value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder addFunction( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + public Builder addType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } - ensureFunctionIsMutable(); - function_.add(index, value); + ensureTypeIsMutable(); + type_.add(index, value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder addFunction( - org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { - ensureFunctionIsMutable(); - function_.add(builderForValue.build()); + public Builder addType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureTypeIsMutable(); + type_.add(builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder addFunction( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { - ensureFunctionIsMutable(); - function_.add(index, builderForValue.build()); + public Builder addType( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ensureTypeIsMutable(); + type_.add(index, builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder addAllFunction( - java.lang.Iterable values) { - ensureFunctionIsMutable(); + public Builder addAllType( + java.lang.Iterable values) { + ensureTypeIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, function_); + values, type_); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder clearFunction() { - function_ = java.util.Collections.emptyList(); + public Builder clearType() { + type_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 3; + * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder removeFunction(int index) { - ensureFunctionIsMutable(); - function_.remove(index); + public Builder removeType(int index) { + ensureTypeIsMutable(); + type_.remove(index); return this; } - private java.util.List property_ = - java.util.Collections.emptyList(); - private void ensurePropertyIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - property_ = new java.util.ArrayList(property_); - bitField0_ |= 0x00000002; - } - } - + private int firstNullable_ = -1; /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + * optional int32 first_nullable = 2 [default = -1]; + * + *
+       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * 
*/ - public java.util.List getPropertyList() { - return java.util.Collections.unmodifiableList(property_); + public boolean hasFirstNullable() { + return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + * optional int32 first_nullable = 2 [default = -1]; + * + *
+       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * 
*/ - public int getPropertyCount() { - return property_.size(); + public int getFirstNullable() { + return firstNullable_; } /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index) { - return property_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public Builder setProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public Builder setProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public Builder addProperty(org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + * optional int32 first_nullable = 2 [default = -1]; + * + *
+       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * 
*/ - public Builder addProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.add(index, value); - + public Builder setFirstNullable(int value) { + bitField0_ |= 0x00000002; + firstNullable_ = value; + return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; + * optional int32 first_nullable = 2 [default = -1]; + * + *
+       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
+       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * 
*/ - public Builder addProperty( - org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.add(builderForValue.build()); - + public Builder clearFirstNullable() { + bitField0_ = (bitField0_ & ~0x00000002); + firstNullable_ = -1; + return this; } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public Builder addProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.add(index, builderForValue.build()); - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public Builder addAllProperty( - java.lang.Iterable values) { - ensurePropertyIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, property_); + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeTable) + } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public Builder clearProperty() { - property_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + static { + defaultInstance = new TypeTable(true); + defaultInstance.initFields(); + } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 4; - */ - public Builder removeProperty(int index) { - ensurePropertyIsMutable(); - property_.remove(index); + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeTable) + } - return this; - } + public interface ConstructorOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Constructor) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { - private java.util.List typeAlias_ = - java.util.Collections.emptyList(); - private void ensureTypeAliasIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - typeAlias_ = new java.util.ArrayList(typeAlias_); - bitField0_ |= 0x00000004; - } - } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *isSecondary
+     *hasNonStableParameterNames
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *isSecondary
+     *hasNonStableParameterNames
+     * 
+ */ + int getFlags(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public java.util.List getTypeAliasList() { - return java.util.Collections.unmodifiableList(typeAlias_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public int getTypeAliasCount() { - return typeAlias_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index) { - return typeAlias_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder setTypeAlias( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeAliasIsMutable(); - typeAlias_.set(index, value); + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + java.util.List + getValueParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + int getValueParameterCount(); - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder setTypeAlias( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { - ensureTypeAliasIsMutable(); - typeAlias_.set(index, builderForValue.build()); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + java.util.List getVersionRequirementList(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirementCount(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirement(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} + */ + public static final class Constructor extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Constructor> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Constructor) + ConstructorOrBuilder { + // Use Constructor.newBuilder() to construct. + private Constructor(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Constructor(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder addTypeAlias(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeAliasIsMutable(); - typeAlias_.add(value); + private static final Constructor defaultInstance; + public static Constructor getDefaultInstance() { + return defaultInstance; + } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder addTypeAlias( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeAliasIsMutable(); - typeAlias_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder addTypeAlias( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { - ensureTypeAliasIsMutable(); - typeAlias_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder addTypeAlias( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { - ensureTypeAliasIsMutable(); - typeAlias_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder addAllTypeAlias( - java.lang.Iterable values) { - ensureTypeAliasIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, typeAlias_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder clearTypeAlias() { - typeAlias_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 5; - */ - public Builder removeTypeAlias(int index) { - ensureTypeAliasIsMutable(); - typeAlias_.remove(index); - - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public boolean hasTypeTable() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { - return typeTable_; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { - if (value == null) { - throw new NullPointerException(); - } - typeTable_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder setTypeTable( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { - typeTable_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { - typeTable_ = - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); - } else { - typeTable_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder clearTypeTable() { - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public boolean hasVersionRequirementTable() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable() { - return versionRequirementTable_; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public Builder setVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { - if (value == null) { - throw new NullPointerException(); - } - versionRequirementTable_ = value; - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public Builder setVersionRequirementTable( - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder builderForValue) { - versionRequirementTable_ = builderForValue.build(); - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { - if (((bitField0_ & 0x00000010) == 0x00000010) && - versionRequirementTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) { - versionRequirementTable_ = - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial(); - } else { - versionRequirementTable_ = value; - } - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public Builder clearVersionRequirementTable() { - versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Package) - } - - static { - defaultInstance = new Package(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Package) - } - - public interface TypeTableOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeTable) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - java.util.List - getTypeList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - int getTypeCount(); - - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-     * 
- */ - boolean hasFirstNullable(); - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-     * 
- */ - int getFirstNullable(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} - */ - public static final class TypeTable extends - com.google.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeTable) - TypeTableOrBuilder { - // Use TypeTable.newBuilder() to construct. - private TypeTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private TypeTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - - private static final TypeTable defaultInstance; - public static TypeTable getDefaultInstance() { - return defaultInstance; - } - - public TypeTable getDefaultInstanceForType() { - return defaultInstance; - } + public Constructor getDefaultInstanceForType() { + return defaultInstance; + } private final com.google.protobuf.ByteString unknownFields; - private TypeTable( + private Constructor( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -13074,17 +12255,38 @@ private TypeTable( } break; } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - type_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - type_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); + case 8: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); break; } - case 16: { - bitField0_ |= 0x00000001; - firstNullable_ = input.readInt32(); + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + valueParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + valueParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry)); + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.add(input.readInt32()); + } + input.popLimit(limit); break; } } @@ -13095,8 +12297,11 @@ private TypeTable( throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - type_ = java.util.Collections.unmodifiableList(type_); + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); } try { unknownFieldsCodedOutput.flush(); @@ -13108,85 +12313,124 @@ private TypeTable( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public TypeTable parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Constructor parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TypeTable(input, extensionRegistry); + return new Constructor(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } private int bitField0_; - public static final int TYPE_FIELD_NUMBER = 1; - private java.util.List type_; + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *isSecondary
+     *hasNonStableParameterNames
+     * 
*/ - public java.util.List getTypeList() { - return type_; + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     *isSecondary
+     *hasNonStableParameterNames
+     * 
*/ - public java.util.List - getTypeOrBuilderList() { - return type_; + public int getFlags() { + return flags_; } + + public static final int VALUE_PARAMETER_FIELD_NUMBER = 2; + private java.util.List valueParameter_; /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public int getTypeCount() { - return type_.size(); + public java.util.List getValueParameterList() { + return valueParameter_; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index) { - return type_.get(index); + public java.util.List + getValueParameterOrBuilderList() { + return valueParameter_; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getTypeOrBuilder( + public int getValueParameterCount() { + return valueParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + return valueParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( int index) { - return type_.get(index); + return valueParameter_.get(index); } - public static final int FIRST_NULLABLE_FIELD_NUMBER = 2; - private int firstNullable_; + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; /** - * optional int32 first_nullable = 2 [default = -1]; + * repeated int32 version_requirement = 31; * *
-     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * Index into the VersionRequirementTable
      * 
*/ - public boolean hasFirstNullable() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List + getVersionRequirementList() { + return versionRequirement_; } /** - * optional int32 first_nullable = 2 [default = -1]; + * repeated int32 version_requirement = 31; * *
-     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+     * Index into the VersionRequirementTable
      * 
*/ - public int getFirstNullable() { - return firstNullable_; + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); } private void initFields() { - type_ = java.util.Collections.emptyList(); - firstNullable_ = -1; + flags_ = 6; + valueParameter_ = java.util.Collections.emptyList(); + versionRequirement_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -13194,12 +12438,16 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; - for (int i = 0; i < getTypeCount(); i++) { - if (!getType(i).isInitialized()) { + for (int i = 0; i < getValueParameterCount(); i++) { + if (!getValueParameter(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -13207,12 +12455,19 @@ public final boolean isInitialized() { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - for (int i = 0; i < type_.size(); i++) { - output.writeMessage(1, type_.get(i)); - } + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(2, firstNullable_); + output.writeInt32(1, flags_); + } + for (int i = 0; i < valueParameter_.size(); i++) { + output.writeMessage(2, valueParameter_.get(i)); } + for (int i = 0; i < versionRequirement_.size(); i++) { + output.writeInt32(31, versionRequirement_.get(i)); + } + extensionWriter.writeUntil(19000, output); output.writeRawBytes(unknownFields); } @@ -13222,14 +12477,24 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - for (int i = 0; i < type_.size(); i++) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, type_.get(i)); + .computeInt32Size(1, flags_); } - if (((bitField0_ & 0x00000001) == 0x00000001)) { + for (int i = 0; i < valueParameter_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, firstNullable_); + .computeMessageSize(2, valueParameter_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < versionRequirement_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(versionRequirement_.get(i)); + } + size += dataSize; + size += 2 * getVersionRequirementList().size(); } + size += extensionsSerializedSize(); size += unknownFields.size(); memoizedSerializedSize = size; return size; @@ -13242,53 +12507,53 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor 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.metadata.ProtoBuf.TypeTable parseFrom(byte[] data) + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseDelimitedFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseDelimitedFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -13297,21 +12562,20 @@ public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable prototype) { + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} + * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeTable) - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTableOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder() + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Constructor) + org.jetbrains.kotlin.metadata.ProtoBuf.ConstructorOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -13324,10 +12588,12 @@ private static Builder create() { public Builder clear() { super.clear(); - type_ = java.util.Collections.emptyList(); + flags_ = 6; bitField0_ = (bitField0_ & ~0x00000001); - firstNullable_ = -1; + valueParameter_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -13335,62 +12601,82 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable build() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable result = buildPartial(); + public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable(this); + public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor result = new org.jetbrains.kotlin.metadata.ProtoBuf.Constructor(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - type_ = java.util.Collections.unmodifiableList(type_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.firstNullable_ = firstNullable_; + result.flags_ = flags_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.valueParameter_ = valueParameter_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.versionRequirement_ = versionRequirement_; result.bitField0_ = to_bitField0_; return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) return this; - if (!other.type_.isEmpty()) { - if (type_.isEmpty()) { - type_ = other.type_; - bitField0_ = (bitField0_ & ~0x00000001); + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (!other.valueParameter_.isEmpty()) { + if (valueParameter_.isEmpty()) { + valueParameter_ = other.valueParameter_; + bitField0_ = (bitField0_ & ~0x00000002); } else { - ensureTypeIsMutable(); - type_.addAll(other.type_); + ensureValueParameterIsMutable(); + valueParameter_.addAll(other.valueParameter_); } } - if (other.hasFirstNullable()) { - setFirstNullable(other.getFirstNullable()); + if (!other.versionRequirement_.isEmpty()) { + if (versionRequirement_.isEmpty()) { + versionRequirement_ = other.versionRequirement_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureVersionRequirementIsMutable(); + versionRequirement_.addAll(other.versionRequirement_); + } + } + this.mergeExtensionFields(other); setUnknownFields( getUnknownFields().concat(other.unknownFields)); return this; } public final boolean isInitialized() { - for (int i = 0; i < getTypeCount(); i++) { - if (!getType(i).isInitialized()) { + for (int i = 0; i < getValueParameterCount(); i++) { + if (!getValueParameter(i).isInitialized()) { return false; } } + if (!extensionsAreInitialized()) { + + return false; + } return true; } @@ -13398,11 +12684,11 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parsedMessage = null; + org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable) e.getUnfinishedMessage(); + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Constructor) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -13413,236 +12699,431 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List type_ = + private int flags_ = 6; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *isSecondary
+       *hasNonStableParameterNames
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *isSecondary
+       *hasNonStableParameterNames
+       * 
+ */ + public int getFlags() { + return flags_; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *isSecondary
+       *hasNonStableParameterNames
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       *isSecondary
+       *hasNonStableParameterNames
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 6; + + return this; + } + + private java.util.List valueParameter_ = java.util.Collections.emptyList(); - private void ensureTypeIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - type_ = new java.util.ArrayList(type_); - bitField0_ |= 0x00000001; + private void ensureValueParameterIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + valueParameter_ = new java.util.ArrayList(valueParameter_); + bitField0_ |= 0x00000002; } } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public java.util.List getTypeList() { - return java.util.Collections.unmodifiableList(type_); + public java.util.List getValueParameterList() { + return java.util.Collections.unmodifiableList(valueParameter_); } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public int getTypeCount() { - return type_.size(); + public int getValueParameterCount() { + return valueParameter_.size(); } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index) { - return type_.get(index); + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + return valueParameter_.get(index); } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder setType( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } - ensureTypeIsMutable(); - type_.set(index, value); + ensureValueParameterIsMutable(); + valueParameter_.set(index, value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder setType( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - ensureTypeIsMutable(); - type_.set(index, builderForValue.build()); + public Builder setValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.set(index, builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder addType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } - ensureTypeIsMutable(); - type_.add(value); + ensureValueParameterIsMutable(); + valueParameter_.add(value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder addType( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder addValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } - ensureTypeIsMutable(); - type_.add(index, value); + ensureValueParameterIsMutable(); + valueParameter_.add(index, value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder addType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - ensureTypeIsMutable(); - type_.add(builderForValue.build()); + public Builder addValueParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.add(builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder addType( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - ensureTypeIsMutable(); - type_.add(index, builderForValue.build()); + public Builder addValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.add(index, builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder addAllType( - java.lang.Iterable values) { - ensureTypeIsMutable(); + public Builder addAllValueParameter( + java.lang.Iterable values) { + ensureValueParameterIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, type_); + values, valueParameter_); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder clearType() { - type_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder clearValueParameter() { + valueParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder removeType(int index) { - ensureTypeIsMutable(); - type_.remove(index); + public Builder removeValueParameter(int index) { + ensureValueParameterIsMutable(); + valueParameter_.remove(index); return this; } - private int firstNullable_ = -1; + private java.util.List versionRequirement_ = java.util.Collections.emptyList(); + private void ensureVersionRequirementIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + versionRequirement_ = new java.util.ArrayList(versionRequirement_); + bitField0_ |= 0x00000004; + } + } /** - * optional int32 first_nullable = 2 [default = -1]; + * repeated int32 version_requirement = 31; * *
-       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * Index into the VersionRequirementTable
        * 
*/ - public boolean hasFirstNullable() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public java.util.List + getVersionRequirementList() { + return java.util.Collections.unmodifiableList(versionRequirement_); } /** - * optional int32 first_nullable = 2 [default = -1]; + * repeated int32 version_requirement = 31; * *
-       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * Index into the VersionRequirementTable
        * 
*/ - public int getFirstNullable() { - return firstNullable_; + public int getVersionRequirementCount() { + return versionRequirement_.size(); } /** - * optional int32 first_nullable = 2 [default = -1]; + * repeated int32 version_requirement = 31; * *
-       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * Index into the VersionRequirementTable
        * 
*/ - public Builder setFirstNullable(int value) { - bitField0_ |= 0x00000002; - firstNullable_ = value; - - return this; + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); } /** - * optional int32 first_nullable = 2 [default = -1]; + * repeated int32 version_requirement = 31; * *
-       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
+       * Index into the VersionRequirementTable
        * 
*/ - public Builder clearFirstNullable() { - bitField0_ = (bitField0_ & ~0x00000002); - firstNullable_ = -1; + public Builder setVersionRequirement( + int index, int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.set(index, value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeTable) + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Constructor) } static { - defaultInstance = new TypeTable(true); + defaultInstance = new Constructor(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeTable) + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Constructor) } - public interface ConstructorOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Constructor) + public interface FunctionOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Function) com.google.protobuf.GeneratedMessageLite. - ExtendableMessageOrBuilder { + ExtendableMessageOrBuilder { /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 9 [default = 6]; * *
      *hasAnnotations
      *Visibility
-     *isSecondary
+     *Modality
+     *MemberKind
+     *isOperator
+     *isInfix
+     *isInline
+     *isTailrec
+     *isExternal
+     *isSuspend
+     *isExpect
      *hasNonStableParameterNames
      * 
*/ boolean hasFlags(); /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 9 [default = 6]; * *
      *hasAnnotations
      *Visibility
-     *isSecondary
+     *Modality
+     *MemberKind
+     *isOperator
+     *isInfix
+     *isInline
+     *isTailrec
+     *isExternal
+     *isSuspend
+     *isExpect
      *hasNonStableParameterNames
      * 
*/ int getFlags(); /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * optional int32 old_flags = 1 [default = 6]; + */ + boolean hasOldFlags(); + /** + * optional int32 old_flags = 1 [default = 6]; + */ + int getOldFlags(); + + /** + * required int32 name = 2; + */ + boolean hasName(); + /** + * required int32 name = 2; + */ + int getName(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + boolean hasReturnType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType(); + + /** + * optional int32 return_type_id = 7; + */ + boolean hasReturnTypeId(); + /** + * optional int32 return_type_id = 7; + */ + int getReturnTypeId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + java.util.List + getTypeParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + int getTypeParameterCount(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + boolean hasReceiverType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType(); + + /** + * optional int32 receiver_type_id = 8; + */ + boolean hasReceiverTypeId(); + /** + * optional int32 receiver_type_id = 8; + */ + int getReceiverTypeId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ java.util.List getValueParameterList(); /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index); /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ int getValueParameterCount(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + boolean hasTypeTable(); + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable(); + /** * repeated int32 version_requirement = 31; * @@ -13667,34 +13148,43 @@ public interface ConstructorOrBuilder extends * */ int getVersionRequirement(int index); + + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + boolean hasContract(); + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract(); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} + * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} */ - public static final class Constructor extends + public static final class Function extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage< - Constructor> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Constructor) - ConstructorOrBuilder { - // Use Constructor.newBuilder() to construct. - private Constructor(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + Function> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Function) + FunctionOrBuilder { + // Use Function.newBuilder() to construct. + private Function(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Constructor(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Function(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - private static final Constructor defaultInstance; - public static Constructor getDefaultInstance() { + private static final Function defaultInstance; + public static Function getDefaultInstance() { return defaultInstance; } - public Constructor getDefaultInstanceForType() { + public Function getDefaultInstanceForType() { return defaultInstance; } private final com.google.protobuf.ByteString unknownFields; - private Constructor( + private Function( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -13721,51 +13211,134 @@ private Constructor( break; } case 8: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); + bitField0_ |= 0x00000002; + oldFlags_ = input.readInt32(); break; } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - valueParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; + case 16: { + bitField0_ |= 0x00000004; + name_ = input.readInt32(); + break; + } + case 26: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = returnType_.toBuilder(); } - valueParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry)); + returnType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(returnType_); + returnType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; break; } - case 248: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; + case 34: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; } - versionRequirement_.add(input.readInt32()); + typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); break; } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; + case 42: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = receiverType_.toBuilder(); } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.add(input.readInt32()); + receiverType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(receiverType_); + receiverType_ = subBuilder.buildPartial(); } - input.popLimit(limit); + bitField0_ |= 0x00000020; break; } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + case 50: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + valueParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + valueParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry)); + break; + } + case 56: { + bitField0_ |= 0x00000010; + returnTypeId_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000040; + receiverTypeId_ = input.readInt32(); + break; + } + case 72: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 242: { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = typeTable_.toBuilder(); + } + typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(typeTable_); + typeTable_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000400; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000400) == 0x00000400) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000400; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 258: { + org.jetbrains.kotlin.metadata.ProtoBuf.Contract.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = contract_.toBuilder(); + } + contract_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Contract.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contract_); + contract_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + 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_ & 0x00000002) == 0x00000002)) { + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); } - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) { versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); } try { @@ -13778,31 +13351,39 @@ private Constructor( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Constructor parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Function parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Constructor(input, extensionRegistry); + return new Function(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 1; + public static final int FLAGS_FIELD_NUMBER = 9; private int flags_; /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 9 [default = 6]; * *
      *hasAnnotations
      *Visibility
-     *isSecondary
+     *Modality
+     *MemberKind
+     *isOperator
+     *isInfix
+     *isInline
+     *isTailrec
+     *isExternal
+     *isSuspend
+     *isExpect
      *hasNonStableParameterNames
      * 
*/ @@ -13810,12 +13391,20 @@ public boolean hasFlags() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 9 [default = 6]; * *
      *hasAnnotations
      *Visibility
-     *isSecondary
+     *Modality
+     *MemberKind
+     *isOperator
+     *isInfix
+     *isInline
+     *isTailrec
+     *isExternal
+     *isSuspend
+     *isExpect
      *hasNonStableParameterNames
      * 
*/ @@ -13823,44 +13412,184 @@ public int getFlags() { return flags_; } - public static final int VALUE_PARAMETER_FIELD_NUMBER = 2; + public static final int OLD_FLAGS_FIELD_NUMBER = 1; + private int oldFlags_; + /** + * optional int32 old_flags = 1 [default = 6]; + */ + public boolean hasOldFlags() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 old_flags = 1 [default = 6]; + */ + public int getOldFlags() { + return oldFlags_; + } + + public static final int NAME_FIELD_NUMBER = 2; + private int name_; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + + public static final int RETURN_TYPE_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public boolean hasReturnType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + return returnType_; + } + + public static final int RETURN_TYPE_ID_FIELD_NUMBER = 7; + private int returnTypeId_; + /** + * optional int32 return_type_id = 7; + */ + public boolean hasReturnTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 return_type_id = 7; + */ + public int getReturnTypeId() { + return returnTypeId_; + } + + public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; + private java.util.List typeParameter_; + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List getTypeParameterList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List + getTypeParameterOrBuilderList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + int index) { + return typeParameter_.get(index); + } + + public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public boolean hasReceiverType() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + return receiverType_; + } + + public static final int RECEIVER_TYPE_ID_FIELD_NUMBER = 8; + private int receiverTypeId_; + /** + * optional int32 receiver_type_id = 8; + */ + public boolean hasReceiverTypeId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 receiver_type_id = 8; + */ + public int getReceiverTypeId() { + return receiverTypeId_; + } + + public static final int VALUE_PARAMETER_FIELD_NUMBER = 6; private java.util.List valueParameter_; /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public java.util.List getValueParameterList() { return valueParameter_; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public java.util.List getValueParameterOrBuilderList() { return valueParameter_; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public int getValueParameterCount() { return valueParameter_.size(); } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { return valueParameter_.get(index); } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( int index) { return valueParameter_.get(index); } - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** + public static final int TYPE_TABLE_FIELD_NUMBER = 30; + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public boolean hasTypeTable() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + return typeTable_; + } + + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; + /** * repeated int32 version_requirement = 31; * *
@@ -13892,10 +13621,34 @@ public int getVersionRequirement(int index) {
       return versionRequirement_.get(index);
     }
 
+    public static final int CONTRACT_FIELD_NUMBER = 32;
+    private org.jetbrains.kotlin.metadata.ProtoBuf.Contract contract_;
+    /**
+     * optional .org.jetbrains.kotlin.metadata.Contract contract = 32;
+     */
+    public boolean hasContract() {
+      return ((bitField0_ & 0x00000100) == 0x00000100);
+    }
+    /**
+     * optional .org.jetbrains.kotlin.metadata.Contract contract = 32;
+     */
+    public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract() {
+      return contract_;
+    }
+
     private void initFields() {
       flags_ = 6;
+      oldFlags_ = 6;
+      name_ = 0;
+      returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance();
+      returnTypeId_ = 0;
+      typeParameter_ = java.util.Collections.emptyList();
+      receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance();
+      receiverTypeId_ = 0;
       valueParameter_ = java.util.Collections.emptyList();
+      typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance();
       versionRequirement_ = java.util.Collections.emptyList();
+      contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance();
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
@@ -13903,12 +13656,46 @@ public final boolean isInitialized() {
       if (isInitialized == 1) return true;
       if (isInitialized == 0) return false;
 
+      if (!hasName()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (hasReturnType()) {
+        if (!getReturnType().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
+      for (int i = 0; i < getTypeParameterCount(); i++) {
+        if (!getTypeParameter(i).isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
+      if (hasReceiverType()) {
+        if (!getReceiverType().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
       for (int i = 0; i < getValueParameterCount(); i++) {
         if (!getValueParameter(i).isInitialized()) {
           memoizedIsInitialized = 0;
           return false;
         }
       }
+      if (hasTypeTable()) {
+        if (!getTypeTable().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
+      if (hasContract()) {
+        if (!getContract().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
+      }
       if (!extensionsAreInitialized()) {
         memoizedIsInitialized = 0;
         return false;
@@ -13921,17 +13708,44 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
       com.google.protobuf.GeneratedMessageLite
-        .ExtendableMessage.ExtensionWriter extensionWriter =
+        .ExtendableMessage.ExtensionWriter extensionWriter =
           newExtensionWriter();
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeInt32(1, flags_);
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+        output.writeInt32(1, oldFlags_);
+      }
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        output.writeInt32(2, name_);
+      }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        output.writeMessage(3, returnType_);
+      }
+      for (int i = 0; i < typeParameter_.size(); i++) {
+        output.writeMessage(4, typeParameter_.get(i));
+      }
+      if (((bitField0_ & 0x00000020) == 0x00000020)) {
+        output.writeMessage(5, receiverType_);
       }
       for (int i = 0; i < valueParameter_.size(); i++) {
-        output.writeMessage(2, valueParameter_.get(i));
+        output.writeMessage(6, valueParameter_.get(i));
+      }
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        output.writeInt32(7, returnTypeId_);
+      }
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        output.writeInt32(8, receiverTypeId_);
+      }
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        output.writeInt32(9, flags_);
+      }
+      if (((bitField0_ & 0x00000080) == 0x00000080)) {
+        output.writeMessage(30, typeTable_);
       }
       for (int i = 0; i < versionRequirement_.size(); i++) {
         output.writeInt32(31, versionRequirement_.get(i));
       }
+      if (((bitField0_ & 0x00000100) == 0x00000100)) {
+        output.writeMessage(32, contract_);
+      }
       extensionWriter.writeUntil(19000, output);
       output.writeRawBytes(unknownFields);
     }
@@ -13942,13 +13756,45 @@ public int getSerializedSize() {
       if (size != -1) return size;
 
       size = 0;
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeInt32Size(1, flags_);
+          .computeInt32Size(1, oldFlags_);
+      }
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(2, name_);
+      }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(3, returnType_);
+      }
+      for (int i = 0; i < typeParameter_.size(); i++) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(4, typeParameter_.get(i));
+      }
+      if (((bitField0_ & 0x00000020) == 0x00000020)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(5, receiverType_);
       }
       for (int i = 0; i < valueParameter_.size(); i++) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(2, valueParameter_.get(i));
+          .computeMessageSize(6, valueParameter_.get(i));
+      }
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(7, returnTypeId_);
+      }
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(8, receiverTypeId_);
+      }
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(9, flags_);
+      }
+      if (((bitField0_ & 0x00000080) == 0x00000080)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(30, typeTable_);
       }
       {
         int dataSize = 0;
@@ -13959,6 +13805,10 @@ public int getSerializedSize() {
         size += dataSize;
         size += 2 * getVersionRequirementList().size();
       }
+      if (((bitField0_ & 0x00000100) == 0x00000100)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(32, contract_);
+      }
       size += extensionsSerializedSize();
       size += unknownFields.size();
       memoizedSerializedSize = size;
@@ -13972,53 +13822,53 @@ protected java.lang.Object writeReplace()
       return super.writeReplace();
     }
 
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function 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.metadata.ProtoBuf.Constructor parseFrom(byte[] data)
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(java.io.InputStream input)
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(java.io.InputStream input)
         throws java.io.IOException {
       return PARSER.parseFrom(input);
     }
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return PARSER.parseFrom(input, extensionRegistry);
     }
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseDelimitedFrom(java.io.InputStream input)
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
       return PARSER.parseDelimitedFrom(input);
     }
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseDelimitedFrom(
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
       return PARSER.parseDelimitedFrom(input, extensionRegistry);
     }
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
       return PARSER.parseFrom(input);
     }
-    public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(
+    public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
@@ -14027,20 +13877,20 @@ public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(
 
     public static Builder newBuilder() { return Builder.create(); }
     public Builder newBuilderForType() { return newBuilder(); }
-    public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor prototype) {
+    public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Function prototype) {
       return newBuilder().mergeFrom(prototype);
     }
     public Builder toBuilder() { return newBuilder(this); }
 
     /**
-     * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor}
+     * Protobuf type {@code org.jetbrains.kotlin.metadata.Function}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<
-          org.jetbrains.kotlin.metadata.ProtoBuf.Constructor, Builder> implements
-        // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Constructor)
-        org.jetbrains.kotlin.metadata.ProtoBuf.ConstructorOrBuilder {
-      // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.newBuilder()
+          org.jetbrains.kotlin.metadata.ProtoBuf.Function, Builder> implements
+        // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Function)
+        org.jetbrains.kotlin.metadata.ProtoBuf.FunctionOrBuilder {
+      // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Function.newBuilder()
       private Builder() {
         maybeForceBuilderInitialization();
       }
@@ -14055,10 +13905,28 @@ public Builder clear() {
         super.clear();
         flags_ = 6;
         bitField0_ = (bitField0_ & ~0x00000001);
-        valueParameter_ = java.util.Collections.emptyList();
+        oldFlags_ = 6;
         bitField0_ = (bitField0_ & ~0x00000002);
-        versionRequirement_ = java.util.Collections.emptyList();
+        name_ = 0;
         bitField0_ = (bitField0_ & ~0x00000004);
+        returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance();
+        bitField0_ = (bitField0_ & ~0x00000008);
+        returnTypeId_ = 0;
+        bitField0_ = (bitField0_ & ~0x00000010);
+        typeParameter_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000020);
+        receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance();
+        bitField0_ = (bitField0_ & ~0x00000040);
+        receiverTypeId_ = 0;
+        bitField0_ = (bitField0_ & ~0x00000080);
+        valueParameter_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000100);
+        typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance();
+        bitField0_ = (bitField0_ & ~0x00000200);
+        versionRequirement_ = java.util.Collections.emptyList();
+        bitField0_ = (bitField0_ & ~0x00000400);
+        contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance();
+        bitField0_ = (bitField0_ & ~0x00000800);
         return this;
       }
 
@@ -14066,65 +13934,136 @@ public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getDefaultInstanceForType() {
-        return org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance();
+      public org.jetbrains.kotlin.metadata.ProtoBuf.Function getDefaultInstanceForType() {
+        return org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance();
       }
 
-      public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor build() {
-        org.jetbrains.kotlin.metadata.ProtoBuf.Constructor result = buildPartial();
+      public org.jetbrains.kotlin.metadata.ProtoBuf.Function build() {
+        org.jetbrains.kotlin.metadata.ProtoBuf.Function result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
         return result;
       }
 
-      public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor buildPartial() {
-        org.jetbrains.kotlin.metadata.ProtoBuf.Constructor result = new org.jetbrains.kotlin.metadata.ProtoBuf.Constructor(this);
+      public org.jetbrains.kotlin.metadata.ProtoBuf.Function buildPartial() {
+        org.jetbrains.kotlin.metadata.ProtoBuf.Function result = new org.jetbrains.kotlin.metadata.ProtoBuf.Function(this);
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
         if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
           to_bitField0_ |= 0x00000001;
         }
         result.flags_ = flags_;
-        if (((bitField0_ & 0x00000002) == 0x00000002)) {
-          valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_);
-          bitField0_ = (bitField0_ & ~0x00000002);
+        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+          to_bitField0_ |= 0x00000002;
         }
-        result.valueParameter_ = valueParameter_;
-        if (((bitField0_ & 0x00000004) == 0x00000004)) {
-          versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_);
-          bitField0_ = (bitField0_ & ~0x00000004);
+        result.oldFlags_ = oldFlags_;
+        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+          to_bitField0_ |= 0x00000004;
         }
-        result.versionRequirement_ = versionRequirement_;
-        result.bitField0_ = to_bitField0_;
-        return result;
-      }
-
-      public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor other) {
-        if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance()) return this;
-        if (other.hasFlags()) {
-          setFlags(other.getFlags());
+        result.name_ = name_;
+        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+          to_bitField0_ |= 0x00000008;
         }
-        if (!other.valueParameter_.isEmpty()) {
-          if (valueParameter_.isEmpty()) {
-            valueParameter_ = other.valueParameter_;
-            bitField0_ = (bitField0_ & ~0x00000002);
-          } else {
-            ensureValueParameterIsMutable();
-            valueParameter_.addAll(other.valueParameter_);
-          }
-          
+        result.returnType_ = returnType_;
+        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
+          to_bitField0_ |= 0x00000010;
         }
-        if (!other.versionRequirement_.isEmpty()) {
+        result.returnTypeId_ = returnTypeId_;
+        if (((bitField0_ & 0x00000020) == 0x00000020)) {
+          typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_);
+          bitField0_ = (bitField0_ & ~0x00000020);
+        }
+        result.typeParameter_ = typeParameter_;
+        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
+          to_bitField0_ |= 0x00000020;
+        }
+        result.receiverType_ = receiverType_;
+        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
+          to_bitField0_ |= 0x00000040;
+        }
+        result.receiverTypeId_ = receiverTypeId_;
+        if (((bitField0_ & 0x00000100) == 0x00000100)) {
+          valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_);
+          bitField0_ = (bitField0_ & ~0x00000100);
+        }
+        result.valueParameter_ = valueParameter_;
+        if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
+          to_bitField0_ |= 0x00000080;
+        }
+        result.typeTable_ = typeTable_;
+        if (((bitField0_ & 0x00000400) == 0x00000400)) {
+          versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_);
+          bitField0_ = (bitField0_ & ~0x00000400);
+        }
+        result.versionRequirement_ = versionRequirement_;
+        if (((from_bitField0_ & 0x00000800) == 0x00000800)) {
+          to_bitField0_ |= 0x00000100;
+        }
+        result.contract_ = contract_;
+        result.bitField0_ = to_bitField0_;
+        return result;
+      }
+
+      public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Function other) {
+        if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance()) return this;
+        if (other.hasFlags()) {
+          setFlags(other.getFlags());
+        }
+        if (other.hasOldFlags()) {
+          setOldFlags(other.getOldFlags());
+        }
+        if (other.hasName()) {
+          setName(other.getName());
+        }
+        if (other.hasReturnType()) {
+          mergeReturnType(other.getReturnType());
+        }
+        if (other.hasReturnTypeId()) {
+          setReturnTypeId(other.getReturnTypeId());
+        }
+        if (!other.typeParameter_.isEmpty()) {
+          if (typeParameter_.isEmpty()) {
+            typeParameter_ = other.typeParameter_;
+            bitField0_ = (bitField0_ & ~0x00000020);
+          } else {
+            ensureTypeParameterIsMutable();
+            typeParameter_.addAll(other.typeParameter_);
+          }
+          
+        }
+        if (other.hasReceiverType()) {
+          mergeReceiverType(other.getReceiverType());
+        }
+        if (other.hasReceiverTypeId()) {
+          setReceiverTypeId(other.getReceiverTypeId());
+        }
+        if (!other.valueParameter_.isEmpty()) {
+          if (valueParameter_.isEmpty()) {
+            valueParameter_ = other.valueParameter_;
+            bitField0_ = (bitField0_ & ~0x00000100);
+          } else {
+            ensureValueParameterIsMutable();
+            valueParameter_.addAll(other.valueParameter_);
+          }
+          
+        }
+        if (other.hasTypeTable()) {
+          mergeTypeTable(other.getTypeTable());
+        }
+        if (!other.versionRequirement_.isEmpty()) {
           if (versionRequirement_.isEmpty()) {
             versionRequirement_ = other.versionRequirement_;
-            bitField0_ = (bitField0_ & ~0x00000004);
+            bitField0_ = (bitField0_ & ~0x00000400);
           } else {
             ensureVersionRequirementIsMutable();
             versionRequirement_.addAll(other.versionRequirement_);
           }
           
         }
+        if (other.hasContract()) {
+          mergeContract(other.getContract());
+        }
         this.mergeExtensionFields(other);
         setUnknownFields(
             getUnknownFields().concat(other.unknownFields));
@@ -14132,12 +14071,46 @@ public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor othe
       }
 
       public final boolean isInitialized() {
+        if (!hasName()) {
+          
+          return false;
+        }
+        if (hasReturnType()) {
+          if (!getReturnType().isInitialized()) {
+            
+            return false;
+          }
+        }
+        for (int i = 0; i < getTypeParameterCount(); i++) {
+          if (!getTypeParameter(i).isInitialized()) {
+            
+            return false;
+          }
+        }
+        if (hasReceiverType()) {
+          if (!getReceiverType().isInitialized()) {
+            
+            return false;
+          }
+        }
         for (int i = 0; i < getValueParameterCount(); i++) {
           if (!getValueParameter(i).isInitialized()) {
             
             return false;
           }
         }
+        if (hasTypeTable()) {
+          if (!getTypeTable().isInitialized()) {
+            
+            return false;
+          }
+        }
+        if (hasContract()) {
+          if (!getContract().isInitialized()) {
+            
+            return false;
+          }
+        }
         if (!extensionsAreInitialized()) {
           
           return false;
@@ -14149,11 +14122,11 @@ public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
-        org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parsedMessage = null;
+        org.jetbrains.kotlin.metadata.ProtoBuf.Function parsedMessage = null;
         try {
           parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Constructor) e.getUnfinishedMessage();
+          parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Function) e.getUnfinishedMessage();
           throw e;
         } finally {
           if (parsedMessage != null) {
@@ -14166,12 +14139,20 @@ public Builder mergeFrom(
 
       private int flags_ = 6;
       /**
-       * optional int32 flags = 1 [default = 6];
+       * optional int32 flags = 9 [default = 6];
        *
        * 
        *hasAnnotations
        *Visibility
-       *isSecondary
+       *Modality
+       *MemberKind
+       *isOperator
+       *isInfix
+       *isInline
+       *isTailrec
+       *isExternal
+       *isSuspend
+       *isExpect
        *hasNonStableParameterNames
        * 
*/ @@ -14179,12 +14160,20 @@ public boolean hasFlags() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 9 [default = 6]; * *
        *hasAnnotations
        *Visibility
-       *isSecondary
+       *Modality
+       *MemberKind
+       *isOperator
+       *isInfix
+       *isInline
+       *isTailrec
+       *isExternal
+       *isSuspend
+       *isExpect
        *hasNonStableParameterNames
        * 
*/ @@ -14192,12 +14181,20 @@ public int getFlags() { return flags_; } /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 9 [default = 6]; * *
        *hasAnnotations
        *Visibility
-       *isSecondary
+       *Modality
+       *MemberKind
+       *isOperator
+       *isInfix
+       *isInline
+       *isTailrec
+       *isExternal
+       *isSuspend
+       *isExpect
        *hasNonStableParameterNames
        * 
*/ @@ -14208,12 +14205,20 @@ public Builder setFlags(int value) { return this; } /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 9 [default = 6]; * *
        *hasAnnotations
        *Visibility
-       *isSecondary
+       *Modality
+       *MemberKind
+       *isOperator
+       *isInfix
+       *isInline
+       *isTailrec
+       *isExternal
+       *isSuspend
+       *isExpect
        *hasNonStableParameterNames
        * 
*/ @@ -14224,3974 +14229,569 @@ public Builder clearFlags() { return this; } - private java.util.List valueParameter_ = - java.util.Collections.emptyList(); - private void ensureValueParameterIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - valueParameter_ = new java.util.ArrayList(valueParameter_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public java.util.List getValueParameterList() { - return java.util.Collections.unmodifiableList(valueParameter_); - } + private int oldFlags_ = 6; /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * optional int32 old_flags = 1 [default = 6]; */ - public int getValueParameterCount() { - return valueParameter_.size(); + public boolean hasOldFlags() { + return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * optional int32 old_flags = 1 [default = 6]; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { - return valueParameter_.get(index); + public int getOldFlags() { + return oldFlags_; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * optional int32 old_flags = 1 [default = 6]; */ - public Builder setValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.set(index, value); - + public Builder setOldFlags(int value) { + bitField0_ |= 0x00000002; + oldFlags_ = value; + return this; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * optional int32 old_flags = 1 [default = 6]; */ - public Builder setValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.set(index, builderForValue.build()); - + public Builder clearOldFlags() { + bitField0_ = (bitField0_ & ~0x00000002); + oldFlags_ = 6; + return this; } + + private int name_ ; /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * required int32 name = 2; */ - public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.add(value); - - return this; + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * required int32 name = 2; */ - public Builder addValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.add(index, value); - - return this; + public int getName() { + return name_; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * required int32 name = 2; */ - public Builder addValueParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.add(builderForValue.build()); - + public Builder setName(int value) { + bitField0_ |= 0x00000004; + name_ = value; + return this; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * required int32 name = 2; */ - public Builder addValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.add(index, builderForValue.build()); + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000004); + name_ = 0; + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public boolean hasReturnType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + return returnType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + returnType_ = value; + bitField0_ |= 0x00000008; return this; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public Builder addAllValueParameter( - java.lang.Iterable values) { - ensureValueParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, valueParameter_); + public Builder setReturnType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + returnType_ = builderForValue.build(); + bitField0_ |= 0x00000008; return this; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public Builder clearValueParameter() { - valueParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + returnType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + returnType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); + } else { + returnType_ = value; + } + bitField0_ |= 0x00000008; return this; } /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public Builder removeValueParameter(int index) { - ensureValueParameterIsMutable(); - valueParameter_.remove(index); + public Builder clearReturnType() { + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); return this; } - private java.util.List versionRequirement_ = java.util.Collections.emptyList(); - private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00000004; + private int returnTypeId_ ; + /** + * optional int32 return_type_id = 7; + */ + public boolean hasReturnTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 return_type_id = 7; + */ + public int getReturnTypeId() { + return returnTypeId_; + } + /** + * optional int32 return_type_id = 7; + */ + public Builder setReturnTypeId(int value) { + bitField0_ |= 0x00000010; + returnTypeId_ = value; + + return this; + } + /** + * optional int32 return_type_id = 7; + */ + public Builder clearReturnTypeId() { + bitField0_ = (bitField0_ & ~0x00000010); + returnTypeId_ = 0; + + return this; + } + + private java.util.List typeParameter_ = + java.util.Collections.emptyList(); + private void ensureTypeParameterIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = new java.util.ArrayList(typeParameter_); + bitField0_ |= 0x00000020; } } + /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public java.util.List - getVersionRequirementList() { - return java.util.Collections.unmodifiableList(versionRequirement_); + public java.util.List getTypeParameterList() { + return java.util.Collections.unmodifiableList(typeParameter_); } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); + public int getTypeParameterCount() { + return typeParameter_.size(); } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public Builder setVersionRequirement( - int index, int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.set(index, value); - + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.set(index, value); + return this; } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.set(index, builderForValue.build()); + return this; } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - + public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(value); + return this; } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public Builder clearVersionRequirement() { - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(index, value); + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(builderForValue.build()); - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Constructor) - } + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(index, builderForValue.build()); - static { - defaultInstance = new Constructor(true); - defaultInstance.initFields(); - } + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addAllTypeParameter( + java.lang.Iterable values) { + ensureTypeParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeParameter_); - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Constructor) - } - - public interface FunctionOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Function) - com.google.protobuf.GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 flags = 9 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isOperator
-     *isInfix
-     *isInline
-     *isTailrec
-     *isExternal
-     *isSuspend
-     *isExpect
-     *hasNonStableParameterNames
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 9 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isOperator
-     *isInfix
-     *isInline
-     *isTailrec
-     *isExternal
-     *isSuspend
-     *isExpect
-     *hasNonStableParameterNames
-     * 
- */ - int getFlags(); + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder clearTypeParameter() { + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); - /** - * optional int32 old_flags = 1 [default = 6]; - */ - boolean hasOldFlags(); - /** - * optional int32 old_flags = 1 [default = 6]; - */ - int getOldFlags(); + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder removeTypeParameter(int index) { + ensureTypeParameterIsMutable(); + typeParameter_.remove(index); - /** - * required int32 name = 2; - */ - boolean hasName(); - /** - * required int32 name = 2; - */ - int getName(); + return this; + } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - boolean hasReturnType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType(); + private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public boolean hasReceiverType() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + return receiverType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + receiverType_ = value; - /** - * optional int32 return_type_id = 7; - */ - boolean hasReturnTypeId(); - /** - * optional int32 return_type_id = 7; - */ - int getReturnTypeId(); + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder setReceiverType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + receiverType_ = builderForValue.build(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - java.util.List - getTypeParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - int getTypeParameterCount(); + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000040) == 0x00000040) && + receiverType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + receiverType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); + } else { + receiverType_ = value; + } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - boolean hasReceiverType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType(); + bitField0_ |= 0x00000040; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder clearReceiverType() { + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - /** - * optional int32 receiver_type_id = 8; - */ - boolean hasReceiverTypeId(); - /** - * optional int32 receiver_type_id = 8; - */ - int getReceiverTypeId(); + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - java.util.List - getValueParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - int getValueParameterCount(); + private int receiverTypeId_ ; + /** + * optional int32 receiver_type_id = 8; + */ + public boolean hasReceiverTypeId() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int32 receiver_type_id = 8; + */ + public int getReceiverTypeId() { + return receiverTypeId_; + } + /** + * optional int32 receiver_type_id = 8; + */ + public Builder setReceiverTypeId(int value) { + bitField0_ |= 0x00000080; + receiverTypeId_ = value; + + return this; + } + /** + * optional int32 receiver_type_id = 8; + */ + public Builder clearReceiverTypeId() { + bitField0_ = (bitField0_ & ~0x00000080); + receiverTypeId_ = 0; + + return this; + } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - boolean hasTypeTable(); - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable(); + private java.util.List valueParameter_ = + java.util.Collections.emptyList(); + private void ensureValueParameterIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + valueParameter_ = new java.util.ArrayList(valueParameter_); + bitField0_ |= 0x00000100; + } + } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - java.util.List getVersionRequirementList(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirementCount(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirement(int index); - - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - boolean hasContract(); - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} - */ - public static final class Function extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< - Function> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Function) - FunctionOrBuilder { - // Use Function.newBuilder() to construct. - private Function(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Function(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - - private static final Function defaultInstance; - public static Function getDefaultInstance() { - return defaultInstance; - } - - public Function getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.ByteString unknownFields; - private Function( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000002; - oldFlags_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000004; - name_ = input.readInt32(); - break; - } - case 26: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - subBuilder = returnType_.toBuilder(); - } - returnType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(returnType_); - returnType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000008; - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); - break; - } - case 42: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - subBuilder = receiverType_.toBuilder(); - } - receiverType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(receiverType_); - receiverType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000020; - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - valueParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry)); - break; - } - case 56: { - bitField0_ |= 0x00000010; - returnTypeId_ = input.readInt32(); - break; - } - case 64: { - bitField0_ |= 0x00000040; - receiverTypeId_ = input.readInt32(); - break; - } - case 72: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 242: { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - subBuilder = typeTable_.toBuilder(); - } - typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(typeTable_); - typeTable_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000080; - break; - } - case 248: { - if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; - } - versionRequirement_.add(input.readInt32()); - break; - } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000400) == 0x00000400) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; - } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 258: { - org.jetbrains.kotlin.metadata.ProtoBuf.Contract.Builder subBuilder = null; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - subBuilder = contract_.toBuilder(); - } - contract_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Contract.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(contract_); - contract_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000100; - 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_ & 0x00000020) == 0x00000020)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - } - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); - } - if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Function parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Function(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 9; - private int flags_; - /** - * optional int32 flags = 9 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isOperator
-     *isInfix
-     *isInline
-     *isTailrec
-     *isExternal
-     *isSuspend
-     *isExpect
-     *hasNonStableParameterNames
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 9 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isOperator
-     *isInfix
-     *isInline
-     *isTailrec
-     *isExternal
-     *isSuspend
-     *isExpect
-     *hasNonStableParameterNames
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int OLD_FLAGS_FIELD_NUMBER = 1; - private int oldFlags_; - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public boolean hasOldFlags() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public int getOldFlags() { - return oldFlags_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private int name_; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - - public static final int RETURN_TYPE_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public boolean hasReturnType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { - return returnType_; - } - - public static final int RETURN_TYPE_ID_FIELD_NUMBER = 7; - private int returnTypeId_; - /** - * optional int32 return_type_id = 7; - */ - public boolean hasReturnTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 return_type_id = 7; - */ - public int getReturnTypeId() { - return returnTypeId_; - } - - public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; - private java.util.List typeParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List getTypeParameterList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List - getTypeParameterOrBuilderList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( - int index) { - return typeParameter_.get(index); - } - - public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public boolean hasReceiverType() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { - return receiverType_; - } - - public static final int RECEIVER_TYPE_ID_FIELD_NUMBER = 8; - private int receiverTypeId_; - /** - * optional int32 receiver_type_id = 8; - */ - public boolean hasReceiverTypeId() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 receiver_type_id = 8; - */ - public int getReceiverTypeId() { - return receiverTypeId_; - } - - public static final int VALUE_PARAMETER_FIELD_NUMBER = 6; - private java.util.List valueParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public java.util.List getValueParameterList() { - return valueParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public java.util.List - getValueParameterOrBuilderList() { - return valueParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public int getValueParameterCount() { - return valueParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { - return valueParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( - int index) { - return valueParameter_.get(index); - } - - public static final int TYPE_TABLE_FIELD_NUMBER = 30; - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public boolean hasTypeTable() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { - return typeTable_; - } - - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public java.util.List - getVersionRequirementList() { - return versionRequirement_; - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - - public static final int CONTRACT_FIELD_NUMBER = 32; - private org.jetbrains.kotlin.metadata.ProtoBuf.Contract contract_; - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public boolean hasContract() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract() { - return contract_; - } - - private void initFields() { - flags_ = 6; - oldFlags_ = 6; - name_ = 0; - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - returnTypeId_ = 0; - typeParameter_ = java.util.Collections.emptyList(); - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - receiverTypeId_ = 0; - valueParameter_ = java.util.Collections.emptyList(); - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - versionRequirement_ = java.util.Collections.emptyList(); - contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - if (hasReturnType()) { - if (!getReturnType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasReceiverType()) { - if (!getReceiverType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getValueParameterCount(); i++) { - if (!getValueParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasTypeTable()) { - if (!getTypeTable().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasContract()) { - if (!getContract().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(1, oldFlags_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(2, name_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(3, returnType_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - output.writeMessage(4, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeMessage(5, receiverType_); - } - for (int i = 0; i < valueParameter_.size(); i++) { - output.writeMessage(6, valueParameter_.get(i)); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(7, returnTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeInt32(8, receiverTypeId_); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(9, flags_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeMessage(30, typeTable_); - } - for (int i = 0; i < versionRequirement_.size(); i++) { - output.writeInt32(31, versionRequirement_.get(i)); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeMessage(32, contract_); - } - extensionWriter.writeUntil(19000, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, oldFlags_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, name_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, returnType_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, receiverType_); - } - for (int i = 0; i < valueParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, valueParameter_.get(i)); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, returnTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(8, receiverTypeId_); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(9, flags_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(30, typeTable_); - } - { - int dataSize = 0; - for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(versionRequirement_.get(i)); - } - size += dataSize; - size += 2 * getVersionRequirementList().size(); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(32, contract_); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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.metadata.ProtoBuf.Function parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function 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.metadata.ProtoBuf.Function parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function 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.metadata.ProtoBuf.Function prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.Function, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Function) - org.jetbrains.kotlin.metadata.ProtoBuf.FunctionOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Function.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 6; - bitField0_ = (bitField0_ & ~0x00000001); - oldFlags_ = 6; - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - returnTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000040); - receiverTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000080); - valueParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000200); - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Function getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance(); - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Function build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Function result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Function buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Function result = new org.jetbrains.kotlin.metadata.ProtoBuf.Function(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.oldFlags_ = oldFlags_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.returnType_ = returnType_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.returnTypeId_ = returnTypeId_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.typeParameter_ = typeParameter_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000020; - } - result.receiverType_ = receiverType_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000040; - } - result.receiverTypeId_ = receiverTypeId_; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.valueParameter_ = valueParameter_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000080; - } - result.typeTable_ = typeTable_; - if (((bitField0_ & 0x00000400) == 0x00000400)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00000400); - } - result.versionRequirement_ = versionRequirement_; - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { - to_bitField0_ |= 0x00000100; - } - result.contract_ = contract_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Function other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasOldFlags()) { - setOldFlags(other.getOldFlags()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasReturnType()) { - mergeReturnType(other.getReturnType()); - } - if (other.hasReturnTypeId()) { - setReturnTypeId(other.getReturnTypeId()); - } - if (!other.typeParameter_.isEmpty()) { - if (typeParameter_.isEmpty()) { - typeParameter_ = other.typeParameter_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureTypeParameterIsMutable(); - typeParameter_.addAll(other.typeParameter_); - } - - } - if (other.hasReceiverType()) { - mergeReceiverType(other.getReceiverType()); - } - if (other.hasReceiverTypeId()) { - setReceiverTypeId(other.getReceiverTypeId()); - } - if (!other.valueParameter_.isEmpty()) { - if (valueParameter_.isEmpty()) { - valueParameter_ = other.valueParameter_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureValueParameterIsMutable(); - valueParameter_.addAll(other.valueParameter_); - } - - } - if (other.hasTypeTable()) { - mergeTypeTable(other.getTypeTable()); - } - if (!other.versionRequirement_.isEmpty()) { - if (versionRequirement_.isEmpty()) { - versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00000400); - } else { - ensureVersionRequirementIsMutable(); - versionRequirement_.addAll(other.versionRequirement_); - } - - } - if (other.hasContract()) { - mergeContract(other.getContract()); - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (hasReturnType()) { - if (!getReturnType().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - - return false; - } - } - if (hasReceiverType()) { - if (!getReceiverType().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getValueParameterCount(); i++) { - if (!getValueParameter(i).isInitialized()) { - - return false; - } - } - if (hasTypeTable()) { - if (!getTypeTable().isInitialized()) { - - return false; - } - } - if (hasContract()) { - if (!getContract().isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Function parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Function) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ = 6; - /** - * optional int32 flags = 9 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isOperator
-       *isInfix
-       *isInline
-       *isTailrec
-       *isExternal
-       *isSuspend
-       *isExpect
-       *hasNonStableParameterNames
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 9 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isOperator
-       *isInfix
-       *isInline
-       *isTailrec
-       *isExternal
-       *isSuspend
-       *isExpect
-       *hasNonStableParameterNames
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 9 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isOperator
-       *isInfix
-       *isInline
-       *isTailrec
-       *isExternal
-       *isSuspend
-       *isExpect
-       *hasNonStableParameterNames
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 9 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isOperator
-       *isInfix
-       *isInline
-       *isTailrec
-       *isExternal
-       *isSuspend
-       *isExpect
-       *hasNonStableParameterNames
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 6; - - return this; - } - - private int oldFlags_ = 6; - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public boolean hasOldFlags() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public int getOldFlags() { - return oldFlags_; - } - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public Builder setOldFlags(int value) { - bitField0_ |= 0x00000002; - oldFlags_ = value; - - return this; - } - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public Builder clearOldFlags() { - bitField0_ = (bitField0_ & ~0x00000002); - oldFlags_ = 6; - - return this; - } - - private int name_ ; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 2; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000004; - name_ = value; - - return this; - } - /** - * required int32 name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000004); - name_ = 0; - - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public boolean hasReturnType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { - return returnType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - returnType_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder setReturnType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - returnType_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - returnType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - returnType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); - } else { - returnType_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder clearReturnType() { - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private int returnTypeId_ ; - /** - * optional int32 return_type_id = 7; - */ - public boolean hasReturnTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 return_type_id = 7; - */ - public int getReturnTypeId() { - return returnTypeId_; - } - /** - * optional int32 return_type_id = 7; - */ - public Builder setReturnTypeId(int value) { - bitField0_ |= 0x00000010; - returnTypeId_ = value; - - return this; - } - /** - * optional int32 return_type_id = 7; - */ - public Builder clearReturnTypeId() { - bitField0_ = (bitField0_ & ~0x00000010); - returnTypeId_ = 0; - - return this; - } - - private java.util.List typeParameter_ = - java.util.Collections.emptyList(); - private void ensureTypeParameterIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); - bitField0_ |= 0x00000020; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List getTypeParameterList() { - return java.util.Collections.unmodifiableList(typeParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addAllTypeParameter( - java.lang.Iterable values) { - ensureTypeParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, typeParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder clearTypeParameter() { - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder removeTypeParameter(int index) { - ensureTypeParameterIsMutable(); - typeParameter_.remove(index); - - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public boolean hasReceiverType() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { - return receiverType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - receiverType_ = value; - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder setReceiverType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - receiverType_ = builderForValue.build(); - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (((bitField0_ & 0x00000040) == 0x00000040) && - receiverType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - receiverType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); - } else { - receiverType_ = value; - } - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder clearReceiverType() { - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } - - private int receiverTypeId_ ; - /** - * optional int32 receiver_type_id = 8; - */ - public boolean hasReceiverTypeId() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int32 receiver_type_id = 8; - */ - public int getReceiverTypeId() { - return receiverTypeId_; - } - /** - * optional int32 receiver_type_id = 8; - */ - public Builder setReceiverTypeId(int value) { - bitField0_ |= 0x00000080; - receiverTypeId_ = value; - - return this; - } - /** - * optional int32 receiver_type_id = 8; - */ - public Builder clearReceiverTypeId() { - bitField0_ = (bitField0_ & ~0x00000080); - receiverTypeId_ = 0; - - return this; - } - - private java.util.List valueParameter_ = - java.util.Collections.emptyList(); - private void ensureValueParameterIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = new java.util.ArrayList(valueParameter_); - bitField0_ |= 0x00000100; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public java.util.List getValueParameterList() { - return java.util.Collections.unmodifiableList(valueParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public int getValueParameterCount() { - return valueParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { - return valueParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder setValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder setValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addValueParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addAllValueParameter( - java.lang.Iterable values) { - ensureValueParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, valueParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder clearValueParameter() { - valueParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder removeValueParameter(int index) { - ensureValueParameterIsMutable(); - valueParameter_.remove(index); - - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public boolean hasTypeTable() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { - return typeTable_; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { - if (value == null) { - throw new NullPointerException(); - } - typeTable_ = value; - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder setTypeTable( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { - typeTable_ = builderForValue.build(); - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { - if (((bitField0_ & 0x00000200) == 0x00000200) && - typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { - typeTable_ = - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); - } else { - typeTable_ = value; - } - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder clearTypeTable() { - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000200); - return this; - } - - private java.util.List versionRequirement_ = java.util.Collections.emptyList(); - private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00000400) == 0x00000400)) { - versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00000400; - } - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public java.util.List - getVersionRequirementList() { - return java.util.Collections.unmodifiableList(versionRequirement_); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder setVersionRequirement( - int index, int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.set(index, value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder clearVersionRequirement() { - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.Contract contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public boolean hasContract() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract() { - return contract_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public Builder setContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value) { - if (value == null) { - throw new NullPointerException(); - } - contract_ = value; - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public Builder setContract( - org.jetbrains.kotlin.metadata.ProtoBuf.Contract.Builder builderForValue) { - contract_ = builderForValue.build(); - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public Builder mergeContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value) { - if (((bitField0_ & 0x00000800) == 0x00000800) && - contract_ != org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance()) { - contract_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Contract.newBuilder(contract_).mergeFrom(value).buildPartial(); - } else { - contract_ = value; - } - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public Builder clearContract() { - contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Function) - } - - static { - defaultInstance = new Function(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Function) - } - - public interface PropertyOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Property) - com.google.protobuf.GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 flags = 11 [default = 518]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isVar
-     *hasGetter
-     *hasSetter
-     *isConst
-     *isLateinit
-     *hasConstant
-     *isExternal
-     *isDelegated
-     *isExpect
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 11 [default = 518]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isVar
-     *hasGetter
-     *hasSetter
-     *isConst
-     *isLateinit
-     *hasConstant
-     *isExternal
-     *isDelegated
-     *isExpect
-     * 
- */ - int getFlags(); - - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - boolean hasOldFlags(); - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - int getOldFlags(); - - /** - * required int32 name = 2; - */ - boolean hasName(); - /** - * required int32 name = 2; - */ - int getName(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - boolean hasReturnType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType(); - - /** - * optional int32 return_type_id = 9; - */ - boolean hasReturnTypeId(); - /** - * optional int32 return_type_id = 9; - */ - int getReturnTypeId(); - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - java.util.List - getTypeParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - int getTypeParameterCount(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - boolean hasReceiverType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType(); - - /** - * optional int32 receiver_type_id = 10; - */ - boolean hasReceiverTypeId(); - /** - * optional int32 receiver_type_id = 10; - */ - int getReceiverTypeId(); - - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - boolean hasSetterValueParameter(); - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter(); - - /** - * optional int32 getter_flags = 7; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *isNotDefault
-     *isExternal
-     *isInline
-     *If getter_flags or setter_flags are absent, their value should be computed as follows:
-     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-     *- all other flags are false
-     * 
- */ - boolean hasGetterFlags(); - /** - * optional int32 getter_flags = 7; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *isNotDefault
-     *isExternal
-     *isInline
-     *If getter_flags or setter_flags are absent, their value should be computed as follows:
-     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-     *- all other flags are false
-     * 
- */ - int getGetterFlags(); - - /** - * optional int32 setter_flags = 8; - */ - boolean hasSetterFlags(); - /** - * optional int32 setter_flags = 8; - */ - int getSetterFlags(); - - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - java.util.List getVersionRequirementList(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirementCount(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirement(int index); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} - */ - public static final class Property extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< - Property> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Property) - PropertyOrBuilder { - // Use Property.newBuilder() to construct. - private Property(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Property(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - - private static final Property defaultInstance; - public static Property getDefaultInstance() { - return defaultInstance; - } - - public Property getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.ByteString unknownFields; - private Property( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000002; - oldFlags_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000004; - name_ = input.readInt32(); - break; - } - case 26: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - subBuilder = returnType_.toBuilder(); - } - returnType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(returnType_); - returnType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000008; - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); - break; - } - case 42: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - subBuilder = receiverType_.toBuilder(); - } - receiverType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(receiverType_); - receiverType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000020; - break; - } - case 50: { - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder subBuilder = null; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - subBuilder = setterValueParameter_.toBuilder(); - } - setterValueParameter_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(setterValueParameter_); - setterValueParameter_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000080; - break; - } - case 56: { - bitField0_ |= 0x00000100; - getterFlags_ = input.readInt32(); - break; - } - case 64: { - bitField0_ |= 0x00000200; - setterFlags_ = input.readInt32(); - break; - } - case 72: { - bitField0_ |= 0x00000010; - returnTypeId_ = input.readInt32(); - break; - } - case 80: { - bitField0_ |= 0x00000040; - receiverTypeId_ = input.readInt32(); - break; - } - case 88: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 248: { - if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000800; - } - versionRequirement_.add(input.readInt32()); - break; - } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000800) == 0x00000800) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000800; - } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.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_ & 0x00000020) == 0x00000020)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - } - if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Property parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Property(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 11; - private int flags_; - /** - * optional int32 flags = 11 [default = 518]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isVar
-     *hasGetter
-     *hasSetter
-     *isConst
-     *isLateinit
-     *hasConstant
-     *isExternal
-     *isDelegated
-     *isExpect
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 11 [default = 518]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isVar
-     *hasGetter
-     *hasSetter
-     *isConst
-     *isLateinit
-     *hasConstant
-     *isExternal
-     *isDelegated
-     *isExpect
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int OLD_FLAGS_FIELD_NUMBER = 1; - private int oldFlags_; - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public boolean hasOldFlags() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public int getOldFlags() { - return oldFlags_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private int name_; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - - public static final int RETURN_TYPE_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public boolean hasReturnType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { - return returnType_; - } - - public static final int RETURN_TYPE_ID_FIELD_NUMBER = 9; - private int returnTypeId_; - /** - * optional int32 return_type_id = 9; - */ - public boolean hasReturnTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 return_type_id = 9; - */ - public int getReturnTypeId() { - return returnTypeId_; - } - - public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; - private java.util.List typeParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List getTypeParameterList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List - getTypeParameterOrBuilderList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( - int index) { - return typeParameter_.get(index); - } - - public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public boolean hasReceiverType() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { - return receiverType_; - } - - public static final int RECEIVER_TYPE_ID_FIELD_NUMBER = 10; - private int receiverTypeId_; - /** - * optional int32 receiver_type_id = 10; - */ - public boolean hasReceiverTypeId() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 receiver_type_id = 10; - */ - public int getReceiverTypeId() { - return receiverTypeId_; - } - - public static final int SETTER_VALUE_PARAMETER_FIELD_NUMBER = 6; - private org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter setterValueParameter_; - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public boolean hasSetterValueParameter() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter() { - return setterValueParameter_; - } - - public static final int GETTER_FLAGS_FIELD_NUMBER = 7; - private int getterFlags_; - /** - * optional int32 getter_flags = 7; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *isNotDefault
-     *isExternal
-     *isInline
-     *If getter_flags or setter_flags are absent, their value should be computed as follows:
-     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-     *- all other flags are false
-     * 
- */ - public boolean hasGetterFlags() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional int32 getter_flags = 7; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *isNotDefault
-     *isExternal
-     *isInline
-     *If getter_flags or setter_flags are absent, their value should be computed as follows:
-     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-     *- all other flags are false
-     * 
- */ - public int getGetterFlags() { - return getterFlags_; - } - - public static final int SETTER_FLAGS_FIELD_NUMBER = 8; - private int setterFlags_; - /** - * optional int32 setter_flags = 8; - */ - public boolean hasSetterFlags() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional int32 setter_flags = 8; - */ - public int getSetterFlags() { - return setterFlags_; - } - - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public java.util.List - getVersionRequirementList() { - return versionRequirement_; - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - - private void initFields() { - flags_ = 518; - oldFlags_ = 2054; - name_ = 0; - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - returnTypeId_ = 0; - typeParameter_ = java.util.Collections.emptyList(); - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - receiverTypeId_ = 0; - setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); - getterFlags_ = 0; - setterFlags_ = 0; - versionRequirement_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - if (hasReturnType()) { - if (!getReturnType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasReceiverType()) { - if (!getReceiverType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasSetterValueParameter()) { - if (!getSetterValueParameter().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(1, oldFlags_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(2, name_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(3, returnType_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - output.writeMessage(4, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeMessage(5, receiverType_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeMessage(6, setterValueParameter_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeInt32(7, getterFlags_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeInt32(8, setterFlags_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(9, returnTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeInt32(10, receiverTypeId_); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(11, flags_); - } - for (int i = 0; i < versionRequirement_.size(); i++) { - output.writeInt32(31, versionRequirement_.get(i)); - } - extensionWriter.writeUntil(19000, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, oldFlags_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, name_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, returnType_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, receiverType_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, setterValueParameter_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, getterFlags_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(8, setterFlags_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(9, returnTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(10, receiverTypeId_); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(11, flags_); - } - { - int dataSize = 0; - for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(versionRequirement_.get(i)); - } - size += dataSize; - size += 2 * getVersionRequirementList().size(); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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.metadata.ProtoBuf.Property parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property 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.metadata.ProtoBuf.Property parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property 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.metadata.ProtoBuf.Property prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.Property, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Property) - org.jetbrains.kotlin.metadata.ProtoBuf.PropertyOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Property.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 518; - bitField0_ = (bitField0_ & ~0x00000001); - oldFlags_ = 2054; - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - returnTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000040); - receiverTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000080); - setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000100); - getterFlags_ = 0; - bitField0_ = (bitField0_ & ~0x00000200); - setterFlags_ = 0; - bitField0_ = (bitField0_ & ~0x00000400); - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Property getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(); - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Property build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Property result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.metadata.ProtoBuf.Property buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Property result = new org.jetbrains.kotlin.metadata.ProtoBuf.Property(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.oldFlags_ = oldFlags_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.returnType_ = returnType_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.returnTypeId_ = returnTypeId_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.typeParameter_ = typeParameter_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000020; - } - result.receiverType_ = receiverType_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000040; - } - result.receiverTypeId_ = receiverTypeId_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { - to_bitField0_ |= 0x00000080; - } - result.setterValueParameter_ = setterValueParameter_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000100; - } - result.getterFlags_ = getterFlags_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000200; - } - result.setterFlags_ = setterFlags_; - if (((bitField0_ & 0x00000800) == 0x00000800)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00000800); - } - result.versionRequirement_ = versionRequirement_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Property other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasOldFlags()) { - setOldFlags(other.getOldFlags()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasReturnType()) { - mergeReturnType(other.getReturnType()); - } - if (other.hasReturnTypeId()) { - setReturnTypeId(other.getReturnTypeId()); - } - if (!other.typeParameter_.isEmpty()) { - if (typeParameter_.isEmpty()) { - typeParameter_ = other.typeParameter_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureTypeParameterIsMutable(); - typeParameter_.addAll(other.typeParameter_); - } - - } - if (other.hasReceiverType()) { - mergeReceiverType(other.getReceiverType()); - } - if (other.hasReceiverTypeId()) { - setReceiverTypeId(other.getReceiverTypeId()); - } - if (other.hasSetterValueParameter()) { - mergeSetterValueParameter(other.getSetterValueParameter()); - } - if (other.hasGetterFlags()) { - setGetterFlags(other.getGetterFlags()); - } - if (other.hasSetterFlags()) { - setSetterFlags(other.getSetterFlags()); - } - if (!other.versionRequirement_.isEmpty()) { - if (versionRequirement_.isEmpty()) { - versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00000800); - } else { - ensureVersionRequirementIsMutable(); - versionRequirement_.addAll(other.versionRequirement_); - } - - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (hasReturnType()) { - if (!getReturnType().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - - return false; - } - } - if (hasReceiverType()) { - if (!getReceiverType().isInitialized()) { - - return false; - } - } - if (hasSetterValueParameter()) { - if (!getSetterValueParameter().isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Property parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Property) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ = 518; - /** - * optional int32 flags = 11 [default = 518]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isVar
-       *hasGetter
-       *hasSetter
-       *isConst
-       *isLateinit
-       *hasConstant
-       *isExternal
-       *isDelegated
-       *isExpect
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 11 [default = 518]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isVar
-       *hasGetter
-       *hasSetter
-       *isConst
-       *isLateinit
-       *hasConstant
-       *isExternal
-       *isDelegated
-       *isExpect
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 11 [default = 518]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isVar
-       *hasGetter
-       *hasSetter
-       *isConst
-       *isLateinit
-       *hasConstant
-       *isExternal
-       *isDelegated
-       *isExpect
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 11 [default = 518]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isVar
-       *hasGetter
-       *hasSetter
-       *isConst
-       *isLateinit
-       *hasConstant
-       *isExternal
-       *isDelegated
-       *isExpect
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 518; - - return this; - } - - private int oldFlags_ = 2054; - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public boolean hasOldFlags() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public int getOldFlags() { - return oldFlags_; - } - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public Builder setOldFlags(int value) { - bitField0_ |= 0x00000002; - oldFlags_ = value; - - return this; - } - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public Builder clearOldFlags() { - bitField0_ = (bitField0_ & ~0x00000002); - oldFlags_ = 2054; - - return this; - } - - private int name_ ; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 2; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000004; - name_ = value; - - return this; - } - /** - * required int32 name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000004); - name_ = 0; - - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public boolean hasReturnType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { - return returnType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - returnType_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder setReturnType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - returnType_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - returnType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - returnType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); - } else { - returnType_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder clearReturnType() { - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private int returnTypeId_ ; - /** - * optional int32 return_type_id = 9; - */ - public boolean hasReturnTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 return_type_id = 9; - */ - public int getReturnTypeId() { - return returnTypeId_; - } - /** - * optional int32 return_type_id = 9; - */ - public Builder setReturnTypeId(int value) { - bitField0_ |= 0x00000010; - returnTypeId_ = value; - - return this; - } - /** - * optional int32 return_type_id = 9; - */ - public Builder clearReturnTypeId() { - bitField0_ = (bitField0_ & ~0x00000010); - returnTypeId_ = 0; - - return this; - } - - private java.util.List typeParameter_ = - java.util.Collections.emptyList(); - private void ensureTypeParameterIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); - bitField0_ |= 0x00000020; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List getTypeParameterList() { - return java.util.Collections.unmodifiableList(typeParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addAllTypeParameter( - java.lang.Iterable values) { - ensureTypeParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, typeParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder clearTypeParameter() { - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public Builder removeTypeParameter(int index) { - ensureTypeParameterIsMutable(); - typeParameter_.remove(index); - - return this; + public java.util.List getValueParameterList() { + return java.util.Collections.unmodifiableList(valueParameter_); } - - private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public boolean hasReceiverType() { - return ((bitField0_ & 0x00000040) == 0x00000040); + public int getValueParameterCount() { + return valueParameter_.size(); } /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { - return receiverType_; + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + return valueParameter_.get(index); } /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } - receiverType_ = value; - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder setReceiverType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - receiverType_ = builderForValue.build(); - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (((bitField0_ & 0x00000040) == 0x00000040) && - receiverType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - receiverType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); - } else { - receiverType_ = value; - } + ensureValueParameterIsMutable(); + valueParameter_.set(index, value); - bitField0_ |= 0x00000040; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public Builder clearReceiverType() { - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } + public Builder setValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.set(index, builderForValue.build()); - private int receiverTypeId_ ; - /** - * optional int32 receiver_type_id = 10; - */ - public boolean hasReceiverTypeId() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int32 receiver_type_id = 10; - */ - public int getReceiverTypeId() { - return receiverTypeId_; - } - /** - * optional int32 receiver_type_id = 10; - */ - public Builder setReceiverTypeId(int value) { - bitField0_ |= 0x00000080; - receiverTypeId_ = value; - - return this; - } - /** - * optional int32 receiver_type_id = 10; - */ - public Builder clearReceiverTypeId() { - bitField0_ = (bitField0_ & ~0x00000080); - receiverTypeId_ = 0; - return this; } - - private org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public boolean hasSetterValueParameter() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter() { - return setterValueParameter_; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; + */ + public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueParameterIsMutable(); + valueParameter_.add(value); + + return this; } /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public Builder setSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + public Builder addValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } - setterValueParameter_ = value; + ensureValueParameterIsMutable(); + valueParameter_.add(index, value); - bitField0_ |= 0x00000100; return this; } /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public Builder setSetterValueParameter( + public Builder addValueParameter( org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { - setterValueParameter_ = builderForValue.build(); + ensureValueParameterIsMutable(); + valueParameter_.add(builderForValue.build()); - bitField0_ |= 0x00000100; return this; } /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public Builder mergeSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { - if (((bitField0_ & 0x00000100) == 0x00000100) && - setterValueParameter_ != org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance()) { - setterValueParameter_ = - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.newBuilder(setterValueParameter_).mergeFrom(value).buildPartial(); - } else { - setterValueParameter_ = value; - } + public Builder addValueParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ensureValueParameterIsMutable(); + valueParameter_.add(index, builderForValue.build()); - bitField0_ |= 0x00000100; return this; } /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public Builder clearSetterValueParameter() { - setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + public Builder addAllValueParameter( + java.lang.Iterable values) { + ensureValueParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, valueParameter_); - bitField0_ = (bitField0_ & ~0x00000100); return this; } - - private int getterFlags_ ; /** - * optional int32 getter_flags = 7; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *isNotDefault
-       *isExternal
-       *isInline
-       *If getter_flags or setter_flags are absent, their value should be computed as follows:
-       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-       *- all other flags are false
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public boolean hasGetterFlags() { - return ((bitField0_ & 0x00000200) == 0x00000200); + public Builder clearValueParameter() { + valueParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; } /** - * optional int32 getter_flags = 7; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *isNotDefault
-       *isExternal
-       *isInline
-       *If getter_flags or setter_flags are absent, their value should be computed as follows:
-       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-       *- all other flags are false
-       * 
+ * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public int getGetterFlags() { - return getterFlags_; + public Builder removeValueParameter(int index) { + ensureValueParameterIsMutable(); + valueParameter_.remove(index); + + return this; } + + private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); /** - * optional int32 getter_flags = 7; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *isNotDefault
-       *isExternal
-       *isInline
-       *If getter_flags or setter_flags are absent, their value should be computed as follows:
-       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-       *- all other flags are false
-       * 
+ * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public Builder setGetterFlags(int value) { - bitField0_ |= 0x00000200; - getterFlags_ = value; - - return this; + public boolean hasTypeTable() { + return ((bitField0_ & 0x00000200) == 0x00000200); } /** - * optional int32 getter_flags = 7; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *isNotDefault
-       *isExternal
-       *isInline
-       *If getter_flags or setter_flags are absent, their value should be computed as follows:
-       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-       *- all other flags are false
-       * 
+ * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public Builder clearGetterFlags() { - bitField0_ = (bitField0_ & ~0x00000200); - getterFlags_ = 0; - - return this; + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + return typeTable_; } - - private int setterFlags_ ; /** - * optional int32 setter_flags = 8; + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public boolean hasSetterFlags() { - return ((bitField0_ & 0x00000400) == 0x00000400); + public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + if (value == null) { + throw new NullPointerException(); + } + typeTable_ = value; + + bitField0_ |= 0x00000200; + return this; } /** - * optional int32 setter_flags = 8; + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public int getSetterFlags() { - return setterFlags_; + public Builder setTypeTable( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { + typeTable_ = builderForValue.build(); + + bitField0_ |= 0x00000200; + return this; } /** - * optional int32 setter_flags = 8; + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public Builder setSetterFlags(int value) { - bitField0_ |= 0x00000400; - setterFlags_ = value; - + public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + if (((bitField0_ & 0x00000200) == 0x00000200) && + typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { + typeTable_ = + org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); + } else { + typeTable_ = value; + } + + bitField0_ |= 0x00000200; return this; } /** - * optional int32 setter_flags = 8; + * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public Builder clearSetterFlags() { - bitField0_ = (bitField0_ & ~0x00000400); - setterFlags_ = 0; - + public Builder clearTypeTable() { + typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000200); return this; } private java.util.List versionRequirement_ = java.util.Collections.emptyList(); private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00000800) == 0x00000800)) { + if (!((bitField0_ & 0x00000400) == 0x00000400)) { versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00000800; + bitField0_ |= 0x00000400; } } /** @@ -18240,995 +14840,2017 @@ public Builder setVersionRequirement( return this; } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); + + return this; + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + + return this; + } + + private org.jetbrains.kotlin.metadata.ProtoBuf.Contract contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public boolean hasContract() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract() { + return contract_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; + */ + public Builder setContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value) { + if (value == null) { + throw new NullPointerException(); + } + contract_ = value; + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - + public Builder setContract( + org.jetbrains.kotlin.metadata.ProtoBuf.Contract.Builder builderForValue) { + contract_ = builderForValue.build(); + + bitField0_ |= 0x00000800; return this; } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - + public Builder mergeContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value) { + if (((bitField0_ & 0x00000800) == 0x00000800) && + contract_ != org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance()) { + contract_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Contract.newBuilder(contract_).mergeFrom(value).buildPartial(); + } else { + contract_ = value; + } + + bitField0_ |= 0x00000800; return this; } /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
+ * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ - public Builder clearVersionRequirement() { - versionRequirement_ = java.util.Collections.emptyList(); + public Builder clearContract() { + contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000800); - return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Property) + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Function) + } + + static { + defaultInstance = new Function(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Function) + } + + public interface PropertyOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Property) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { + + /** + * optional int32 flags = 11 [default = 518]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isVar
+     *hasGetter
+     *hasSetter
+     *isConst
+     *isLateinit
+     *hasConstant
+     *isExternal
+     *isDelegated
+     *isExpect
+     * 
+ */ + boolean hasFlags(); + /** + * optional int32 flags = 11 [default = 518]; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *MemberKind
+     *isVar
+     *hasGetter
+     *hasSetter
+     *isConst
+     *isLateinit
+     *hasConstant
+     *isExternal
+     *isDelegated
+     *isExpect
+     * 
+ */ + int getFlags(); + + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + boolean hasOldFlags(); + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + int getOldFlags(); + + /** + * required int32 name = 2; + */ + boolean hasName(); + /** + * required int32 name = 2; + */ + int getName(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + boolean hasReturnType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType(); + + /** + * optional int32 return_type_id = 9; + */ + boolean hasReturnTypeId(); + /** + * optional int32 return_type_id = 9; + */ + int getReturnTypeId(); + + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + java.util.List + getTypeParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + int getTypeParameterCount(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + boolean hasReceiverType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType(); + + /** + * optional int32 receiver_type_id = 10; + */ + boolean hasReceiverTypeId(); + /** + * optional int32 receiver_type_id = 10; + */ + int getReceiverTypeId(); + + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + boolean hasSetterValueParameter(); + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter(); + + /** + * optional int32 getter_flags = 7; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *isNotDefault
+     *isExternal
+     *isInline
+     *If getter_flags or setter_flags are absent, their value should be computed as follows:
+     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+     *- all other flags are false
+     * 
+ */ + boolean hasGetterFlags(); + /** + * optional int32 getter_flags = 7; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *isNotDefault
+     *isExternal
+     *isInline
+     *If getter_flags or setter_flags are absent, their value should be computed as follows:
+     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+     *- all other flags are false
+     * 
+ */ + int getGetterFlags(); + + /** + * optional int32 setter_flags = 8; + */ + boolean hasSetterFlags(); + /** + * optional int32 setter_flags = 8; + */ + int getSetterFlags(); + + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + java.util.List getVersionRequirementList(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirementCount(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirement(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} + */ + public static final class Property extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Property> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Property) + PropertyOrBuilder { + // Use Property.newBuilder() to construct. + private Property(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private Property(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final Property defaultInstance; + public static Property getDefaultInstance() { + return defaultInstance; } - static { - defaultInstance = new Property(true); - defaultInstance.initFields(); + public Property getDefaultInstanceForType() { + return defaultInstance; } - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Property) - } + private final com.google.protobuf.ByteString unknownFields; + private Property( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000002; + oldFlags_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000004; + name_ = input.readInt32(); + break; + } + case 26: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = returnType_.toBuilder(); + } + returnType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(returnType_); + returnType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + break; + } + case 42: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = receiverType_.toBuilder(); + } + receiverType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(receiverType_); + receiverType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 50: { + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = setterValueParameter_.toBuilder(); + } + setterValueParameter_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(setterValueParameter_); + setterValueParameter_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 56: { + bitField0_ |= 0x00000100; + getterFlags_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000200; + setterFlags_ = input.readInt32(); + break; + } + case 72: { + bitField0_ |= 0x00000010; + returnTypeId_ = input.readInt32(); + break; + } + case 80: { + bitField0_ |= 0x00000040; + receiverTypeId_ = input.readInt32(); + break; + } + case 88: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.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_ & 0x00000020) == 0x00000020)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + } + if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Property parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Property(input, extensionRegistry); + } + }; - public interface ValueParameterOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.ValueParameter) - com.google.protobuf.GeneratedMessageLite. - ExtendableMessageOrBuilder { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 11; + private int flags_; /** - * optional int32 flags = 1 [default = 0]; + * optional int32 flags = 11 [default = 518]; * *
      *hasAnnotations
-     *declaresDefault
-     *isCrossinline
-     *isNoinline
+     *Visibility
+     *Modality
+     *MemberKind
+     *isVar
+     *hasGetter
+     *hasSetter
+     *isConst
+     *isLateinit
+     *hasConstant
+     *isExternal
+     *isDelegated
+     *isExpect
      * 
*/ - boolean hasFlags(); + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } /** - * optional int32 flags = 1 [default = 0]; + * optional int32 flags = 11 [default = 518]; * *
      *hasAnnotations
-     *declaresDefault
-     *isCrossinline
-     *isNoinline
+     *Visibility
+     *Modality
+     *MemberKind
+     *isVar
+     *hasGetter
+     *hasSetter
+     *isConst
+     *isLateinit
+     *hasConstant
+     *isExternal
+     *isDelegated
+     *isExpect
      * 
*/ - int getFlags(); + public int getFlags() { + return flags_; + } + + public static final int OLD_FLAGS_FIELD_NUMBER = 1; + private int oldFlags_; + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public boolean hasOldFlags() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public int getOldFlags() { + return oldFlags_; + } + public static final int NAME_FIELD_NUMBER = 2; + private int name_; /** * required int32 name = 2; */ - boolean hasName(); + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } /** * required int32 name = 2; */ - int getName(); + public int getName() { + return name_; + } + public static final int RETURN_TYPE_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_; /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - boolean hasType(); + public boolean hasReturnType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(); + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + return returnType_; + } + public static final int RETURN_TYPE_ID_FIELD_NUMBER = 9; + private int returnTypeId_; /** - * optional int32 type_id = 5; + * optional int32 return_type_id = 9; */ - boolean hasTypeId(); + public boolean hasReturnTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } /** - * optional int32 type_id = 5; + * optional int32 return_type_id = 9; */ - int getTypeId(); + public int getReturnTypeId() { + return returnTypeId_; + } + public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; + private java.util.List typeParameter_; /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - boolean hasVarargElementType(); + public java.util.List getTypeParameterList() { + return typeParameter_; + } /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType(); + public java.util.List + getTypeParameterOrBuilderList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + int index) { + return typeParameter_.get(index); + } + public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_; /** - * optional int32 vararg_element_type_id = 6; + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - boolean hasVarargElementTypeId(); + public boolean hasReceiverType() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } /** - * optional int32 vararg_element_type_id = 6; + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - int getVarargElementTypeId(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} - */ - public static final class ValueParameter extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< - ValueParameter> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.ValueParameter) - ValueParameterOrBuilder { - // Use ValueParameter.newBuilder() to construct. - private ValueParameter(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + return receiverType_; } - @SuppressWarnings("UnusedVariable") - private ValueParameter(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - private static final ValueParameter defaultInstance; - public static ValueParameter getDefaultInstance() { - return defaultInstance; + public static final int RECEIVER_TYPE_ID_FIELD_NUMBER = 10; + private int receiverTypeId_; + /** + * optional int32 receiver_type_id = 10; + */ + public boolean hasReceiverTypeId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 receiver_type_id = 10; + */ + public int getReceiverTypeId() { + return receiverTypeId_; } - public ValueParameter getDefaultInstanceForType() { - return defaultInstance; + public static final int SETTER_VALUE_PARAMETER_FIELD_NUMBER = 6; + private org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter setterValueParameter_; + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public boolean hasSetterValueParameter() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter() { + return setterValueParameter_; } - private final com.google.protobuf.ByteString unknownFields; - private ValueParameter( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - name_ = input.readInt32(); - break; - } - case 26: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = type_.toBuilder(); - } - type_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(type_); - type_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 34: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = varargElementType_.toBuilder(); - } - varargElementType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(varargElementType_); - varargElementType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - case 40: { - bitField0_ |= 0x00000008; - typeId_ = input.readInt32(); - break; - } - case 48: { - bitField0_ |= 0x00000020; - varargElementTypeId_ = input.readInt32(); - 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 { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } + public static final int GETTER_FLAGS_FIELD_NUMBER = 7; + private int getterFlags_; + /** + * optional int32 getter_flags = 7; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *isNotDefault
+     *isExternal
+     *isInline
+     *If getter_flags or setter_flags are absent, their value should be computed as follows:
+     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+     *- all other flags are false
+     * 
+ */ + public boolean hasGetterFlags() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional int32 getter_flags = 7; + * + *
+     *hasAnnotations
+     *Visibility
+     *Modality
+     *isNotDefault
+     *isExternal
+     *isInline
+     *If getter_flags or setter_flags are absent, their value should be computed as follows:
+     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+     *- all other flags are false
+     * 
+ */ + public int getGetterFlags() { + return getterFlags_; } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ValueParameter parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ValueParameter(input, extensionRegistry); - } - }; - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + public static final int SETTER_FLAGS_FIELD_NUMBER = 8; + private int setterFlags_; + /** + * optional int32 setter_flags = 8; + */ + public boolean hasSetterFlags() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional int32 setter_flags = 8; + */ + public int getSetterFlags() { + return setterFlags_; } - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 1; - private int flags_; + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; /** - * optional int32 flags = 1 [default = 0]; + * repeated int32 version_requirement = 31; * *
-     *hasAnnotations
-     *declaresDefault
-     *isCrossinline
-     *isNoinline
+     * Index into the VersionRequirementTable
      * 
*/ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List + getVersionRequirementList() { + return versionRequirement_; } /** - * optional int32 flags = 1 [default = 0]; + * repeated int32 version_requirement = 31; * *
-     *hasAnnotations
-     *declaresDefault
-     *isCrossinline
-     *isNoinline
+     * Index into the VersionRequirementTable
      * 
*/ - public int getFlags() { - return flags_; + public int getVersionRequirementCount() { + return versionRequirement_.size(); } - - public static final int NAME_FIELD_NUMBER = 2; - private int name_; /** - * required int32 name = 2; + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
*/ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + + private void initFields() { + flags_ = 518; + oldFlags_ = 2054; + name_ = 0; + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnTypeId_ = 0; + typeParameter_ = java.util.Collections.emptyList(); + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverTypeId_ = 0; + setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + getterFlags_ = 0; + setterFlags_ = 0; + versionRequirement_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (hasReturnType()) { + if (!getReturnType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasReceiverType()) { + if (!getReceiverType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSetterValueParameter()) { + if (!getSetterValueParameter().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(1, oldFlags_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(2, name_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(3, returnType_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + output.writeMessage(4, typeParameter_.get(i)); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeMessage(5, receiverType_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeMessage(6, setterValueParameter_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeInt32(7, getterFlags_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeInt32(8, setterFlags_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(9, returnTypeId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(10, receiverTypeId_); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(11, flags_); + } + for (int i = 0; i < versionRequirement_.size(); i++) { + output.writeInt32(31, versionRequirement_.get(i)); + } + extensionWriter.writeUntil(19000, output); + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, oldFlags_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, name_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, returnType_); + } + for (int i = 0; i < typeParameter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, typeParameter_.get(i)); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, receiverType_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, setterValueParameter_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, getterFlags_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, setterFlags_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, returnTypeId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, receiverTypeId_); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, flags_); + } + { + int dataSize = 0; + for (int i = 0; i < versionRequirement_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(versionRequirement_.get(i)); + } + size += dataSize; + size += 2 * getVersionRequirementList().size(); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.Property parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property 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.metadata.ProtoBuf.Property parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - - public static final int TYPE_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_; - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { - return type_; + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); } - - public static final int TYPE_ID_FIELD_NUMBER = 5; - private int typeId_; - /** - * optional int32 type_id = 5; - */ - public boolean hasTypeId() { - return ((bitField0_ & 0x00000008) == 0x00000008); + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); } - /** - * optional int32 type_id = 5; - */ - public int getTypeId() { - return typeId_; + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - - public static final int VARARG_ELEMENT_TYPE_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type varargElementType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public boolean hasVarargElementType() { - return ((bitField0_ & 0x00000010) == 0x00000010); + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); } - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType() { - return varargElementType_; + public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); } - public static final int VARARG_ELEMENT_TYPE_ID_FIELD_NUMBER = 6; - private int varargElementTypeId_; - /** - * optional int32 vararg_element_type_id = 6; - */ - public boolean hasVarargElementTypeId() { - return ((bitField0_ & 0x00000020) == 0x00000020); + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Property prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } + /** - * optional int32 vararg_element_type_id = 6; + * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} */ - public int getVarargElementTypeId() { - return varargElementTypeId_; - } + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.Property, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Property) + org.jetbrains.kotlin.metadata.ProtoBuf.PropertyOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Property.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - private void initFields() { - flags_ = 0; - name_ = 0; - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - typeId_ = 0; - varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - varargElementTypeId_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } - if (!hasName()) { - memoizedIsInitialized = 0; - return false; + public Builder clear() { + super.clear(); + flags_ = 518; + bitField0_ = (bitField0_ & ~0x00000001); + oldFlags_ = 2054; + bitField0_ = (bitField0_ & ~0x00000002); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + returnTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000040); + receiverTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000100); + getterFlags_ = 0; + bitField0_ = (bitField0_ & ~0x00000200); + setterFlags_ = 0; + bitField0_ = (bitField0_ & ~0x00000400); + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Property getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Property build() { + org.jetbrains.kotlin.metadata.ProtoBuf.Property result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.Property buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.Property result = new org.jetbrains.kotlin.metadata.ProtoBuf.Property(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.oldFlags_ = oldFlags_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.returnType_ = returnType_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.returnTypeId_ = returnTypeId_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.typeParameter_ = typeParameter_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; + } + result.receiverType_ = receiverType_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000040; + } + result.receiverTypeId_ = receiverTypeId_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000080; + } + result.setterValueParameter_ = setterValueParameter_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000100; + } + result.getterFlags_ = getterFlags_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000200; + } + result.setterFlags_ = setterFlags_; + if (((bitField0_ & 0x00000800) == 0x00000800)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.versionRequirement_ = versionRequirement_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Property other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasOldFlags()) { + setOldFlags(other.getOldFlags()); + } + if (other.hasName()) { + setName(other.getName()); + } + if (other.hasReturnType()) { + mergeReturnType(other.getReturnType()); + } + if (other.hasReturnTypeId()) { + setReturnTypeId(other.getReturnTypeId()); + } + if (!other.typeParameter_.isEmpty()) { + if (typeParameter_.isEmpty()) { + typeParameter_ = other.typeParameter_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTypeParameterIsMutable(); + typeParameter_.addAll(other.typeParameter_); + } + + } + if (other.hasReceiverType()) { + mergeReceiverType(other.getReceiverType()); + } + if (other.hasReceiverTypeId()) { + setReceiverTypeId(other.getReceiverTypeId()); + } + if (other.hasSetterValueParameter()) { + mergeSetterValueParameter(other.getSetterValueParameter()); + } + if (other.hasGetterFlags()) { + setGetterFlags(other.getGetterFlags()); + } + if (other.hasSetterFlags()) { + setSetterFlags(other.getSetterFlags()); + } + if (!other.versionRequirement_.isEmpty()) { + if (versionRequirement_.isEmpty()) { + versionRequirement_ = other.versionRequirement_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureVersionRequirementIsMutable(); + versionRequirement_.addAll(other.versionRequirement_); + } + + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; } - if (hasType()) { - if (!getType().isInitialized()) { - memoizedIsInitialized = 0; + + public final boolean isInitialized() { + if (!hasName()) { + return false; } - } - if (hasVarargElementType()) { - if (!getVarargElementType().isInitialized()) { - memoizedIsInitialized = 0; + if (hasReturnType()) { + if (!getReturnType().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + + return false; + } + } + if (hasReceiverType()) { + if (!getReceiverType().isInitialized()) { + + return false; + } + } + if (hasSetterValueParameter()) { + if (!getSetterValueParameter().isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + return false; } + return true; } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.Property parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Property) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - memoizedIsInitialized = 1; - return true; - } + private int bitField0_; - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, flags_); + private int flags_ = 518; + /** + * optional int32 flags = 11 [default = 518]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isVar
+       *hasGetter
+       *hasSetter
+       *isConst
+       *isLateinit
+       *hasConstant
+       *isExternal
+       *isDelegated
+       *isExpect
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, name_); + /** + * optional int32 flags = 11 [default = 518]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isVar
+       *hasGetter
+       *hasSetter
+       *isConst
+       *isLateinit
+       *hasConstant
+       *isExternal
+       *isDelegated
+       *isExpect
+       * 
+ */ + public int getFlags() { + return flags_; } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(3, type_); + /** + * optional int32 flags = 11 [default = 518]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isVar
+       *hasGetter
+       *hasSetter
+       *isConst
+       *isLateinit
+       *hasConstant
+       *isExternal
+       *isDelegated
+       *isExpect
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 11 [default = 518]; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *MemberKind
+       *isVar
+       *hasGetter
+       *hasSetter
+       *isConst
+       *isLateinit
+       *hasConstant
+       *isExternal
+       *isDelegated
+       *isExpect
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 518; + + return this; + } + + private int oldFlags_ = 2054; + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public boolean hasOldFlags() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public int getOldFlags() { + return oldFlags_; + } + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public Builder setOldFlags(int value) { + bitField0_ |= 0x00000002; + oldFlags_ = value; + + return this; + } + /** + * optional int32 old_flags = 1 [default = 2054]; + */ + public Builder clearOldFlags() { + bitField0_ = (bitField0_ & ~0x00000002); + oldFlags_ = 2054; + + return this; + } + + private int name_ ; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + /** + * required int32 name = 2; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000004; + name_ = value; + + return this; + } + /** + * required int32 name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000004); + name_ = 0; + + return this; } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(4, varargElementType_); + + private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public boolean hasReturnType() { + return ((bitField0_ & 0x00000008) == 0x00000008); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(5, typeId_); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + return returnType_; } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt32(6, varargElementTypeId_); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + returnType_ = value; + + bitField0_ |= 0x00000008; + return this; } - extensionWriter.writeUntil(200, output); - output.writeRawBytes(unknownFields); - } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder setReturnType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + returnType_ = builderForValue.build(); - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + returnType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + returnType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); + } else { + returnType_ = value; + } - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, flags_); + bitField0_ |= 0x00000008; + return this; } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, name_); + /** + * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; + */ + public Builder clearReturnType() { + returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, type_); + + private int returnTypeId_ ; + /** + * optional int32 return_type_id = 9; + */ + public boolean hasReturnTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, varargElementType_); + /** + * optional int32 return_type_id = 9; + */ + public int getReturnTypeId() { + return returnTypeId_; } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, typeId_); + /** + * optional int32 return_type_id = 9; + */ + public Builder setReturnTypeId(int value) { + bitField0_ |= 0x00000010; + returnTypeId_ = value; + + return this; } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, varargElementTypeId_); + /** + * optional int32 return_type_id = 9; + */ + public Builder clearReturnTypeId() { + bitField0_ = (bitField0_ & ~0x00000010); + returnTypeId_ = 0; + + return this; } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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.metadata.ProtoBuf.ValueParameter parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter 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.metadata.ProtoBuf.ValueParameter parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter 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.metadata.ProtoBuf.ValueParameter prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.ValueParameter) - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + private java.util.List typeParameter_ = + java.util.Collections.emptyList(); + private void ensureTypeParameterIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + typeParameter_ = new java.util.ArrayList(typeParameter_); + bitField0_ |= 0x00000020; + } } - private void maybeForceBuilderInitialization() { + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public java.util.List getTypeParameterList() { + return java.util.Collections.unmodifiableList(typeParameter_); } - private static Builder create() { - return new Builder(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.set(index, value); + + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.set(index, builderForValue.build()); - public Builder clear() { - super.clear(); - flags_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000004); - typeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000008); - varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000010); - varargElementTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000020); return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(value); - public Builder clone() { - return create().mergeFrom(buildPartial()); + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(index, value); - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(builderForValue.build()); - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter build() { - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(index, builderForValue.build()); - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter result = new org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.typeId_ = typeId_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.varargElementType_ = varargElementType_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.varargElementTypeId_ = varargElementTypeId_; - result.bitField0_ = to_bitField0_; - return result; + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder addAllTypeParameter( + java.lang.Iterable values) { + ensureTypeParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeParameter_); - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasType()) { - mergeType(other.getType()); - } - if (other.hasTypeId()) { - setTypeId(other.getTypeId()); - } - if (other.hasVarargElementType()) { - mergeVarargElementType(other.getVarargElementType()); - } - if (other.hasVarargElementTypeId()) { - setVarargElementTypeId(other.getVarargElementTypeId()); - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder clearTypeParameter() { + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (hasType()) { - if (!getType().isInitialized()) { - - return false; - } - } - if (hasVarargElementType()) { - if (!getVarargElementType().isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; + */ + public Builder removeTypeParameter(int index) { + ensureTypeParameterIsMutable(); + typeParameter_.remove(index); - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } return this; } - private int bitField0_; - private int flags_ ; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *hasAnnotations
-       *declaresDefault
-       *isCrossinline
-       *isNoinline
-       * 
+ * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public boolean hasReceiverType() { + return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *hasAnnotations
-       *declaresDefault
-       *isCrossinline
-       *isNoinline
-       * 
+ * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public int getFlags() { - return flags_; + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + return receiverType_; } /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *hasAnnotations
-       *declaresDefault
-       *isCrossinline
-       *isNoinline
-       * 
+ * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - + public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + receiverType_ = value; + + bitField0_ |= 0x00000040; return this; } /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *hasAnnotations
-       *declaresDefault
-       *isCrossinline
-       *isNoinline
-       * 
+ * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 0; - + public Builder setReceiverType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + receiverType_ = builderForValue.build(); + + bitField0_ |= 0x00000040; return this; } + /** + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; + */ + public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000040) == 0x00000040) && + receiverType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + receiverType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); + } else { + receiverType_ = value; + } - private int name_ ; + bitField0_ |= 0x00000040; + return this; + } /** - * required int32 name = 2; + * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public Builder clearReceiverType() { + receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + private int receiverTypeId_ ; + /** + * optional int32 receiver_type_id = 10; + */ + public boolean hasReceiverTypeId() { + return ((bitField0_ & 0x00000080) == 0x00000080); } /** - * required int32 name = 2; + * optional int32 receiver_type_id = 10; */ - public int getName() { - return name_; + public int getReceiverTypeId() { + return receiverTypeId_; } /** - * required int32 name = 2; + * optional int32 receiver_type_id = 10; */ - public Builder setName(int value) { - bitField0_ |= 0x00000002; - name_ = value; + public Builder setReceiverTypeId(int value) { + bitField0_ |= 0x00000080; + receiverTypeId_ = value; return this; } /** - * required int32 name = 2; + * optional int32 receiver_type_id = 10; */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; + public Builder clearReceiverTypeId() { + bitField0_ = (bitField0_ & ~0x00000080); + receiverTypeId_ = 0; return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); + public boolean hasSetterValueParameter() { + return ((bitField0_ & 0x00000100) == 0x00000100); } /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { - return type_; + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter() { + return setterValueParameter_; } /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + setterValueParameter_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000100; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public Builder setType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - type_ = builderForValue.build(); + public Builder setSetterValueParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + setterValueParameter_ = builderForValue.build(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000100; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - type_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - type_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); + public Builder mergeSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + if (((bitField0_ & 0x00000100) == 0x00000100) && + setterValueParameter_ != org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance()) { + setterValueParameter_ = + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.newBuilder(setterValueParameter_).mergeFrom(value).buildPartial(); } else { - type_ = value; + setterValueParameter_ = value; } - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000100; return this; } /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; + * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public Builder clearType() { - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + public Builder clearSetterValueParameter() { + setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000100); return this; } - private int typeId_ ; + private int getterFlags_ ; /** - * optional int32 type_id = 5; + * optional int32 getter_flags = 7; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *isNotDefault
+       *isExternal
+       *isInline
+       *If getter_flags or setter_flags are absent, their value should be computed as follows:
+       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+       *- all other flags are false
+       * 
*/ - public boolean hasTypeId() { - return ((bitField0_ & 0x00000008) == 0x00000008); + public boolean hasGetterFlags() { + return ((bitField0_ & 0x00000200) == 0x00000200); } /** - * optional int32 type_id = 5; + * optional int32 getter_flags = 7; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *isNotDefault
+       *isExternal
+       *isInline
+       *If getter_flags or setter_flags are absent, their value should be computed as follows:
+       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+       *- all other flags are false
+       * 
*/ - public int getTypeId() { - return typeId_; + public int getGetterFlags() { + return getterFlags_; } /** - * optional int32 type_id = 5; + * optional int32 getter_flags = 7; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *isNotDefault
+       *isExternal
+       *isInline
+       *If getter_flags or setter_flags are absent, their value should be computed as follows:
+       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+       *- all other flags are false
+       * 
*/ - public Builder setTypeId(int value) { - bitField0_ |= 0x00000008; - typeId_ = value; + public Builder setGetterFlags(int value) { + bitField0_ |= 0x00000200; + getterFlags_ = value; return this; } /** - * optional int32 type_id = 5; + * optional int32 getter_flags = 7; + * + *
+       *hasAnnotations
+       *Visibility
+       *Modality
+       *isNotDefault
+       *isExternal
+       *isInline
+       *If getter_flags or setter_flags are absent, their value should be computed as follows:
+       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
+       *- all other flags are false
+       * 
*/ - public Builder clearTypeId() { - bitField0_ = (bitField0_ & ~0x00000008); - typeId_ = 0; + public Builder clearGetterFlags() { + bitField0_ = (bitField0_ & ~0x00000200); + getterFlags_ = 0; return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private int setterFlags_ ; /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + * optional int32 setter_flags = 8; */ - public boolean hasVarargElementType() { - return ((bitField0_ & 0x00000010) == 0x00000010); + public boolean hasSetterFlags() { + return ((bitField0_ & 0x00000400) == 0x00000400); } /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + * optional int32 setter_flags = 8; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType() { - return varargElementType_; + public int getSetterFlags() { + return setterFlags_; } /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + * optional int32 setter_flags = 8; */ - public Builder setVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - varargElementType_ = value; - - bitField0_ |= 0x00000010; + public Builder setSetterFlags(int value) { + bitField0_ |= 0x00000400; + setterFlags_ = value; + return this; } /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + * optional int32 setter_flags = 8; */ - public Builder setVarargElementType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - varargElementType_ = builderForValue.build(); - - bitField0_ |= 0x00000010; + public Builder clearSetterFlags() { + bitField0_ = (bitField0_ & ~0x00000400); + setterFlags_ = 0; + return this; } + + private java.util.List versionRequirement_ = java.util.Collections.emptyList(); + private void ensureVersionRequirementIsMutable() { + if (!((bitField0_ & 0x00000800) == 0x00000800)) { + versionRequirement_ = new java.util.ArrayList(versionRequirement_); + bitField0_ |= 0x00000800; + } + } /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public Builder mergeVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (((bitField0_ & 0x00000010) == 0x00000010) && - varargElementType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - varargElementType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(varargElementType_).mergeFrom(value).buildPartial(); - } else { - varargElementType_ = value; - } - - bitField0_ |= 0x00000010; - return this; + public java.util.List + getVersionRequirementList() { + return java.util.Collections.unmodifiableList(versionRequirement_); } /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public Builder clearVarargElementType() { - varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000010); - return this; + public int getVersionRequirementCount() { + return versionRequirement_.size(); } - - private int varargElementTypeId_ ; /** - * optional int32 vararg_element_type_id = 6; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public boolean hasVarargElementTypeId() { - return ((bitField0_ & 0x00000020) == 0x00000020); + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public Builder setVersionRequirement( + int index, int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.set(index, value); + + return this; } /** - * optional int32 vararg_element_type_id = 6; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public int getVarargElementTypeId() { - return varargElementTypeId_; + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; } /** - * optional int32 vararg_element_type_id = 6; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public Builder setVarargElementTypeId(int value) { - bitField0_ |= 0x00000020; - varargElementTypeId_ = value; + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); return this; } /** - * optional int32 vararg_element_type_id = 6; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public Builder clearVarargElementTypeId() { - bitField0_ = (bitField0_ & ~0x00000020); - varargElementTypeId_ = 0; + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.ValueParameter) + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Property) } static { - defaultInstance = new ValueParameter(true); + defaultInstance = new Property(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.ValueParameter) + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Property) } - public interface TypeAliasOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeAlias) + public interface ValueParameterOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.ValueParameter) com.google.protobuf.GeneratedMessageLite. - ExtendableMessageOrBuilder { + ExtendableMessageOrBuilder { /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 1 [default = 0]; * *
      *hasAnnotations
-     *Visibility
+     *declaresDefault
+     *isCrossinline
+     *isNoinline
      * 
*/ boolean hasFlags(); /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 1 [default = 0]; * *
      *hasAnnotations
-     *Visibility
+     *declaresDefault
+     *isCrossinline
+     *isNoinline
      * 
*/ int getFlags(); @@ -19243,126 +16865,72 @@ public interface TypeAliasOrBuilder extends int getName(); /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - java.util.List - getTypeParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - int getTypeParameterCount(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - boolean hasUnderlyingType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType(); - - /** - * optional int32 underlying_type_id = 5; - */ - boolean hasUnderlyingTypeId(); - /** - * optional int32 underlying_type_id = 5; - */ - int getUnderlyingTypeId(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - boolean hasExpandedType(); + boolean hasType(); /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType(); + org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(); /** - * optional int32 expanded_type_id = 7; + * optional int32 type_id = 5; */ - boolean hasExpandedTypeId(); + boolean hasTypeId(); /** - * optional int32 expanded_type_id = 7; + * optional int32 type_id = 5; */ - int getExpandedTypeId(); + int getTypeId(); /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - java.util.List - getAnnotationList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index); + boolean hasVarargElementType(); /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - int getAnnotationCount(); + org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType(); /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - java.util.List getVersionRequirementList(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
+ * optional int32 vararg_element_type_id = 6; */ - int getVersionRequirementCount(); + boolean hasVarargElementTypeId(); /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
+ * optional int32 vararg_element_type_id = 6; */ - int getVersionRequirement(int index); + int getVarargElementTypeId(); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} + * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} */ - public static final class TypeAlias extends + public static final class ValueParameter extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage< - TypeAlias> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeAlias) - TypeAliasOrBuilder { - // Use TypeAlias.newBuilder() to construct. - private TypeAlias(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + ValueParameter> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.ValueParameter) + ValueParameterOrBuilder { + // Use ValueParameter.newBuilder() to construct. + private ValueParameter(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private TypeAlias(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private ValueParameter(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - private static final TypeAlias defaultInstance; - public static TypeAlias getDefaultInstance() { + private static final ValueParameter defaultInstance; + public static ValueParameter getDefaultInstance() { return defaultInstance; } - public TypeAlias getDefaultInstanceForType() { + public ValueParameter getDefaultInstanceForType() { return defaultInstance; } private final com.google.protobuf.ByteString unknownFields; - private TypeAlias( + private ValueParameter( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); - int mutable_bitField0_ = 0; com.google.protobuf.ByteString.Output unknownFieldsOutput = com.google.protobuf.ByteString.newOutput(); com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = @@ -19394,76 +16962,39 @@ private TypeAlias( break; } case 26: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); - break; - } - case 34: { org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = underlyingType_.toBuilder(); + subBuilder = type_.toBuilder(); } - underlyingType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + type_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(underlyingType_); - underlyingType_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(type_); + type_ = subBuilder.buildPartial(); } bitField0_ |= 0x00000004; break; } - case 40: { - bitField0_ |= 0x00000008; - underlyingTypeId_ = input.readInt32(); - break; - } - case 50: { + case 34: { org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = expandedType_.toBuilder(); + subBuilder = varargElementType_.toBuilder(); } - expandedType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + varargElementType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(expandedType_); - expandedType_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(varargElementType_); + varargElementType_ = subBuilder.buildPartial(); } bitField0_ |= 0x00000010; break; } - case 56: { - bitField0_ |= 0x00000020; - expandedTypeId_ = input.readInt32(); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; - } - annotation_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.PARSER, extensionRegistry)); - break; - } - case 248: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - versionRequirement_.add(input.readInt32()); + case 40: { + bitField0_ |= 0x00000008; + typeId_ = input.readInt32(); break; } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.add(input.readInt32()); - } - input.popLimit(limit); + case 48: { + bitField0_ |= 0x00000020; + varargElementTypeId_ = input.readInt32(); break; } } @@ -19473,16 +17004,7 @@ private TypeAlias( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - } - if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = java.util.Collections.unmodifiableList(annotation_); - } - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - } + } finally { try { unknownFieldsCodedOutput.flush(); } catch (java.io.IOException e) { @@ -19493,18 +17015,18 @@ private TypeAlias( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public TypeAlias parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ValueParameter parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TypeAlias(input, extensionRegistry); + return new ValueParameter(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @@ -19512,22 +17034,26 @@ public com.google.protobuf.Parser getParserForType() { public static final int FLAGS_FIELD_NUMBER = 1; private int flags_; /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 1 [default = 0]; * *
      *hasAnnotations
-     *Visibility
+     *declaresDefault
+     *isCrossinline
+     *isNoinline
      * 
*/ public boolean hasFlags() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 flags = 1 [default = 6]; + * optional int32 flags = 1 [default = 0]; * *
      *hasAnnotations
-     *Visibility
+     *declaresDefault
+     *isCrossinline
+     *isNoinline
      * 
*/ public int getFlags() { @@ -19549,2113 +17075,2349 @@ public int getName() { return name_; } - public static final int TYPE_PARAMETER_FIELD_NUMBER = 3; - private java.util.List typeParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public java.util.List getTypeParameterList() { - return typeParameter_; - } + public static final int TYPE_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_; /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - public java.util.List - getTypeParameterOrBuilderList() { - return typeParameter_; + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - public int getTypeParameterCount() { - return typeParameter_.size(); + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + return type_; } + + public static final int TYPE_ID_FIELD_NUMBER = 5; + private int typeId_; /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + * optional int32 type_id = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); + public boolean hasTypeId() { + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + * optional int32 type_id = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( - int index) { - return typeParameter_.get(index); + public int getTypeId() { + return typeId_; } - public static final int UNDERLYING_TYPE_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type underlyingType_; + public static final int VARARG_ELEMENT_TYPE_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type varargElementType_; /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - public boolean hasUnderlyingType() { - return ((bitField0_ & 0x00000004) == 0x00000004); + public boolean hasVarargElementType() { + return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType() { - return underlyingType_; + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType() { + return varargElementType_; } - public static final int UNDERLYING_TYPE_ID_FIELD_NUMBER = 5; - private int underlyingTypeId_; + public static final int VARARG_ELEMENT_TYPE_ID_FIELD_NUMBER = 6; + private int varargElementTypeId_; /** - * optional int32 underlying_type_id = 5; + * optional int32 vararg_element_type_id = 6; */ - public boolean hasUnderlyingTypeId() { - return ((bitField0_ & 0x00000008) == 0x00000008); + public boolean hasVarargElementTypeId() { + return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * optional int32 underlying_type_id = 5; + * optional int32 vararg_element_type_id = 6; */ - public int getUnderlyingTypeId() { - return underlyingTypeId_; + public int getVarargElementTypeId() { + return varargElementTypeId_; } - public static final int EXPANDED_TYPE_FIELD_NUMBER = 6; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type expandedType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public boolean hasExpandedType() { - return ((bitField0_ & 0x00000010) == 0x00000010); + private void initFields() { + flags_ = 0; + name_ = 0; + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + typeId_ = 0; + varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + varargElementTypeId_ = 0; } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType() { - return expandedType_; + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + if (hasType()) { + if (!getType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasVarargElementType()) { + if (!getVarargElementType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; } - public static final int EXPANDED_TYPE_ID_FIELD_NUMBER = 7; - private int expandedTypeId_; - /** - * optional int32 expanded_type_id = 7; - */ - public boolean hasExpandedTypeId() { - return ((bitField0_ & 0x00000020) == 0x00000020); + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, flags_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, name_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(3, type_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(4, varargElementType_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(5, typeId_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(6, varargElementTypeId_); + } + extensionWriter.writeUntil(200, output); + output.writeRawBytes(unknownFields); } - /** - * optional int32 expanded_type_id = 7; - */ - public int getExpandedTypeId() { - return expandedTypeId_; + + 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, flags_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, name_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, type_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, varargElementType_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, typeId_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, varargElementTypeId_); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; } - public static final int ANNOTATION_FIELD_NUMBER = 8; - private java.util.List annotation_; - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public java.util.List getAnnotationList() { - return annotation_; + 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.metadata.ProtoBuf.ValueParameter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter 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.metadata.ProtoBuf.ValueParameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public java.util.List - getAnnotationOrBuilderList() { - return annotation_; + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public int getAnnotationCount() { - return annotation_.size(); + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index) { - return annotation_.get(index); + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder( - int index) { - return annotation_.get(index); + public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); } - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public java.util.List - getVersionRequirementList() { - return versionRequirement_; - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } + /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
+ * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.ValueParameter) + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - private void initFields() { - flags_ = 6; - name_ = 0; - typeParameter_ = java.util.Collections.emptyList(); - underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - underlyingTypeId_ = 0; - expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - expandedTypeId_ = 0; - annotation_ = java.util.Collections.emptyList(); - versionRequirement_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } - if (!hasName()) { - memoizedIsInitialized = 0; - return false; + public Builder clear() { + super.clear(); + flags_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + typeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000010); + varargElementTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter build() { + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter result = new org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.typeId_ = typeId_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.varargElementType_ = varargElementType_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.varargElementTypeId_ = varargElementTypeId_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasName()) { + setName(other.getName()); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (other.hasTypeId()) { + setTypeId(other.getTypeId()); + } + if (other.hasVarargElementType()) { + mergeVarargElementType(other.getVarargElementType()); + } + if (other.hasVarargElementTypeId()) { + setVarargElementTypeId(other.getVarargElementTypeId()); + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + + return false; + } + if (hasType()) { + if (!getType().isInitialized()) { + + return false; + } + } + if (hasVarargElementType()) { + if (!getVarargElementType().isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int flags_ ; + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *hasAnnotations
+       *declaresDefault
+       *isCrossinline
+       *isNoinline
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *hasAnnotations
+       *declaresDefault
+       *isCrossinline
+       *isNoinline
+       * 
+ */ + public int getFlags() { + return flags_; } - if (hasUnderlyingType()) { - if (!getUnderlyingType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *hasAnnotations
+       *declaresDefault
+       *isCrossinline
+       *isNoinline
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; } - if (hasExpandedType()) { - if (!getExpandedType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } + /** + * optional int32 flags = 1 [default = 0]; + * + *
+       *hasAnnotations
+       *declaresDefault
+       *isCrossinline
+       *isNoinline
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 0; + + return this; } - for (int i = 0; i < getAnnotationCount(); i++) { - if (!getAnnotation(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } + + private int name_ ; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + /** + * required int32 name = 2; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000002; + name_ = value; + + return this; + } + /** + * required int32 name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = 0; + + return this; } - memoizedIsInitialized = 1; - return true; - } - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, flags_); + private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, name_); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + return type_; } - for (int i = 0; i < typeParameter_.size(); i++) { - output.writeMessage(3, typeParameter_.get(i)); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + + bitField0_ |= 0x00000004; + return this; } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(4, underlyingType_); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public Builder setType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + type_ = builderForValue.build(); + + bitField0_ |= 0x00000004; + return this; } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(5, underlyingTypeId_); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + type_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + type_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + + bitField0_ |= 0x00000004; + return this; } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(6, expandedType_); + /** + * optional .org.jetbrains.kotlin.metadata.Type type = 3; + */ + public Builder clearType() { + type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000004); + return this; } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt32(7, expandedTypeId_); + + private int typeId_ ; + /** + * optional int32 type_id = 5; + */ + public boolean hasTypeId() { + return ((bitField0_ & 0x00000008) == 0x00000008); } - for (int i = 0; i < annotation_.size(); i++) { - output.writeMessage(8, annotation_.get(i)); + /** + * optional int32 type_id = 5; + */ + public int getTypeId() { + return typeId_; } - for (int i = 0; i < versionRequirement_.size(); i++) { - output.writeInt32(31, versionRequirement_.get(i)); + /** + * optional int32 type_id = 5; + */ + public Builder setTypeId(int value) { + bitField0_ |= 0x00000008; + typeId_ = value; + + return this; + } + /** + * optional int32 type_id = 5; + */ + public Builder clearTypeId() { + bitField0_ = (bitField0_ & ~0x00000008); + typeId_ = 0; + + return this; } - extensionWriter.writeUntil(200, output); - output.writeRawBytes(unknownFields); - } - - 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, flags_); + private org.jetbrains.kotlin.metadata.ProtoBuf.Type varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public boolean hasVarargElementType() { + return ((bitField0_ & 0x00000010) == 0x00000010); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, name_); + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType() { + return varargElementType_; } - for (int i = 0; i < typeParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, typeParameter_.get(i)); + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public Builder setVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); + } + varargElementType_ = value; + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public Builder setVarargElementType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + varargElementType_ = builderForValue.build(); + + bitField0_ |= 0x00000010; + return this; } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, underlyingType_); + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public Builder mergeVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + varargElementType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + varargElementType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(varargElementType_).mergeFrom(value).buildPartial(); + } else { + varargElementType_ = value; + } + + bitField0_ |= 0x00000010; + return this; } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, underlyingTypeId_); + /** + * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; + */ + public Builder clearVarargElementType() { + varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000010); + return this; } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, expandedType_); + + private int varargElementTypeId_ ; + /** + * optional int32 vararg_element_type_id = 6; + */ + public boolean hasVarargElementTypeId() { + return ((bitField0_ & 0x00000020) == 0x00000020); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, expandedTypeId_); + /** + * optional int32 vararg_element_type_id = 6; + */ + public int getVarargElementTypeId() { + return varargElementTypeId_; } - for (int i = 0; i < annotation_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, annotation_.get(i)); + /** + * optional int32 vararg_element_type_id = 6; + */ + public Builder setVarargElementTypeId(int value) { + bitField0_ |= 0x00000020; + varargElementTypeId_ = value; + + return this; } - { - int dataSize = 0; - for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(versionRequirement_.get(i)); - } - size += dataSize; - size += 2 * getVersionRequirementList().size(); + /** + * optional int32 vararg_element_type_id = 6; + */ + public Builder clearVarargElementTypeId() { + bitField0_ = (bitField0_ & ~0x00000020); + varargElementTypeId_ = 0; + + return this; } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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(); + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.ValueParameter) } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias 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.metadata.ProtoBuf.TypeAlias parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + static { + defaultInstance = new ValueParameter(true); + defaultInstance.initFields(); } - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.ValueParameter) + } + + public interface TypeAliasOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeAlias) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     * 
*/ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeAlias) - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAliasOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + boolean hasFlags(); + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     * 
+ */ + int getFlags(); - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } + /** + * required int32 name = 2; + */ + boolean hasName(); + /** + * required int32 name = 2; + */ + int getName(); - public Builder clear() { - super.clear(); - flags_ = 6; - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - underlyingTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000020); - expandedTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000040); - annotation_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - return this; - } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + java.util.List + getTypeParameterList(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + int getTypeParameterCount(); - public Builder clone() { - return create().mergeFrom(buildPartial()); - } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + boolean hasUnderlyingType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType(); + + /** + * optional int32 underlying_type_id = 5; + */ + boolean hasUnderlyingTypeId(); + /** + * optional int32 underlying_type_id = 5; + */ + int getUnderlyingTypeId(); + + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + boolean hasExpandedType(); + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType(); + + /** + * optional int32 expanded_type_id = 7; + */ + boolean hasExpandedTypeId(); + /** + * optional int32 expanded_type_id = 7; + */ + int getExpandedTypeId(); - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance(); - } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + java.util.List + getAnnotationList(); + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index); + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + int getAnnotationCount(); - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias build() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + java.util.List getVersionRequirementList(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirementCount(); + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + int getVersionRequirement(int index); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} + */ + public static final class TypeAlias extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + TypeAlias> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeAlias) + TypeAliasOrBuilder { + // Use TypeAlias.newBuilder() to construct. + private TypeAlias(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private TypeAlias(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.name_ = name_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.typeParameter_ = typeParameter_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000004; - } - result.underlyingType_ = underlyingType_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000008; - } - result.underlyingTypeId_ = underlyingTypeId_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000010; - } - result.expandedType_ = expandedType_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000020; - } - result.expandedTypeId_ = expandedTypeId_; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = java.util.Collections.unmodifiableList(annotation_); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.annotation_ = annotation_; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.versionRequirement_ = versionRequirement_; - result.bitField0_ = to_bitField0_; - return result; - } + private static final TypeAlias defaultInstance; + public static TypeAlias getDefaultInstance() { + return defaultInstance; + } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (!other.typeParameter_.isEmpty()) { - if (typeParameter_.isEmpty()) { - typeParameter_ = other.typeParameter_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureTypeParameterIsMutable(); - typeParameter_.addAll(other.typeParameter_); - } - - } - if (other.hasUnderlyingType()) { - mergeUnderlyingType(other.getUnderlyingType()); - } - if (other.hasUnderlyingTypeId()) { - setUnderlyingTypeId(other.getUnderlyingTypeId()); - } - if (other.hasExpandedType()) { - mergeExpandedType(other.getExpandedType()); - } - if (other.hasExpandedTypeId()) { - setExpandedTypeId(other.getExpandedTypeId()); - } - if (!other.annotation_.isEmpty()) { - if (annotation_.isEmpty()) { - annotation_ = other.annotation_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureAnnotationIsMutable(); - annotation_.addAll(other.annotation_); - } - - } - if (!other.versionRequirement_.isEmpty()) { - if (versionRequirement_.isEmpty()) { - versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureVersionRequirementIsMutable(); - versionRequirement_.addAll(other.versionRequirement_); - } - - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } + public TypeAlias getDefaultInstanceForType() { + return defaultInstance; + } - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - - return false; - } - } - if (hasUnderlyingType()) { - if (!getUnderlyingType().isInitialized()) { - - return false; + private final com.google.protobuf.ByteString unknownFields; + private TypeAlias( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + flags_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + name_ = input.readInt32(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + typeParameter_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + break; + } + case 34: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = underlyingType_.toBuilder(); + } + underlyingType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(underlyingType_); + underlyingType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 40: { + bitField0_ |= 0x00000008; + underlyingTypeId_ = input.readInt32(); + break; + } + case 50: { + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = expandedType_.toBuilder(); + } + expandedType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expandedType_); + expandedType_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 56: { + bitField0_ |= 0x00000020; + expandedTypeId_ = input.readInt32(); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + annotation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + annotation_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.PARSER, extensionRegistry)); + break; + } + case 248: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + versionRequirement_.add(input.readInt32()); + break; + } + case 250: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100) && input.getBytesUntilLimit() > 0) { + versionRequirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + while (input.getBytesUntilLimit() > 0) { + versionRequirement_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } } } - if (hasExpandedType()) { - if (!getExpandedType().isInitialized()) { - - return false; - } + } 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_ & 0x00000004) == 0x00000004)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); } - for (int i = 0; i < getAnnotationCount(); i++) { - if (!getAnnotation(i).isInitialized()) { - - return false; - } + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); } - if (!extensionsAreInitialized()) { - - return false; + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parsedMessage = null; try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias) e.getUnfinishedMessage(); - throw e; + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ = 6; - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 6; - - return this; - } - - private int name_ ; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 2; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000002; - name_ = value; - - return this; - } - /** - * required int32 name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; - - return this; - } - - private java.util.List typeParameter_ = - java.util.Collections.emptyList(); - private void ensureTypeParameterIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); - bitField0_ |= 0x00000004; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public java.util.List getTypeParameterList() { - return java.util.Collections.unmodifiableList(typeParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); + unknownFields = unknownFieldsOutput.toByteString(); } - ensureTypeParameterIsMutable(); - typeParameter_.add(value); - - return this; + makeExtensionsImmutable(); } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(index, value); - - return this; + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TypeAlias parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TypeAlias(input, extensionRegistry); } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addTypeParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(builderForValue.build()); + }; - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(index, builderForValue.build()); + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addAllTypeParameter( - java.lang.Iterable values) { - ensureTypeParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, typeParameter_); + private int bitField0_; + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+     *hasAnnotations
+     *Visibility
+     * 
+ */ + public int getFlags() { + return flags_; + } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder clearTypeParameter() { - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + public static final int NAME_FIELD_NUMBER = 2; + private int name_; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder removeTypeParameter(int index) { - ensureTypeParameterIsMutable(); - typeParameter_.remove(index); + public static final int TYPE_PARAMETER_FIELD_NUMBER = 3; + private java.util.List typeParameter_; + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public java.util.List getTypeParameterList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public java.util.List + getTypeParameterOrBuilderList() { + return typeParameter_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + int index) { + return typeParameter_.get(index); + } - return this; - } + public static final int UNDERLYING_TYPE_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type underlyingType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public boolean hasUnderlyingType() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType() { + return underlyingType_; + } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public boolean hasUnderlyingType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType() { - return underlyingType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public Builder setUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - underlyingType_ = value; + public static final int UNDERLYING_TYPE_ID_FIELD_NUMBER = 5; + private int underlyingTypeId_; + /** + * optional int32 underlying_type_id = 5; + */ + public boolean hasUnderlyingTypeId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 underlying_type_id = 5; + */ + public int getUnderlyingTypeId() { + return underlyingTypeId_; + } - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public Builder setUnderlyingType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - underlyingType_ = builderForValue.build(); + public static final int EXPANDED_TYPE_FIELD_NUMBER = 6; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type expandedType_; + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public boolean hasExpandedType() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType() { + return expandedType_; + } - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public Builder mergeUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - underlyingType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - underlyingType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(underlyingType_).mergeFrom(value).buildPartial(); - } else { - underlyingType_ = value; - } + public static final int EXPANDED_TYPE_ID_FIELD_NUMBER = 7; + private int expandedTypeId_; + /** + * optional int32 expanded_type_id = 7; + */ + public boolean hasExpandedTypeId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 expanded_type_id = 7; + */ + public int getExpandedTypeId() { + return expandedTypeId_; + } - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public Builder clearUnderlyingType() { - underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + public static final int ANNOTATION_FIELD_NUMBER = 8; + private java.util.List annotation_; + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public java.util.List getAnnotationList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public java.util.List + getAnnotationOrBuilderList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder( + int index) { + return annotation_.get(index); + } - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } + public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; + private java.util.List versionRequirement_; + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public java.util.List + getVersionRequirementList() { + return versionRequirement_; + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } + /** + * repeated int32 version_requirement = 31; + * + *
+     * Index into the VersionRequirementTable
+     * 
+ */ + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } - private int underlyingTypeId_ ; - /** - * optional int32 underlying_type_id = 5; - */ - public boolean hasUnderlyingTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 underlying_type_id = 5; - */ - public int getUnderlyingTypeId() { - return underlyingTypeId_; - } - /** - * optional int32 underlying_type_id = 5; - */ - public Builder setUnderlyingTypeId(int value) { - bitField0_ |= 0x00000010; - underlyingTypeId_ = value; - - return this; - } - /** - * optional int32 underlying_type_id = 5; - */ - public Builder clearUnderlyingTypeId() { - bitField0_ = (bitField0_ & ~0x00000010); - underlyingTypeId_ = 0; - - return this; - } + private void initFields() { + flags_ = 6; + name_ = 0; + typeParameter_ = java.util.Collections.emptyList(); + underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + underlyingTypeId_ = 0; + expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + expandedTypeId_ = 0; + annotation_ = java.util.Collections.emptyList(); + versionRequirement_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public boolean hasExpandedType() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType() { - return expandedType_; + if (!hasName()) { + memoizedIsInitialized = 0; + return false; } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public Builder setExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; } - expandedType_ = value; - - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public Builder setExpandedType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { - expandedType_ = builderForValue.build(); - - bitField0_ |= 0x00000020; - return this; } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public Builder mergeExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { - if (((bitField0_ & 0x00000020) == 0x00000020) && - expandedType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { - expandedType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(expandedType_).mergeFrom(value).buildPartial(); - } else { - expandedType_ = value; + if (hasUnderlyingType()) { + if (!getUnderlyingType().isInitialized()) { + memoizedIsInitialized = 0; + return false; } - - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public Builder clearExpandedType() { - expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - private int expandedTypeId_ ; - /** - * optional int32 expanded_type_id = 7; - */ - public boolean hasExpandedTypeId() { - return ((bitField0_ & 0x00000040) == 0x00000040); } - /** - * optional int32 expanded_type_id = 7; - */ - public int getExpandedTypeId() { - return expandedTypeId_; + if (hasExpandedType()) { + if (!getExpandedType().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } - /** - * optional int32 expanded_type_id = 7; - */ - public Builder setExpandedTypeId(int value) { - bitField0_ |= 0x00000040; - expandedTypeId_ = value; - - return this; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } - /** - * optional int32 expanded_type_id = 7; - */ - public Builder clearExpandedTypeId() { - bitField0_ = (bitField0_ & ~0x00000040); - expandedTypeId_ = 0; - - return this; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; } + memoizedIsInitialized = 1; + return true; + } - private java.util.List annotation_ = - java.util.Collections.emptyList(); - private void ensureAnnotationIsMutable() { - if (!((bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = new java.util.ArrayList(annotation_); - bitField0_ |= 0x00000080; - } + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, flags_); } - - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public java.util.List getAnnotationList() { - return java.util.Collections.unmodifiableList(annotation_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, name_); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public int getAnnotationCount() { - return annotation_.size(); + for (int i = 0; i < typeParameter_.size(); i++) { + output.writeMessage(3, typeParameter_.get(i)); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index) { - return annotation_.get(index); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(4, underlyingType_); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder setAnnotation( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.set(index, value); - - return this; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(5, underlyingTypeId_); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder setAnnotation( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.set(index, builderForValue.build()); - - return this; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(6, expandedType_); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.add(value); - - return this; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(7, expandedTypeId_); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAnnotation( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.add(index, value); - - return this; + for (int i = 0; i < annotation_.size(); i++) { + output.writeMessage(8, annotation_.get(i)); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAnnotation( - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.add(builderForValue.build()); - - return this; + for (int i = 0; i < versionRequirement_.size(); i++) { + output.writeInt32(31, versionRequirement_.get(i)); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAnnotation( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.add(index, builderForValue.build()); + extensionWriter.writeUntil(200, output); + output.writeRawBytes(unknownFields); + } - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAllAnnotation( - java.lang.Iterable values) { - ensureAnnotationIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, annotation_); + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; - return this; + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, flags_); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder clearAnnotation() { - annotation_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - - return this; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, name_); } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder removeAnnotation(int index) { - ensureAnnotationIsMutable(); - annotation_.remove(index); - - return this; + for (int i = 0; i < typeParameter_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, typeParameter_.get(i)); } - - private java.util.List versionRequirement_ = java.util.Collections.emptyList(); - private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00000100; - } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, underlyingType_); } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public java.util.List - getVersionRequirementList() { - return java.util.Collections.unmodifiableList(versionRequirement_); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, underlyingTypeId_); } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, expandedType_); } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, expandedTypeId_); } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder setVersionRequirement( - int index, int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.set(index, value); - - return this; + for (int i = 0; i < annotation_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, annotation_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < versionRequirement_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(versionRequirement_.get(i)); + } + size += dataSize; + size += 2 * getVersionRequirementList().size(); + } + size += extensionsSerializedSize(); + size += unknownFields.size(); + 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.metadata.ProtoBuf.TypeAlias parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias 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.metadata.ProtoBuf.TypeAlias parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias 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.metadata.ProtoBuf.TypeAlias prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeAlias) + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAliasOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - - return this; + + private void maybeForceBuilderInitialization() { } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - - return this; + private static Builder create() { + return new Builder(); } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder clearVersionRequirement() { + + public Builder clear() { + super.clear(); + flags_ = 6; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + underlyingTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000020); + expandedTypeId_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + annotation_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); versionRequirement_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000100); - return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeAlias) - } - - static { - defaultInstance = new TypeAlias(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeAlias) - } + public Builder clone() { + return create().mergeFrom(buildPartial()); + } - public interface EnumEntryOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.EnumEntry) - com.google.protobuf.GeneratedMessageLite. - ExtendableMessageOrBuilder { + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance(); + } - /** - * optional int32 name = 1; - */ - boolean hasName(); - /** - * optional int32 name = 1; - */ - int getName(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} - */ - public static final class EnumEntry extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< - EnumEntry> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.EnumEntry) - EnumEntryOrBuilder { - // Use EnumEntry.newBuilder() to construct. - private EnumEntry(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private EnumEntry(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias build() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } - private static final EnumEntry defaultInstance; - public static EnumEntry getDefaultInstance() { - return defaultInstance; - } + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.flags_ = flags_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.typeParameter_ = typeParameter_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.underlyingType_ = underlyingType_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + result.underlyingTypeId_ = underlyingTypeId_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000010; + } + result.expandedType_ = expandedType_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; + } + result.expandedTypeId_ = expandedTypeId_; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.annotation_ = annotation_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.versionRequirement_ = versionRequirement_; + result.bitField0_ = to_bitField0_; + return result; + } - public EnumEntry getDefaultInstanceForType() { - return defaultInstance; - } + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance()) return this; + if (other.hasFlags()) { + setFlags(other.getFlags()); + } + if (other.hasName()) { + setName(other.getName()); + } + if (!other.typeParameter_.isEmpty()) { + if (typeParameter_.isEmpty()) { + typeParameter_ = other.typeParameter_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureTypeParameterIsMutable(); + typeParameter_.addAll(other.typeParameter_); + } + + } + if (other.hasUnderlyingType()) { + mergeUnderlyingType(other.getUnderlyingType()); + } + if (other.hasUnderlyingTypeId()) { + setUnderlyingTypeId(other.getUnderlyingTypeId()); + } + if (other.hasExpandedType()) { + mergeExpandedType(other.getExpandedType()); + } + if (other.hasExpandedTypeId()) { + setExpandedTypeId(other.getExpandedTypeId()); + } + if (!other.annotation_.isEmpty()) { + if (annotation_.isEmpty()) { + annotation_ = other.annotation_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureAnnotationIsMutable(); + annotation_.addAll(other.annotation_); + } + + } + if (!other.versionRequirement_.isEmpty()) { + if (versionRequirement_.isEmpty()) { + versionRequirement_ = other.versionRequirement_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureVersionRequirementIsMutable(); + versionRequirement_.addAll(other.versionRequirement_); + } + + } + this.mergeExtensionFields(other); + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } - private final com.google.protobuf.ByteString unknownFields; - private EnumEntry( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - name_ = input.readInt32(); - break; - } + public final boolean isInitialized() { + if (!hasName()) { + + return false; + } + for (int i = 0; i < getTypeParameterCount(); i++) { + if (!getTypeParameter(i).isInitialized()) { + + return false; } } - } 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 { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); + if (hasUnderlyingType()) { + if (!getUnderlyingType().isInitialized()) { + + return false; + } } - makeExtensionsImmutable(); + if (hasExpandedType()) { + if (!getExpandedType().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + + return false; + } + } + if (!extensionsAreInitialized()) { + + return false; + } + return true; } - } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public EnumEntry parsePartialFrom( + + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EnumEntry(input, extensionRegistry); + throws java.io.IOException { + org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private int name_; - /** - * optional int32 name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 name = 1; - */ - public int getName() { - return name_; - } - - private void initFields() { - name_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + private int bitField0_; - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; + private int flags_ = 6; + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       * 
+ */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) == 0x00000001); } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, name_); + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       * 
+ */ + public int getFlags() { + return flags_; } - extensionWriter.writeUntil(200, output); - output.writeRawBytes(unknownFields); - } - - 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, name_); + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       * 
+ */ + public Builder setFlags(int value) { + bitField0_ |= 0x00000001; + flags_ = value; + + return this; + } + /** + * optional int32 flags = 1 [default = 6]; + * + *
+       *hasAnnotations
+       *Visibility
+       * 
+ */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000001); + flags_ = 6; + + return this; } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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.metadata.ProtoBuf.EnumEntry parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry 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.metadata.ProtoBuf.EnumEntry parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } + private int name_ ; + /** + * required int32 name = 2; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int32 name = 2; + */ + public int getName() { + return name_; + } + /** + * required int32 name = 2; + */ + public Builder setName(int value) { + bitField0_ |= 0x00000002; + name_ = value; + + return this; + } + /** + * required int32 name = 2; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = 0; + + return this; + } - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } + private java.util.List typeParameter_ = + java.util.Collections.emptyList(); + private void ensureTypeParameterIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + typeParameter_ = new java.util.ArrayList(typeParameter_); + bitField0_ |= 0x00000004; + } + } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.EnumEntry) - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntryOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public java.util.List getTypeParameterList() { + return java.util.Collections.unmodifiableList(typeParameter_); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public int getTypeParameterCount() { + return typeParameter_.size(); + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + return typeParameter_.get(index); } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.set(index, value); - private void maybeForceBuilderInitialization() { + return this; } - private static Builder create() { - return new Builder(); + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder setTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.set(index, builderForValue.build()); + + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(value); - public Builder clear() { - super.clear(); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeParameterIsMutable(); + typeParameter_.add(index, value); - public Builder clone() { - return create().mergeFrom(buildPartial()); + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addTypeParameter( + org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(builderForValue.build()); - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.getDefaultInstance(); + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addTypeParameter( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ensureTypeParameterIsMutable(); + typeParameter_.add(index, builderForValue.build()); - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry build() { - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder addAllTypeParameter( + java.lang.Iterable values) { + ensureTypeParameterIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, typeParameter_); + + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder clearTypeParameter() { + typeParameter_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry result = new org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - result.bitField0_ = to_bitField0_; - return result; + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; + */ + public Builder removeTypeParameter(int index) { + ensureTypeParameterIsMutable(); + typeParameter_.remove(index); - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.getDefaultInstance()) return this; - if (other.hasName()) { - setName(other.getName()); - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); return this; } - public final boolean isInitialized() { - if (!extensionsAreInitialized()) { - - return false; + private org.jetbrains.kotlin.metadata.ProtoBuf.Type underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public boolean hasUnderlyingType() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType() { + return underlyingType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public Builder setUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); } - return true; + underlyingType_ = value; + + bitField0_ |= 0x00000008; + return this; } + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public Builder setUnderlyingType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + underlyingType_ = builderForValue.build(); - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + bitField0_ |= 0x00000008; return this; } - private int bitField0_; + /** + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; + */ + public Builder mergeUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + underlyingType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + underlyingType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(underlyingType_).mergeFrom(value).buildPartial(); + } else { + underlyingType_ = value; + } - private int name_ ; + bitField0_ |= 0x00000008; + return this; + } /** - * optional int32 name = 1; + * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public Builder clearUnderlyingType() { + underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; } + + private int underlyingTypeId_ ; /** - * optional int32 name = 1; + * optional int32 underlying_type_id = 5; */ - public int getName() { - return name_; + public boolean hasUnderlyingTypeId() { + return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * optional int32 name = 1; + * optional int32 underlying_type_id = 5; */ - public Builder setName(int value) { - bitField0_ |= 0x00000001; - name_ = value; + public int getUnderlyingTypeId() { + return underlyingTypeId_; + } + /** + * optional int32 underlying_type_id = 5; + */ + public Builder setUnderlyingTypeId(int value) { + bitField0_ |= 0x00000010; + underlyingTypeId_ = value; return this; } /** - * optional int32 name = 1; + * optional int32 underlying_type_id = 5; */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; + public Builder clearUnderlyingTypeId() { + bitField0_ = (bitField0_ & ~0x00000010); + underlyingTypeId_ = 0; return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.EnumEntry) - } - - static { - defaultInstance = new EnumEntry(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.EnumEntry) - } - - public interface VersionRequirementOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional int32 version = 1; - * - *
-     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-     * (patch << 7) + (minor << 3) + major
-     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-     * 
- */ - boolean hasVersion(); - /** - * optional int32 version = 1; - * - *
-     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-     * (patch << 7) + (minor << 3) + major
-     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-     * 
- */ - int getVersion(); - - /** - * optional int32 version_full = 2; - * - *
-     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-     * (patch << 16) + (minor << 8) + major
-     * 
- */ - boolean hasVersionFull(); - /** - * optional int32 version_full = 2; - * - *
-     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-     * (patch << 16) + (minor << 8) + major
-     * 
- */ - int getVersionFull(); - - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-     * Level of the reported diagnostic
-     * 
- */ - boolean hasLevel(); - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-     * Level of the reported diagnostic
-     * 
- */ - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel(); - - /** - * optional int32 error_code = 4; - * - *
-     * Error code, to be looked up on the website
-     * 
- */ - boolean hasErrorCode(); - /** - * optional int32 error_code = 4; - * - *
-     * Error code, to be looked up on the website
-     * 
- */ - int getErrorCode(); - - /** - * optional int32 message = 5; - * - *
-     * Diagnostic message
-     * 
- */ - boolean hasMessage(); - /** - * optional int32 message = 5; - * - *
-     * Diagnostic message
-     * 
- */ - int getMessage(); - - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-     * 
- */ - boolean hasVersionKind(); - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-     * 
- */ - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} - */ - public static final class VersionRequirement extends - com.google.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - VersionRequirementOrBuilder { - // Use VersionRequirement.newBuilder() to construct. - private VersionRequirement(com.google.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private VersionRequirement(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - - private static final VersionRequirement defaultInstance; - public static VersionRequirement getDefaultInstance() { - return defaultInstance; - } - - public VersionRequirement getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.ByteString unknownFields; - private VersionRequirement( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - version_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - versionFull_ = input.readInt32(); - break; - } - case 24: { - int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level value = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000004; - level_ = value; - } - break; - } - case 32: { - bitField0_ |= 0x00000008; - errorCode_ = input.readInt32(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - message_ = input.readInt32(); - break; - } - case 48: { - int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind value = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000020; - versionKind_ = value; - } - 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 { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); + private org.jetbrains.kotlin.metadata.ProtoBuf.Type expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public boolean hasExpandedType() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType() { + return expandedType_; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public Builder setExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (value == null) { + throw new NullPointerException(); } - makeExtensionsImmutable(); + expandedType_ = value; + + bitField0_ |= 0x00000020; + return this; } - } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public VersionRequirement parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VersionRequirement(input, extensionRegistry); + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public Builder setExpandedType( + org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + expandedType_ = builderForValue.build(); + + bitField0_ |= 0x00000020; + return this; } - }; + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public Builder mergeExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + if (((bitField0_ & 0x00000020) == 0x00000020) && + expandedType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + expandedType_ = + org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(expandedType_).mergeFrom(value).buildPartial(); + } else { + expandedType_ = value; + } - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } + bitField0_ |= 0x00000020; + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; + */ + public Builder clearExpandedType() { + expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level} - */ - public enum Level - implements com.google.protobuf.Internal.EnumLite { + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + private int expandedTypeId_ ; /** - * WARNING = 0; + * optional int32 expanded_type_id = 7; */ - WARNING(0, 0), + public boolean hasExpandedTypeId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } /** - * ERROR = 1; + * optional int32 expanded_type_id = 7; */ - ERROR(1, 1), + public int getExpandedTypeId() { + return expandedTypeId_; + } /** - * HIDDEN = 2; + * optional int32 expanded_type_id = 7; */ - HIDDEN(2, 2), - ; + public Builder setExpandedTypeId(int value) { + bitField0_ |= 0x00000040; + expandedTypeId_ = value; + + return this; + } + /** + * optional int32 expanded_type_id = 7; + */ + public Builder clearExpandedTypeId() { + bitField0_ = (bitField0_ & ~0x00000040); + expandedTypeId_ = 0; + + return this; + } + + private java.util.List annotation_ = + java.util.Collections.emptyList(); + private void ensureAnnotationIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + annotation_ = new java.util.ArrayList(annotation_); + bitField0_ |= 0x00000080; + } + } /** - * WARNING = 0; + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public static final int WARNING_VALUE = 0; + public java.util.List getAnnotationList() { + return java.util.Collections.unmodifiableList(annotation_); + } /** - * ERROR = 1; + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public static final int ERROR_VALUE = 1; + public int getAnnotationCount() { + return annotation_.size(); + } /** - * HIDDEN = 2; + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public static final int HIDDEN_VALUE = 2; + public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.set(index, value); + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.set(index, builderForValue.build()); - public final int getNumber() { return value; } + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(value); - public static Level valueOf(int value) { - switch (value) { - case 0: return WARNING; - case 1: return ERROR; - case 2: return HIDDEN; - default: return null; + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + if (value == null) { + throw new NullPointerException(); } + ensureAnnotationIsMutable(); + annotation_.add(index, value); + + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAnnotation( + org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(builderForValue.build()); - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; + return this; } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Level findValueByNumber(int number) { - return Level.valueOf(number); - } - }; + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(index, builderForValue.build()); - private final int value; + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder addAllAnnotation( + java.lang.Iterable values) { + ensureAnnotationIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, annotation_); - @SuppressWarnings("UnusedVariable") - private Level(int index, int value) { - this.value = value; + return this; } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder clearAnnotation() { + annotation_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level) - } + return this; + } + /** + * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; + */ + public Builder removeAnnotation(int index) { + ensureAnnotationIsMutable(); + annotation_.remove(index); - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind} - */ - public enum VersionKind - implements com.google.protobuf.Internal.EnumLite { + return this; + } + + private java.util.List versionRequirement_ = java.util.Collections.emptyList(); + private void ensureVersionRequirementIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + versionRequirement_ = new java.util.ArrayList(versionRequirement_); + bitField0_ |= 0x00000100; + } + } /** - * LANGUAGE_VERSION = 0; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
+ */ + public java.util.List + getVersionRequirementList() { + return java.util.Collections.unmodifiableList(versionRequirement_); + } + /** + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - LANGUAGE_VERSION(0, 0), + public int getVersionRequirementCount() { + return versionRequirement_.size(); + } /** - * COMPILER_VERSION = 1; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - COMPILER_VERSION(1, 1), + public int getVersionRequirement(int index) { + return versionRequirement_.get(index); + } /** - * API_VERSION = 2; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - API_VERSION(2, 2), - ; - + public Builder setVersionRequirement( + int index, int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.set(index, value); + + return this; + } /** - * LANGUAGE_VERSION = 0; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public static final int LANGUAGE_VERSION_VALUE = 0; + public Builder addVersionRequirement(int value) { + ensureVersionRequirementIsMutable(); + versionRequirement_.add(value); + + return this; + } /** - * COMPILER_VERSION = 1; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public static final int COMPILER_VERSION_VALUE = 1; + public Builder addAllVersionRequirement( + java.lang.Iterable values) { + ensureVersionRequirementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, versionRequirement_); + + return this; + } /** - * API_VERSION = 2; + * repeated int32 version_requirement = 31; + * + *
+       * Index into the VersionRequirementTable
+       * 
*/ - public static final int API_VERSION_VALUE = 2; - - - public final int getNumber() { return value; } - - public static VersionKind valueOf(int value) { - switch (value) { - case 0: return LANGUAGE_VERSION; - case 1: return COMPILER_VERSION; - case 2: return API_VERSION; - default: return null; - } + public Builder clearVersionRequirement() { + versionRequirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; } - 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 VersionKind findValueByNumber(int number) { - return VersionKind.valueOf(number); - } - }; + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeAlias) + } - private final int value; + static { + defaultInstance = new TypeAlias(true); + defaultInstance.initFields(); + } - @SuppressWarnings("UnusedVariable") - private VersionKind(int index, int value) { - this.value = value; - } + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeAlias) + } - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind) - } + public interface EnumEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.EnumEntry) + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { - private int bitField0_; - public static final int VERSION_FIELD_NUMBER = 1; - private int version_; /** - * optional int32 version = 1; - * - *
-     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-     * (patch << 7) + (minor << 3) + major
-     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-     * 
+ * optional int32 name = 1; */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } + boolean hasName(); /** - * optional int32 version = 1; - * - *
-     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-     * (patch << 7) + (minor << 3) + major
-     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-     * 
+ * optional int32 name = 1; */ - public int getVersion() { - return version_; + int getName(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} + */ + public static final class EnumEntry extends + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + EnumEntry> implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.EnumEntry) + EnumEntryOrBuilder { + // Use EnumEntry.newBuilder() to construct. + private EnumEntry(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); } + @SuppressWarnings("UnusedVariable") + private EnumEntry(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - public static final int VERSION_FULL_FIELD_NUMBER = 2; - private int versionFull_; - /** - * optional int32 version_full = 2; - * - *
-     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-     * (patch << 16) + (minor << 8) + major
-     * 
- */ - public boolean hasVersionFull() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 version_full = 2; - * - *
-     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-     * (patch << 16) + (minor << 8) + major
-     * 
- */ - public int getVersionFull() { - return versionFull_; + private static final EnumEntry defaultInstance; + public static EnumEntry getDefaultInstance() { + return defaultInstance; } - public static final int LEVEL_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level level_; - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-     * Level of the reported diagnostic
-     * 
- */ - public boolean hasLevel() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-     * Level of the reported diagnostic
-     * 
- */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel() { - return level_; + public EnumEntry getDefaultInstanceForType() { + return defaultInstance; } - public static final int ERROR_CODE_FIELD_NUMBER = 4; - private int errorCode_; - /** - * optional int32 error_code = 4; - * - *
-     * Error code, to be looked up on the website
-     * 
- */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 error_code = 4; - * - *
-     * Error code, to be looked up on the website
-     * 
- */ - public int getErrorCode() { - return errorCode_; + private final com.google.protobuf.ByteString unknownFields; + private EnumEntry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + name_ = input.readInt32(); + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public EnumEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnumEntry(input, extensionRegistry); + } + }; - public static final int MESSAGE_FIELD_NUMBER = 5; - private int message_; - /** - * optional int32 message = 5; - * - *
-     * Diagnostic message
-     * 
- */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 message = 5; - * - *
-     * Diagnostic message
-     * 
- */ - public int getMessage() { - return message_; + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; } - public static final int VERSION_KIND_FIELD_NUMBER = 6; - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind versionKind_; + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private int name_; /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-     * 
+ * optional int32 name = 1; */ - public boolean hasVersionKind() { - return ((bitField0_ & 0x00000020) == 0x00000020); + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-     * 
+ * optional int32 name = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind() { - return versionKind_; + public int getName() { + return name_; } private void initFields() { - version_ = 0; - versionFull_ = 0; - level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; - errorCode_ = 0; - message_ = 0; - versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + name_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -21663,6 +19425,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -21670,24 +19436,13 @@ public final boolean isInitialized() { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); + com.google.protobuf.GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, version_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, versionFull_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeEnum(3, level_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(4, errorCode_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(5, message_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeEnum(6, versionKind_.getNumber()); + output.writeInt32(1, name_); } + extensionWriter.writeUntil(200, output); output.writeRawBytes(unknownFields); } @@ -21699,28 +19454,9 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, version_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, versionFull_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, level_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, errorCode_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, message_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, versionKind_.getNumber()); + .computeInt32Size(1, name_); } + size += extensionsSerializedSize(); size += unknownFields.size(); memoizedSerializedSize = size; return size; @@ -21733,53 +19469,53 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry 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.metadata.ProtoBuf.VersionRequirement parseFrom(byte[] data) + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseDelimitedFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseDelimitedFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -21788,21 +19524,20 @@ public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFro public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement prototype) { + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} + * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.newBuilder() + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry, Builder> implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.EnumEntry) + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntryOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -21815,18 +19550,8 @@ private static Builder create() { public Builder clear() { super.clear(); - version_ = 0; + name_ = 0; bitField0_ = (bitField0_ & ~0x00000001); - versionFull_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; - bitField0_ = (bitField0_ & ~0x00000004); - errorCode_ = 0; - bitField0_ = (bitField0_ & ~0x00000008); - message_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; - bitField0_ = (bitField0_ & ~0x00000020); return this; } @@ -21834,76 +19559,46 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.getDefaultInstance(); + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement build() { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement result = buildPartial(); + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry build() { + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement result = new org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement(this); + public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry result = new org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.version_ = version_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.versionFull_ = versionFull_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.level_ = level_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.errorCode_ = errorCode_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.message_ = message_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.versionKind_ = versionKind_; + result.name_ = name_; result.bitField0_ = to_bitField0_; return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.getDefaultInstance()) return this; - if (other.hasVersion()) { - setVersion(other.getVersion()); - } - if (other.hasVersionFull()) { - setVersionFull(other.getVersionFull()); - } - if (other.hasLevel()) { - setLevel(other.getLevel()); - } - if (other.hasErrorCode()) { - setErrorCode(other.getErrorCode()); - } - if (other.hasMessage()) { - setMessage(other.getMessage()); - } - if (other.hasVersionKind()) { - setVersionKind(other.getVersionKind()); + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.getDefaultInstance()) return this; + if (other.hasName()) { + setName(other.getName()); } + this.mergeExtensionFields(other); setUnknownFields( getUnknownFields().concat(other.unknownFields)); return this; } public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + + return false; + } return true; } @@ -21911,11 +19606,11 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parsedMessage = null; + org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement) e.getUnfinishedMessage(); + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -21926,477 +19621,576 @@ public Builder mergeFrom( } private int bitField0_; - private int version_ ; - /** - * optional int32 version = 1; - * - *
-       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-       * (patch << 7) + (minor << 3) + major
-       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-       * 
+ private int name_ ; + /** + * optional int32 name = 1; */ - public boolean hasVersion() { + public boolean hasName() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 version = 1; - * - *
-       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-       * (patch << 7) + (minor << 3) + major
-       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-       * 
+ * optional int32 name = 1; */ - public int getVersion() { - return version_; + public int getName() { + return name_; } /** - * optional int32 version = 1; - * - *
-       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-       * (patch << 7) + (minor << 3) + major
-       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-       * 
+ * optional int32 name = 1; */ - public Builder setVersion(int value) { + public Builder setName(int value) { bitField0_ |= 0x00000001; - version_ = value; + name_ = value; + + return this; + } + /** + * optional int32 name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = 0; return this; } - /** - * optional int32 version = 1; - * - *
-       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-       * (patch << 7) + (minor << 3) + major
-       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-       * 
- */ - public Builder clearVersion() { - bitField0_ = (bitField0_ & ~0x00000001); - version_ = 0; - - return this; + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.EnumEntry) + } + + static { + defaultInstance = new EnumEntry(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.EnumEntry) + } + + public interface VersionRequirementOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * optional int32 version = 1; + * + *
+     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+     * (patch << 7) + (minor << 3) + major
+     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+     * 
+ */ + boolean hasVersion(); + /** + * optional int32 version = 1; + * + *
+     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+     * (patch << 7) + (minor << 3) + major
+     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+     * 
+ */ + int getVersion(); + + /** + * optional int32 version_full = 2; + * + *
+     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+     * (patch << 16) + (minor << 8) + major
+     * 
+ */ + boolean hasVersionFull(); + /** + * optional int32 version_full = 2; + * + *
+     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+     * (patch << 16) + (minor << 8) + major
+     * 
+ */ + int getVersionFull(); + + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+     * Level of the reported diagnostic
+     * 
+ */ + boolean hasLevel(); + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+     * Level of the reported diagnostic
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel(); + + /** + * optional int32 error_code = 4; + * + *
+     * Error code, to be looked up on the website
+     * 
+ */ + boolean hasErrorCode(); + /** + * optional int32 error_code = 4; + * + *
+     * Error code, to be looked up on the website
+     * 
+ */ + int getErrorCode(); + + /** + * optional int32 message = 5; + * + *
+     * Diagnostic message
+     * 
+ */ + boolean hasMessage(); + /** + * optional int32 message = 5; + * + *
+     * Diagnostic message
+     * 
+ */ + int getMessage(); + + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+     * 
+ */ + boolean hasVersionKind(); + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+     * 
+ */ + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} + */ + public static final class VersionRequirement extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) + VersionRequirementOrBuilder { + // Use VersionRequirement.newBuilder() to construct. + private VersionRequirement(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + @SuppressWarnings("UnusedVariable") + private VersionRequirement(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + + private static final VersionRequirement defaultInstance; + public static VersionRequirement getDefaultInstance() { + return defaultInstance; + } + + public VersionRequirement getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.ByteString unknownFields; + private VersionRequirement( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.ByteString.Output unknownFieldsOutput = + com.google.protobuf.ByteString.newOutput(); + com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = + com.google.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + version_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + versionFull_ = input.readInt32(); + break; + } + case 24: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level value = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000004; + level_ = value; + } + break; + } + case 32: { + bitField0_ |= 0x00000008; + errorCode_ = input.readInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + message_ = input.readInt32(); + break; + } + case 48: { + int rawValue = input.readEnum(); + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind value = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.valueOf(rawValue); + if (value == null) { + unknownFieldsCodedOutput.writeRawVarint32(tag); + unknownFieldsCodedOutput.writeRawVarint32(rawValue); + } else { + bitField0_ |= 0x00000020; + versionKind_ = value; + } + 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 { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public VersionRequirement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VersionRequirement(input, extensionRegistry); } + }; - private int versionFull_ ; - /** - * optional int32 version_full = 2; - * - *
-       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-       * (patch << 16) + (minor << 8) + major
-       * 
- */ - public boolean hasVersionFull() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level} + */ + public enum Level + implements com.google.protobuf.Internal.EnumLite { /** - * optional int32 version_full = 2; - * - *
-       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-       * (patch << 16) + (minor << 8) + major
-       * 
+ * WARNING = 0; */ - public int getVersionFull() { - return versionFull_; - } + WARNING(0, 0), /** - * optional int32 version_full = 2; - * - *
-       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-       * (patch << 16) + (minor << 8) + major
-       * 
+ * ERROR = 1; */ - public Builder setVersionFull(int value) { - bitField0_ |= 0x00000002; - versionFull_ = value; - - return this; - } + ERROR(1, 1), /** - * optional int32 version_full = 2; - * - *
-       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-       * (patch << 16) + (minor << 8) + major
-       * 
+ * HIDDEN = 2; */ - public Builder clearVersionFull() { - bitField0_ = (bitField0_ & ~0x00000002); - versionFull_ = 0; - - return this; - } + HIDDEN(2, 2), + ; - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-       * Level of the reported diagnostic
-       * 
+ * WARNING = 0; */ - public boolean hasLevel() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } + public static final int WARNING_VALUE = 0; /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-       * Level of the reported diagnostic
-       * 
+ * ERROR = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel() { - return level_; - } + public static final int ERROR_VALUE = 1; /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-       * Level of the reported diagnostic
-       * 
+ * HIDDEN = 2; */ - public Builder setLevel(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level value) { - if (value == null) { - throw new NullPointerException(); + public static final int HIDDEN_VALUE = 2; + + + public final int getNumber() { return value; } + + public static Level valueOf(int value) { + switch (value) { + case 0: return WARNING; + case 1: return ERROR; + case 2: return HIDDEN; + default: return null; } - bitField0_ |= 0x00000004; - level_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-       * Level of the reported diagnostic
-       * 
- */ - public Builder clearLevel() { - bitField0_ = (bitField0_ & ~0x00000004); - level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; - - return this; } - private int errorCode_ ; - /** - * optional int32 error_code = 4; - * - *
-       * Error code, to be looked up on the website
-       * 
- */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 error_code = 4; - * - *
-       * Error code, to be looked up on the website
-       * 
- */ - public int getErrorCode() { - return errorCode_; - } - /** - * optional int32 error_code = 4; - * - *
-       * Error code, to be looked up on the website
-       * 
- */ - public Builder setErrorCode(int value) { - bitField0_ |= 0x00000008; - errorCode_ = value; - - return this; - } - /** - * optional int32 error_code = 4; - * - *
-       * Error code, to be looked up on the website
-       * 
- */ - public Builder clearErrorCode() { - bitField0_ = (bitField0_ & ~0x00000008); - errorCode_ = 0; - - return this; + 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 Level findValueByNumber(int number) { + return Level.valueOf(number); + } + }; - private int message_ ; - /** - * optional int32 message = 5; - * - *
-       * Diagnostic message
-       * 
- */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 message = 5; - * - *
-       * Diagnostic message
-       * 
- */ - public int getMessage() { - return message_; + private final int value; + + @SuppressWarnings("UnusedVariable") + private Level(int index, int value) { + this.value = value; } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level) + } + + /** + * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind} + */ + public enum VersionKind + implements com.google.protobuf.Internal.EnumLite { /** - * optional int32 message = 5; - * - *
-       * Diagnostic message
-       * 
+ * LANGUAGE_VERSION = 0; */ - public Builder setMessage(int value) { - bitField0_ |= 0x00000010; - message_ = value; - - return this; - } + LANGUAGE_VERSION(0, 0), /** - * optional int32 message = 5; - * - *
-       * Diagnostic message
-       * 
+ * COMPILER_VERSION = 1; */ - public Builder clearMessage() { - bitField0_ = (bitField0_ & ~0x00000010); - message_ = 0; - - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + COMPILER_VERSION(1, 1), /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-       * 
+ * API_VERSION = 2; */ - public boolean hasVersionKind() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } + API_VERSION(2, 2), + ; + /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-       * 
+ * LANGUAGE_VERSION = 0; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind() { - return versionKind_; - } + public static final int LANGUAGE_VERSION_VALUE = 0; /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-       * 
+ * COMPILER_VERSION = 1; */ - public Builder setVersionKind(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - versionKind_ = value; - - return this; - } + public static final int COMPILER_VERSION_VALUE = 1; /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-       * 
+ * API_VERSION = 2; */ - public Builder clearVersionKind() { - bitField0_ = (bitField0_ & ~0x00000020); - versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; - - return this; + public static final int API_VERSION_VALUE = 2; + + + public final int getNumber() { return value; } + + public static VersionKind valueOf(int value) { + switch (value) { + case 0: return LANGUAGE_VERSION; + case 1: return COMPILER_VERSION; + case 2: return API_VERSION; + default: return null; + } } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - } + 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 VersionKind findValueByNumber(int number) { + return VersionKind.valueOf(number); + } + }; - static { - defaultInstance = new VersionRequirement(true); - defaultInstance.initFields(); - } + private final int value; - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - } + @SuppressWarnings("UnusedVariable") + private VersionKind(int index, int value) { + this.value = value; + } - public interface VersionRequirementTableOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - com.google.protobuf.MessageLiteOrBuilder { + // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind) + } + private int bitField0_; + public static final int VERSION_FIELD_NUMBER = 1; + private int version_; /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - java.util.List - getRequirementList(); - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 version = 1; + * + *
+     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+     * (patch << 7) + (minor << 3) + major
+     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+     * 
*/ - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index); + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 version = 1; + * + *
+     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+     * (patch << 7) + (minor << 3) + major
+     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+     * 
*/ - int getRequirementCount(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} - */ - public static final class VersionRequirementTable extends - com.google.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - VersionRequirementTableOrBuilder { - // Use VersionRequirementTable.newBuilder() to construct. - private VersionRequirementTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); + public int getVersion() { + return version_; } - @SuppressWarnings("UnusedVariable") - private VersionRequirementTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - private static final VersionRequirementTable defaultInstance; - public static VersionRequirementTable getDefaultInstance() { - return defaultInstance; + public static final int VERSION_FULL_FIELD_NUMBER = 2; + private int versionFull_; + /** + * optional int32 version_full = 2; + * + *
+     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+     * (patch << 16) + (minor << 8) + major
+     * 
+ */ + public boolean hasVersionFull() { + return ((bitField0_ & 0x00000002) == 0x00000002); } - - public VersionRequirementTable getDefaultInstanceForType() { - return defaultInstance; + /** + * optional int32 version_full = 2; + * + *
+     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+     * (patch << 16) + (minor << 8) + major
+     * 
+ */ + public int getVersionFull() { + return versionFull_; } - private final com.google.protobuf.ByteString unknownFields; - private VersionRequirementTable( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - requirement_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.PARSER, extensionRegistry)); - 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)) { - requirement_ = java.util.Collections.unmodifiableList(requirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } + public static final int LEVEL_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level level_; + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+     * Level of the reported diagnostic
+     * 
+ */ + public boolean hasLevel() { + return ((bitField0_ & 0x00000004) == 0x00000004); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public VersionRequirementTable parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VersionRequirementTable(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+     * Level of the reported diagnostic
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel() { + return level_; } - public static final int REQUIREMENT_FIELD_NUMBER = 1; - private java.util.List requirement_; + public static final int ERROR_CODE_FIELD_NUMBER = 4; + private int errorCode_; /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 error_code = 4; + * + *
+     * Error code, to be looked up on the website
+     * 
*/ - public java.util.List getRequirementList() { - return requirement_; + public boolean hasErrorCode() { + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 error_code = 4; + * + *
+     * Error code, to be looked up on the website
+     * 
*/ - public java.util.List - getRequirementOrBuilderList() { - return requirement_; + public int getErrorCode() { + return errorCode_; } + + public static final int MESSAGE_FIELD_NUMBER = 5; + private int message_; /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 message = 5; + * + *
+     * Diagnostic message
+     * 
*/ - public int getRequirementCount() { - return requirement_.size(); + public boolean hasMessage() { + return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 message = 5; + * + *
+     * Diagnostic message
+     * 
*/ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index) { - return requirement_.get(index); + public int getMessage() { + return message_; } + + public static final int VERSION_KIND_FIELD_NUMBER = 6; + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind versionKind_; /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+     * 
*/ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementOrBuilder getRequirementOrBuilder( - int index) { - return requirement_.get(index); + public boolean hasVersionKind() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+     * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind() { + return versionKind_; } private void initFields() { - requirement_ = java.util.Collections.emptyList(); + version_ = 0; + versionFull_ = 0; + level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + errorCode_ = 0; + message_ = 0; + versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -22411,8 +20205,23 @@ public final boolean isInitialized() { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - for (int i = 0; i < requirement_.size(); i++) { - output.writeMessage(1, requirement_.get(i)); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, versionFull_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, level_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, errorCode_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, message_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeEnum(6, versionKind_.getNumber()); } output.writeRawBytes(unknownFields); } @@ -22423,9 +20232,29 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - for (int i = 0; i < requirement_.size(); i++) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, requirement_.get(i)); + .computeInt32Size(1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, versionFull_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, level_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, errorCode_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, message_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, versionKind_.getNumber()); } size += unknownFields.size(); memoizedSerializedSize = size; @@ -22439,53 +20268,53 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement 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.metadata.ProtoBuf.VersionRequirementTable parseFrom(byte[] data) + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseDelimitedFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseDelimitedFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -22494,21 +20323,21 @@ public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable par public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable prototype) { + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} + * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable, Builder> + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTableOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder() + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -22521,8 +20350,18 @@ private static Builder create() { public Builder clear() { super.clear(); - requirement_ = java.util.Collections.emptyList(); + version_ = 0; bitField0_ = (bitField0_ & ~0x00000001); + versionFull_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + bitField0_ = (bitField0_ & ~0x00000004); + errorCode_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + message_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + bitField0_ = (bitField0_ & ~0x00000020); return this; } @@ -22530,39 +20369,69 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable build() { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable result = buildPartial(); + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement build() { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable(this); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = java.util.Collections.unmodifiableList(requirement_); - bitField0_ = (bitField0_ & ~0x00000001); + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement result = new org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - result.requirement_ = requirement_; + result.version_ = version_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.versionFull_ = versionFull_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.level_ = level_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.errorCode_ = errorCode_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.message_ = message_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.versionKind_ = versionKind_; + result.bitField0_ = to_bitField0_; return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) return this; - if (!other.requirement_.isEmpty()) { - if (requirement_.isEmpty()) { - requirement_ = other.requirement_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRequirementIsMutable(); - requirement_.addAll(other.requirement_); - } - + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.getDefaultInstance()) return this; + if (other.hasVersion()) { + setVersion(other.getVersion()); + } + if (other.hasVersionFull()) { + setVersionFull(other.getVersionFull()); + } + if (other.hasLevel()) { + setLevel(other.getLevel()); + } + if (other.hasErrorCode()) { + setErrorCode(other.getErrorCode()); + } + if (other.hasMessage()) { + setMessage(other.getMessage()); + } + if (other.hasVersionKind()) { + setVersionKind(other.getVersionKind()); } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -22577,11 +20446,11 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parsedMessage = null; + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable) e.getUnfinishedMessage(); + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -22592,220 +20461,371 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List requirement_ = - java.util.Collections.emptyList(); - private void ensureRequirementIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = new java.util.ArrayList(requirement_); - bitField0_ |= 0x00000001; - } - } - + private int version_ ; /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 version = 1; + * + *
+       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+       * (patch << 7) + (minor << 3) + major
+       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+       * 
*/ - public java.util.List getRequirementList() { - return java.util.Collections.unmodifiableList(requirement_); + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 version = 1; + * + *
+       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+       * (patch << 7) + (minor << 3) + major
+       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+       * 
*/ - public int getRequirementCount() { - return requirement_.size(); + public int getVersion() { + return version_; } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 version = 1; + * + *
+       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+       * (patch << 7) + (minor << 3) + major
+       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+       * 
*/ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index) { - return requirement_.get(index); + public Builder setVersion(int value) { + bitField0_ |= 0x00000001; + version_ = value; + + return this; } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 version = 1; + * + *
+       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
+       * (patch << 7) + (minor << 3) + major
+       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
+       * 
*/ - public Builder setRequirement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequirementIsMutable(); - requirement_.set(index, value); + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 0; + + return this; + } + private int versionFull_ ; + /** + * optional int32 version_full = 2; + * + *
+       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+       * (patch << 16) + (minor << 8) + major
+       * 
+ */ + public boolean hasVersionFull() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 version_full = 2; + * + *
+       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+       * (patch << 16) + (minor << 8) + major
+       * 
+ */ + public int getVersionFull() { + return versionFull_; + } + /** + * optional int32 version_full = 2; + * + *
+       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+       * (patch << 16) + (minor << 8) + major
+       * 
+ */ + public Builder setVersionFull(int value) { + bitField0_ |= 0x00000002; + versionFull_ = value; + return this; } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 version_full = 2; + * + *
+       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
+       * (patch << 16) + (minor << 8) + major
+       * 
*/ - public Builder setRequirement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { - ensureRequirementIsMutable(); - requirement_.set(index, builderForValue.build()); - + public Builder clearVersionFull() { + bitField0_ = (bitField0_ & ~0x00000002); + versionFull_ = 0; + return this; } + + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+       * Level of the reported diagnostic
+       * 
*/ - public Builder addRequirement(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { + public boolean hasLevel() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+       * Level of the reported diagnostic
+       * 
+ */ + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel() { + return level_; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+       * Level of the reported diagnostic
+       * 
+ */ + public Builder setLevel(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level value) { if (value == null) { throw new NullPointerException(); } - ensureRequirementIsMutable(); - requirement_.add(value); + bitField0_ |= 0x00000004; + level_ = value; + + return this; + } + /** + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; + * + *
+       * Level of the reported diagnostic
+       * 
+ */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + + return this; + } + private int errorCode_ ; + /** + * optional int32 error_code = 4; + * + *
+       * Error code, to be looked up on the website
+       * 
+ */ + public boolean hasErrorCode() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 error_code = 4; + * + *
+       * Error code, to be looked up on the website
+       * 
+ */ + public int getErrorCode() { + return errorCode_; + } + /** + * optional int32 error_code = 4; + * + *
+       * Error code, to be looked up on the website
+       * 
+ */ + public Builder setErrorCode(int value) { + bitField0_ |= 0x00000008; + errorCode_ = value; + return this; } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 error_code = 4; + * + *
+       * Error code, to be looked up on the website
+       * 
*/ - public Builder addRequirement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequirementIsMutable(); - requirement_.add(index, value); + public Builder clearErrorCode() { + bitField0_ = (bitField0_ & ~0x00000008); + errorCode_ = 0; + + return this; + } + private int message_ ; + /** + * optional int32 message = 5; + * + *
+       * Diagnostic message
+       * 
+ */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 message = 5; + * + *
+       * Diagnostic message
+       * 
+ */ + public int getMessage() { + return message_; + } + /** + * optional int32 message = 5; + * + *
+       * Diagnostic message
+       * 
+ */ + public Builder setMessage(int value) { + bitField0_ |= 0x00000010; + message_ = value; + return this; } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional int32 message = 5; + * + *
+       * Diagnostic message
+       * 
*/ - public Builder addRequirement( - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { - ensureRequirementIsMutable(); - requirement_.add(builderForValue.build()); - + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000010); + message_ = 0; + return this; } + + private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+       * 
*/ - public Builder addRequirement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { - ensureRequirementIsMutable(); - requirement_.add(index, builderForValue.build()); - - return this; + public boolean hasVersionKind() { + return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+       * 
*/ - public Builder addAllRequirement( - java.lang.Iterable values) { - ensureRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, requirement_); - - return this; + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind() { + return versionKind_; } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+       * 
*/ - public Builder clearRequirement() { - requirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - + public Builder setVersionKind(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + versionKind_ = value; + return this; } /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; + * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; + * + *
+       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
+       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
+       * 
*/ - public Builder removeRequirement(int index) { - ensureRequirementIsMutable(); - requirement_.remove(index); - + public Builder clearVersionKind() { + bitField0_ = (bitField0_ & ~0x00000020); + versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) } static { - defaultInstance = new VersionRequirementTable(true); + defaultInstance = new VersionRequirement(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) } - public interface PackageFragmentOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.PackageFragment) - com.google.protobuf.GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - boolean hasStrings(); - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.StringTable getStrings(); - - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - boolean hasQualifiedNames(); - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable getQualifiedNames(); - - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - boolean hasPackage(); - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - org.jetbrains.kotlin.metadata.ProtoBuf.Package getPackage(); + public interface VersionRequirementTableOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + com.google.protobuf.MessageLiteOrBuilder { /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - java.util.List - getClass_List(); + java.util.List + getRequirementList(); /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Class getClass_(int index); + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index); /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - int getClass_Count(); + int getRequirementCount(); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.PackageFragment} - * - *
-   * A part of the package, which is used to serialize .kjsm/.meta.js, .kotlin_builtins and .kotlin_metadata files.
-   * Is not used in the JVM back-end
-   * 
+ * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} */ - public static final class PackageFragment extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< - PackageFragment> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.PackageFragment) - PackageFragmentOrBuilder { - // Use PackageFragment.newBuilder() to construct. - private PackageFragment(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + public static final class VersionRequirementTable extends + com.google.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + VersionRequirementTableOrBuilder { + // Use VersionRequirementTable.newBuilder() to construct. + private VersionRequirementTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private PackageFragment(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private VersionRequirementTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - private static final PackageFragment defaultInstance; - public static PackageFragment getDefaultInstance() { + private static final VersionRequirementTable defaultInstance; + public static VersionRequirementTable getDefaultInstance() { return defaultInstance; } - public PackageFragment getDefaultInstanceForType() { + public VersionRequirementTable getDefaultInstanceForType() { return defaultInstance; } private final com.google.protobuf.ByteString unknownFields; - private PackageFragment( + private VersionRequirementTable( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -22832,50 +20852,11 @@ private PackageFragment( break; } case 10: { - org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = strings_.toBuilder(); - } - strings_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(strings_); - strings_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: { - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = qualifiedNames_.toBuilder(); - } - qualifiedNames_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(qualifiedNames_); - qualifiedNames_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 26: { - org.jetbrains.kotlin.metadata.ProtoBuf.Package.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = package_.toBuilder(); - } - package_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Package.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(package_); - package_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - class__ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requirement_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - class__.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Class.PARSER, extensionRegistry)); + requirement_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.PARSER, extensionRegistry)); break; } } @@ -22886,8 +20867,8 @@ private PackageFragment( throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - class__ = java.util.Collections.unmodifiableList(class__); + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + requirement_ = java.util.Collections.unmodifiableList(requirement_); } try { unknownFieldsCodedOutput.flush(); @@ -22899,107 +20880,58 @@ private PackageFragment( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public PackageFragment parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public VersionRequirementTable parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PackageFragment(input, extensionRegistry); + return new VersionRequirementTable(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } - private int bitField0_; - public static final int STRINGS_FIELD_NUMBER = 1; - private org.jetbrains.kotlin.metadata.ProtoBuf.StringTable strings_; - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - public boolean hasStrings() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable getStrings() { - return strings_; - } - - public static final int QUALIFIED_NAMES_FIELD_NUMBER = 2; - private org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable qualifiedNames_; - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - public boolean hasQualifiedNames() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable getQualifiedNames() { - return qualifiedNames_; - } - - public static final int PACKAGE_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Package package_; - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - public boolean hasPackage() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Package getPackage() { - return package_; - } - - public static final int CLASS_FIELD_NUMBER = 4; - private java.util.List class__; + public static final int REQUIREMENT_FIELD_NUMBER = 1; + private java.util.List requirement_; /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public java.util.List getClass_List() { - return class__; + public java.util.List getRequirementList() { + return requirement_; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public java.util.List - getClass_OrBuilderList() { - return class__; + public java.util.List + getRequirementOrBuilderList() { + return requirement_; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public int getClass_Count() { - return class__.size(); + public int getRequirementCount() { + return requirement_.size(); } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Class getClass_(int index) { - return class__.get(index); + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index) { + return requirement_.get(index); } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ClassOrBuilder getClass_OrBuilder( + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementOrBuilder getRequirementOrBuilder( int index) { - return class__.get(index); + return requirement_.get(index); } private void initFields() { - strings_ = org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); - qualifiedNames_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); - package_ = org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); - class__ = java.util.Collections.emptyList(); + requirement_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -23007,28 +20939,6 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; - if (hasQualifiedNames()) { - if (!getQualifiedNames().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasPackage()) { - if (!getPackage().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getClass_Count(); i++) { - if (!getClass_(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } memoizedIsInitialized = 1; return true; } @@ -23036,22 +20946,9 @@ public final boolean isInitialized() { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, strings_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, qualifiedNames_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(3, package_); - } - for (int i = 0; i < class__.size(); i++) { - output.writeMessage(4, class__.get(i)); + for (int i = 0; i < requirement_.size(); i++) { + output.writeMessage(1, requirement_.get(i)); } - extensionWriter.writeUntil(200, output); output.writeRawBytes(unknownFields); } @@ -23061,23 +20958,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, strings_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, qualifiedNames_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, package_); - } - for (int i = 0; i < class__.size(); i++) { + for (int i = 0; i < requirement_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, class__.get(i)); + .computeMessageSize(1, requirement_.get(i)); } - size += extensionsSerializedSize(); size += unknownFields.size(); memoizedSerializedSize = size; return size; @@ -23090,53 +20974,53 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable 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.metadata.ProtoBuf.PackageFragment parseFrom(byte[] data) + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseDelimitedFrom(java.io.InputStream input) + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseDelimitedFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( + public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -23145,25 +21029,21 @@ public static org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parseFrom( public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment prototype) { + public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.PackageFragment} - * - *
-     * A part of the package, which is used to serialize .kjsm/.meta.js, .kotlin_builtins and .kotlin_metadata files.
-     * Is not used in the JVM back-end
-     * 
+ * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.PackageFragment) - org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragmentOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment.newBuilder() + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTableOrBuilder { + // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -23176,14 +21056,8 @@ private static Builder create() { public Builder clear() { super.clear(); - strings_ = org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); + requirement_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); - qualifiedNames_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000002); - package_ = org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000004); - class__ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -23191,93 +21065,46 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment.getDefaultInstance(); + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getDefaultInstanceForType() { + return org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment build() { - org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment result = buildPartial(); + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable build() { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment result = new org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.strings_ = strings_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.qualifiedNames_ = qualifiedNames_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.package_ = package_; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - class__ = java.util.Collections.unmodifiableList(class__); - bitField0_ = (bitField0_ & ~0x00000008); + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable buildPartial() { + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable(this); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + requirement_ = java.util.Collections.unmodifiableList(requirement_); + bitField0_ = (bitField0_ & ~0x00000001); } - result.class__ = class__; - result.bitField0_ = to_bitField0_; + result.requirement_ = requirement_; return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment.getDefaultInstance()) return this; - if (other.hasStrings()) { - mergeStrings(other.getStrings()); - } - if (other.hasQualifiedNames()) { - mergeQualifiedNames(other.getQualifiedNames()); - } - if (other.hasPackage()) { - mergePackage(other.getPackage()); - } - if (!other.class__.isEmpty()) { - if (class__.isEmpty()) { - class__ = other.class__; - bitField0_ = (bitField0_ & ~0x00000008); + public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable other) { + if (other == org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) return this; + if (!other.requirement_.isEmpty()) { + if (requirement_.isEmpty()) { + requirement_ = other.requirement_; + bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureClass_IsMutable(); - class__.addAll(other.class__); + ensureRequirementIsMutable(); + requirement_.addAll(other.requirement_); } } - this.mergeExtensionFields(other); setUnknownFields( getUnknownFields().concat(other.unknownFields)); return this; } public final boolean isInitialized() { - if (hasQualifiedNames()) { - if (!getQualifiedNames().isInitialized()) { - - return false; - } - } - if (hasPackage()) { - if (!getPackage().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getClass_Count(); i++) { - if (!getClass_(i).isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } return true; } @@ -23285,11 +21112,11 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment parsedMessage = null; + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.PackageFragment) e.getUnfinishedMessage(); + parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -23300,320 +21127,140 @@ public Builder mergeFrom( } private int bitField0_; - private org.jetbrains.kotlin.metadata.ProtoBuf.StringTable strings_ = org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - public boolean hasStrings() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable getStrings() { - return strings_; - } - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - public Builder setStrings(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable value) { - if (value == null) { - throw new NullPointerException(); - } - strings_ = value; - - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - public Builder setStrings( - org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.Builder builderForValue) { - strings_ = builderForValue.build(); - - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - public Builder mergeStrings(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable value) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - strings_ != org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance()) { - strings_ = - org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.newBuilder(strings_).mergeFrom(value).buildPartial(); - } else { - strings_ = value; - } - - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.StringTable strings = 1; - */ - public Builder clearStrings() { - strings_ = org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable qualifiedNames_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - public boolean hasQualifiedNames() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable getQualifiedNames() { - return qualifiedNames_; - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - public Builder setQualifiedNames(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable value) { - if (value == null) { - throw new NullPointerException(); - } - qualifiedNames_ = value; - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - public Builder setQualifiedNames( - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.Builder builderForValue) { - qualifiedNames_ = builderForValue.build(); - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - public Builder mergeQualifiedNames(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable value) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - qualifiedNames_ != org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance()) { - qualifiedNames_ = - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.newBuilder(qualifiedNames_).mergeFrom(value).buildPartial(); - } else { - qualifiedNames_ = value; - } - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 2; - */ - public Builder clearQualifiedNames() { - qualifiedNames_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - private org.jetbrains.kotlin.metadata.ProtoBuf.Package package_ = org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - public boolean hasPackage() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Package getPackage() { - return package_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - public Builder setPackage(org.jetbrains.kotlin.metadata.ProtoBuf.Package value) { - if (value == null) { - throw new NullPointerException(); - } - package_ = value; - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - public Builder setPackage( - org.jetbrains.kotlin.metadata.ProtoBuf.Package.Builder builderForValue) { - package_ = builderForValue.build(); - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - public Builder mergePackage(org.jetbrains.kotlin.metadata.ProtoBuf.Package value) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - package_ != org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance()) { - package_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Package.newBuilder(package_).mergeFrom(value).buildPartial(); - } else { - package_ = value; - } - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Package package = 3; - */ - public Builder clearPackage() { - package_ = org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - private java.util.List class__ = + private java.util.List requirement_ = java.util.Collections.emptyList(); - private void ensureClass_IsMutable() { - if (!((bitField0_ & 0x00000008) == 0x00000008)) { - class__ = new java.util.ArrayList(class__); - bitField0_ |= 0x00000008; + private void ensureRequirementIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + requirement_ = new java.util.ArrayList(requirement_); + bitField0_ |= 0x00000001; } } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public java.util.List getClass_List() { - return java.util.Collections.unmodifiableList(class__); + public java.util.List getRequirementList() { + return java.util.Collections.unmodifiableList(requirement_); } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public int getClass_Count() { - return class__.size(); + public int getRequirementCount() { + return requirement_.size(); } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Class getClass_(int index) { - return class__.get(index); + public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index) { + return requirement_.get(index); } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder setClass_( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class value) { + public Builder setRequirement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { if (value == null) { throw new NullPointerException(); } - ensureClass_IsMutable(); - class__.set(index, value); + ensureRequirementIsMutable(); + requirement_.set(index, value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder setClass_( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class.Builder builderForValue) { - ensureClass_IsMutable(); - class__.set(index, builderForValue.build()); + public Builder setRequirement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + ensureRequirementIsMutable(); + requirement_.set(index, builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder addClass_(org.jetbrains.kotlin.metadata.ProtoBuf.Class value) { + public Builder addRequirement(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { if (value == null) { throw new NullPointerException(); } - ensureClass_IsMutable(); - class__.add(value); + ensureRequirementIsMutable(); + requirement_.add(value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder addClass_( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class value) { + public Builder addRequirement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { if (value == null) { throw new NullPointerException(); } - ensureClass_IsMutable(); - class__.add(index, value); + ensureRequirementIsMutable(); + requirement_.add(index, value); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder addClass_( - org.jetbrains.kotlin.metadata.ProtoBuf.Class.Builder builderForValue) { - ensureClass_IsMutable(); - class__.add(builderForValue.build()); + public Builder addRequirement( + org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + ensureRequirementIsMutable(); + requirement_.add(builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder addClass_( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Class.Builder builderForValue) { - ensureClass_IsMutable(); - class__.add(index, builderForValue.build()); + public Builder addRequirement( + int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + ensureRequirementIsMutable(); + requirement_.add(index, builderForValue.build()); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder addAllClass_( - java.lang.Iterable values) { - ensureClass_IsMutable(); + public Builder addAllRequirement( + java.lang.Iterable values) { + ensureRequirementIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, class__); + values, requirement_); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder clearClass_() { - class__ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + public Builder clearRequirement() { + requirement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); return this; } /** - * repeated .org.jetbrains.kotlin.metadata.Class class = 4; + * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder removeClass_(int index) { - ensureClass_IsMutable(); - class__.remove(index); + public Builder removeRequirement(int index) { + ensureRequirementIsMutable(); + requirement_.remove(index); return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.PackageFragment) + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) } static { - defaultInstance = new PackageFragment(true); + defaultInstance = new VersionRequirementTable(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.PackageFragment) + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) } public interface ContractOrBuilder extends diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt index 10163e9a30..d69b769aa0 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt @@ -35,32 +35,6 @@ abstract class BinaryVersion(private vararg val numbers: Int) { else major == ourVersion.major && minor <= ourVersion.minor } - fun isAtLeast(version: BinaryVersion): Boolean = - isAtLeast(version.major, version.minor, version.patch) - - fun isAtLeast(major: Int, minor: Int, patch: Int): Boolean { - if (this.major > major) return true - if (this.major < major) return false - - if (this.minor > minor) return true - if (this.minor < minor) return false - - return this.patch >= patch - } - - fun isAtMost(version: BinaryVersion): Boolean = - isAtMost(version.major, version.minor, version.patch) - - fun isAtMost(major: Int, minor: Int, patch: Int): Boolean { - if (this.major < major) return true - if (this.major > major) return false - - if (this.minor < minor) return true - if (this.minor > minor) return false - - return this.patch <= patch - } - override fun toString(): String { val versions = toArray().takeWhile { it != UNKNOWN } return if (versions.isEmpty()) "unknown" else versions.joinToString(".") @@ -81,11 +55,5 @@ abstract class BinaryVersion(private vararg val numbers: Int) { companion object { private const val UNKNOWN = -1 - - @JvmStatic - fun parseVersionArray(string: String): IntArray? = - string.split(".") - .map { part -> part.toIntOrNull() ?: return null } - .toTypedArray().toIntArray() } } diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java index df78268636..1639bc7dd1 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java @@ -13,242 +13,9 @@ public class Flags { protected Flags() {} - // Types - public static final BooleanFlagField SUSPEND_TYPE = FlagField.booleanFirst(); - public static final BooleanFlagField DEFINITELY_NOT_NULL_TYPE = FlagField.booleanAfter(SUSPEND_TYPE); - - // Common for declarations - - public static final BooleanFlagField HAS_ANNOTATIONS = FlagField.booleanFirst(); - public static final FlagField VISIBILITY = FlagField.after(HAS_ANNOTATIONS, ProtoBuf.Visibility.values()); - public static final FlagField MODALITY = FlagField.after(VISIBILITY, ProtoBuf.Modality.values()); - - // Class - - public static final FlagField CLASS_KIND = FlagField.after(MODALITY, ProtoBuf.Class.Kind.values()); - public static final BooleanFlagField IS_INNER = FlagField.booleanAfter(CLASS_KIND); - public static final BooleanFlagField IS_DATA = FlagField.booleanAfter(IS_INNER); - public static final BooleanFlagField IS_EXTERNAL_CLASS = FlagField.booleanAfter(IS_DATA); - public static final BooleanFlagField IS_EXPECT_CLASS = FlagField.booleanAfter(IS_EXTERNAL_CLASS); - public static final BooleanFlagField IS_INLINE_CLASS = FlagField.booleanAfter(IS_EXPECT_CLASS); - public static final BooleanFlagField IS_FUN_INTERFACE = FlagField.booleanAfter(IS_INLINE_CLASS); - - // Constructors - - public static final BooleanFlagField IS_SECONDARY = FlagField.booleanAfter(VISIBILITY); - public static final BooleanFlagField IS_CONSTRUCTOR_WITH_NON_STABLE_PARAMETER_NAMES = FlagField.booleanAfter(IS_SECONDARY); - - // Callables - - public static final FlagField MEMBER_KIND = FlagField.after(MODALITY, ProtoBuf.MemberKind.values()); - - // Functions - - public static final BooleanFlagField IS_OPERATOR = FlagField.booleanAfter(MEMBER_KIND); - public static final BooleanFlagField IS_INFIX = FlagField.booleanAfter(IS_OPERATOR); - public static final BooleanFlagField IS_INLINE = FlagField.booleanAfter(IS_INFIX); - public static final BooleanFlagField IS_TAILREC = FlagField.booleanAfter(IS_INLINE); - public static final BooleanFlagField IS_EXTERNAL_FUNCTION = FlagField.booleanAfter(IS_TAILREC); - public static final BooleanFlagField IS_SUSPEND = FlagField.booleanAfter(IS_EXTERNAL_FUNCTION); - public static final BooleanFlagField IS_EXPECT_FUNCTION = FlagField.booleanAfter(IS_SUSPEND); - public static final BooleanFlagField IS_FUNCTION_WITH_NON_STABLE_PARAMETER_NAMES = FlagField.booleanAfter(IS_EXPECT_FUNCTION); - - // Properties - - public static final BooleanFlagField IS_VAR = FlagField.booleanAfter(MEMBER_KIND); - public static final BooleanFlagField HAS_GETTER = FlagField.booleanAfter(IS_VAR); - public static final BooleanFlagField HAS_SETTER = FlagField.booleanAfter(HAS_GETTER); - public static final BooleanFlagField IS_CONST = FlagField.booleanAfter(HAS_SETTER); - public static final BooleanFlagField IS_LATEINIT = FlagField.booleanAfter(IS_CONST); - public static final BooleanFlagField HAS_CONSTANT = FlagField.booleanAfter(IS_LATEINIT); - public static final BooleanFlagField IS_EXTERNAL_PROPERTY = FlagField.booleanAfter(HAS_CONSTANT); - public static final BooleanFlagField IS_DELEGATED = FlagField.booleanAfter(IS_EXTERNAL_PROPERTY); - public static final BooleanFlagField IS_EXPECT_PROPERTY = FlagField.booleanAfter(IS_DELEGATED); - - // Parameters - - public static final BooleanFlagField DECLARES_DEFAULT_VALUE = FlagField.booleanAfter(HAS_ANNOTATIONS); - public static final BooleanFlagField IS_CROSSINLINE = FlagField.booleanAfter(DECLARES_DEFAULT_VALUE); - public static final BooleanFlagField IS_NOINLINE = FlagField.booleanAfter(IS_CROSSINLINE); - - // Accessors - - public static final BooleanFlagField IS_NOT_DEFAULT = FlagField.booleanAfter(MODALITY); - public static final BooleanFlagField IS_EXTERNAL_ACCESSOR = FlagField.booleanAfter(IS_NOT_DEFAULT); - public static final BooleanFlagField IS_INLINE_ACCESSOR = FlagField.booleanAfter(IS_EXTERNAL_ACCESSOR); - - // Contracts expressions - public static final BooleanFlagField IS_NEGATED = FlagField.booleanFirst(); - public static final BooleanFlagField IS_NULL_CHECK_PREDICATE = FlagField.booleanAfter(IS_NEGATED); - - // Annotations - public static final BooleanFlagField IS_UNSIGNED = FlagField.booleanFirst(); - - // --- - - public static int getTypeFlags(boolean isSuspend, boolean isDefinitelyNotNull) { - return SUSPEND_TYPE.toFlags(isSuspend) | DEFINITELY_NOT_NULL_TYPE.toFlags(isDefinitelyNotNull); - } - - public static int getClassFlags( - boolean hasAnnotations, - @NotNull ProtoBuf.Visibility visibility, - @NotNull ProtoBuf.Modality modality, - @NotNull ProtoBuf.Class.Kind kind, - boolean inner, - boolean isData, - boolean isExternal, - boolean isExpect, - boolean isInline, - boolean isFun - ) { - return HAS_ANNOTATIONS.toFlags(hasAnnotations) - | MODALITY.toFlags(modality) - | VISIBILITY.toFlags(visibility) - | CLASS_KIND.toFlags(kind) - | IS_INNER.toFlags(inner) - | IS_DATA.toFlags(isData) - | IS_EXTERNAL_CLASS.toFlags(isExternal) - | IS_EXPECT_CLASS.toFlags(isExpect) - | IS_INLINE_CLASS.toFlags(isInline) - | IS_FUN_INTERFACE.toFlags(isFun) - ; - } - - public static int getConstructorFlags( - boolean hasAnnotations, - @NotNull ProtoBuf.Visibility visibility, - boolean isSecondary, - boolean hasStableParameterNames - ) { - return HAS_ANNOTATIONS.toFlags(hasAnnotations) - | VISIBILITY.toFlags(visibility) - | IS_SECONDARY.toFlags(isSecondary) - | IS_CONSTRUCTOR_WITH_NON_STABLE_PARAMETER_NAMES.toFlags(!hasStableParameterNames) - ; - } - - public static int getFunctionFlags( - boolean hasAnnotations, - @NotNull ProtoBuf.Visibility visibility, - @NotNull ProtoBuf.Modality modality, - @NotNull ProtoBuf.MemberKind memberKind, - boolean isOperator, - boolean isInfix, - boolean isInline, - boolean isTailrec, - boolean isExternal, - boolean isSuspend, - boolean isExpect, - boolean hasStableParameterNames - ) { - return HAS_ANNOTATIONS.toFlags(hasAnnotations) - | VISIBILITY.toFlags(visibility) - | MODALITY.toFlags(modality) - | MEMBER_KIND.toFlags(memberKind) - | IS_OPERATOR.toFlags(isOperator) - | IS_INFIX.toFlags(isInfix) - | IS_INLINE.toFlags(isInline) - | IS_TAILREC.toFlags(isTailrec) - | IS_EXTERNAL_FUNCTION.toFlags(isExternal) - | IS_SUSPEND.toFlags(isSuspend) - | IS_EXPECT_FUNCTION.toFlags(isExpect) - | IS_FUNCTION_WITH_NON_STABLE_PARAMETER_NAMES.toFlags(!hasStableParameterNames) - ; - } - - public static int getPropertyFlags( - boolean hasAnnotations, - @NotNull ProtoBuf.Visibility visibility, - @NotNull ProtoBuf.Modality modality, - @NotNull ProtoBuf.MemberKind memberKind, - boolean isVar, - boolean hasGetter, - boolean hasSetter, - boolean hasConstant, - boolean isConst, - boolean lateInit, - boolean isExternal, - boolean isDelegated, - boolean isExpect - ) { - return HAS_ANNOTATIONS.toFlags(hasAnnotations) - | VISIBILITY.toFlags(visibility) - | MODALITY.toFlags(modality) - | MEMBER_KIND.toFlags(memberKind) - | IS_VAR.toFlags(isVar) - | HAS_GETTER.toFlags(hasGetter) - | HAS_SETTER.toFlags(hasSetter) - | IS_CONST.toFlags(isConst) - | IS_LATEINIT.toFlags(lateInit) - | HAS_CONSTANT.toFlags(hasConstant) - | IS_EXTERNAL_PROPERTY.toFlags(isExternal) - | IS_DELEGATED.toFlags(isDelegated) - | IS_EXPECT_PROPERTY.toFlags(isExpect) - ; - } - - public static int getAccessorFlags( - boolean hasAnnotations, - @NotNull ProtoBuf.Visibility visibility, - @NotNull ProtoBuf.Modality modality, - boolean isNotDefault, - boolean isExternal, - boolean isInlineAccessor - ) { - return HAS_ANNOTATIONS.toFlags(hasAnnotations) - | MODALITY.toFlags(modality) - | VISIBILITY.toFlags(visibility) - | IS_NOT_DEFAULT.toFlags(isNotDefault) - | IS_EXTERNAL_ACCESSOR.toFlags(isExternal) - | IS_INLINE_ACCESSOR.toFlags(isInlineAccessor) - ; - } - - public static int getContractExpressionFlags(boolean isNegated, boolean isNullCheckPredicate) { - return IS_NEGATED.toFlags(isNegated) - | IS_NULL_CHECK_PREDICATE.toFlags(isNullCheckPredicate); - } - - public static int getValueParameterFlags( - boolean hasAnnotations, - boolean declaresDefaultValue, - boolean isCrossinline, - boolean isNoinline - ) { - return HAS_ANNOTATIONS.toFlags(hasAnnotations) - | DECLARES_DEFAULT_VALUE.toFlags(declaresDefaultValue) - | IS_CROSSINLINE.toFlags(isCrossinline) - | IS_NOINLINE.toFlags(isNoinline) - ; - } - - public static int getTypeAliasFlags(boolean hasAnnotations, ProtoBuf.Visibility visibility) { - return HAS_ANNOTATIONS.toFlags(hasAnnotations) - | VISIBILITY.toFlags(visibility) - ; - } - // Infrastructure public static abstract class FlagField { - public static FlagField after(FlagField previousField, E[] values) { - int offset = previousField.offset + previousField.bitWidth; - return new EnumLiteFlagField(offset, values); - } - - public static FlagField first(E[] values) { - return new EnumLiteFlagField(0, values); - } - - public static BooleanFlagField booleanFirst() { - return new BooleanFlagField(0); - } - - public static BooleanFlagField booleanAfter(FlagField previousField) { - int offset = previousField.offset + previousField.bitWidth; - return new BooleanFlagField(offset); - } public final int offset; public final int bitWidth; @@ -259,8 +26,6 @@ private FlagField(int offset, int bitWidth) { } public abstract E get(int flags); - - public abstract int toFlags(E value); } @SuppressWarnings("WeakerAccess") @@ -275,48 +40,6 @@ public Boolean get(int flags) { return (flags & (1 << offset)) != 0; } - @Override - public int toFlags(Boolean value) { - return value ? 1 << offset : 0; - } - public int invert(int flags) { return (flags ^ (1 << offset)); } } - - private static class EnumLiteFlagField extends FlagField { - private final E[] values; - - public EnumLiteFlagField(int offset, E[] values) { - super(offset, bitWidth(values)); - this.values = values; - } - - private static int bitWidth(@NotNull E[] enumEntries) { - int length = enumEntries.length - 1; - if (length == 0) return 1; - for (int i = 31; i >= 0; i--) { - if ((length & (1 << i)) != 0) return i + 1; - } - throw new IllegalStateException("Empty enum: " + enumEntries.getClass()); - } - - @Override - @Nullable - public E get(int flags) { - int maskUnshifted = (1 << bitWidth) - 1; - int mask = maskUnshifted << offset; - int value = (flags & mask) >> offset; - for (E e : values) { - if (e.getNumber() == value) { - return e; - } - } - return null; - } - - @Override - public int toFlags(E value) { - return value.getNumber() << offset; - } - } } diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt index 9cd9f6674d..c9b2aceabf 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt @@ -10,7 +10,3 @@ import com.google.protobuf.GeneratedMessageLite fun , T> GeneratedMessageLite.ExtendableMessage.getExtensionOrNull( extension: GeneratedMessageLite.GeneratedExtension ): T? = if (hasExtension(extension)) getExtension(extension) else null - -fun , T> GeneratedMessageLite.ExtendableMessage.getExtensionOrNull( - extension: GeneratedMessageLite.GeneratedExtension>, index: Int -): T? = if (index < getExtensionCount(extension)) getExtension(extension, index) else null diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt index 99a646716a..b685014ce6 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.metadata.deserialization -import com.google.protobuf.MessageLite import org.jetbrains.kotlin.metadata.ProtoBuf class VersionRequirementTable private constructor(private val infos: List) { @@ -20,99 +19,3 @@ class VersionRequirementTable private constructor(private val infos: List Unit, - writeVersionFull: (Int) -> Unit - ) = when { - this == INFINITY -> { - // Do nothing: absence of version means INFINITY - } - major > MAJOR_MASK || minor > MINOR_MASK || patch > PATCH_MASK -> { - writeVersionFull(major or (minor shl 8) or (patch shl 16)) - } - else -> { - writeVersion(major or (minor shl MAJOR_BITS) or (patch shl (MAJOR_BITS + MINOR_BITS))) - } - } - - override fun toString(): String = asString() - - companion object { - @JvmField - val INFINITY = Version(256, 256, 256) - - // Number of bits used for major, minor and patch components in "version" field - private const val MAJOR_BITS = 3 - private const val MINOR_BITS = 4 - private const val PATCH_BITS = 7 - private const val MAJOR_MASK = (1 shl MAJOR_BITS) - 1 - private const val MINOR_MASK = (1 shl MINOR_BITS) - 1 - private const val PATCH_MASK = (1 shl PATCH_BITS) - 1 - - fun decode(version: Int?, versionFull: Int?): Version = when { - versionFull != null -> Version( - major = versionFull and 255, - minor = (versionFull shr 8) and 255, - patch = (versionFull shr 16) and 255 - ) - version != null -> Version( - major = version and MAJOR_MASK, - minor = (version shr MAJOR_BITS) and MINOR_MASK, - patch = (version shr (MAJOR_BITS + MINOR_BITS)) and PATCH_MASK - ) - else -> INFINITY - } - } - } - - override fun toString(): String = - "since $version $level" + (if (errorCode != null) " error $errorCode" else "") + (if (message != null) ": $message" else "") - - companion object { - fun create(proto: MessageLite, nameResolver: NameResolver, table: VersionRequirementTable): List { - val ids = when (proto) { - is ProtoBuf.Class -> proto.versionRequirementList - is ProtoBuf.Constructor -> proto.versionRequirementList - is ProtoBuf.Function -> proto.versionRequirementList - is ProtoBuf.Property -> proto.versionRequirementList - is ProtoBuf.TypeAlias -> proto.versionRequirementList - else -> throw IllegalStateException("Unexpected declaration: ${proto::class.java}") - } - - return ids.mapNotNull { id -> create(id, nameResolver, table) } - } - - fun create(id: Int, nameResolver: NameResolver, table: VersionRequirementTable): VersionRequirement? { - val info = table[id] ?: return null - - val version = Version.decode( - if (info.hasVersion()) info.version else null, - if (info.hasVersionFull()) info.versionFull else null - ) - - val level = when (info.level!!) { - ProtoBuf.VersionRequirement.Level.WARNING -> DeprecationLevel.WARNING - ProtoBuf.VersionRequirement.Level.ERROR -> DeprecationLevel.ERROR - ProtoBuf.VersionRequirement.Level.HIDDEN -> DeprecationLevel.HIDDEN - } - - val errorCode = if (info.hasErrorCode()) info.errorCode else null - - val message = if (info.hasMessage()) nameResolver.getString(info.message) else null - - return VersionRequirement(version, info.versionKind, level, errorCode, message) - } - } -} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt index a693fc81a0..a8ff98ec13 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt @@ -18,98 +18,20 @@ package org.jetbrains.kotlin.metadata.deserialization import org.jetbrains.kotlin.metadata.ProtoBuf -// TODO: return null and report a diagnostic instead of throwing exceptions - -fun ProtoBuf.Class.supertypes(typeTable: TypeTable): List = - supertypeList.takeIf(Collection<*>::isNotEmpty) ?: supertypeIdList.map { typeTable[it] } - -fun ProtoBuf.Class.inlineClassUnderlyingType(typeTable: TypeTable): ProtoBuf.Type? = when { - hasInlineClassUnderlyingType() -> inlineClassUnderlyingType - hasInlineClassUnderlyingTypeId() -> typeTable[inlineClassUnderlyingTypeId] - else -> null -} - -fun ProtoBuf.Type.Argument.type(typeTable: TypeTable): ProtoBuf.Type? = when { - hasType() -> type - hasTypeId() -> typeTable[typeId] - else -> null -} - -fun ProtoBuf.Type.flexibleUpperBound(typeTable: TypeTable): ProtoBuf.Type? = when { - hasFlexibleUpperBound() -> flexibleUpperBound - hasFlexibleUpperBoundId() -> typeTable[flexibleUpperBoundId] - else -> null -} - -fun ProtoBuf.TypeParameter.upperBounds(typeTable: TypeTable): List = - upperBoundList.takeIf(Collection<*>::isNotEmpty) ?: upperBoundIdList.map { typeTable[it] } - fun ProtoBuf.Function.returnType(typeTable: TypeTable): ProtoBuf.Type = when { hasReturnType() -> returnType hasReturnTypeId() -> typeTable[returnTypeId] else -> error("No returnType in ProtoBuf.Function") } -fun ProtoBuf.Function.hasReceiver(): Boolean = hasReceiverType() || hasReceiverTypeId() - fun ProtoBuf.Function.receiverType(typeTable: TypeTable): ProtoBuf.Type? = when { hasReceiverType() -> receiverType hasReceiverTypeId() -> typeTable[receiverTypeId] else -> null } -fun ProtoBuf.Property.returnType(typeTable: TypeTable): ProtoBuf.Type = when { - hasReturnType() -> returnType - hasReturnTypeId() -> typeTable[returnTypeId] - else -> error("No returnType in ProtoBuf.Property") -} - -fun ProtoBuf.Property.hasReceiver(): Boolean = hasReceiverType() || hasReceiverTypeId() - -fun ProtoBuf.Property.receiverType(typeTable: TypeTable): ProtoBuf.Type? = when { - hasReceiverType() -> receiverType - hasReceiverTypeId() -> typeTable[receiverTypeId] - else -> null -} - fun ProtoBuf.ValueParameter.type(typeTable: TypeTable): ProtoBuf.Type = when { hasType() -> type hasTypeId() -> typeTable[typeId] else -> error("No type in ProtoBuf.ValueParameter") } - -fun ProtoBuf.ValueParameter.varargElementType(typeTable: TypeTable): ProtoBuf.Type? = when { - hasVarargElementType() -> varargElementType - hasVarargElementTypeId() -> typeTable[varargElementTypeId] - else -> null -} - -fun ProtoBuf.Type.outerType(typeTable: TypeTable): ProtoBuf.Type? = when { - hasOuterType() -> outerType - hasOuterTypeId() -> typeTable[outerTypeId] - else -> null -} - -fun ProtoBuf.Type.abbreviatedType(typeTable: TypeTable): ProtoBuf.Type? = when { - hasAbbreviatedType() -> abbreviatedType - hasAbbreviatedTypeId() -> typeTable[abbreviatedTypeId] - else -> null -} - -fun ProtoBuf.TypeAlias.underlyingType(typeTable: TypeTable): ProtoBuf.Type = when { - hasUnderlyingType() -> underlyingType - hasUnderlyingTypeId() -> typeTable[underlyingTypeId] - else -> error("No underlyingType in ProtoBuf.TypeAlias") -} - -fun ProtoBuf.TypeAlias.expandedType(typeTable: TypeTable): ProtoBuf.Type = when { - hasExpandedType() -> expandedType - hasExpandedTypeId() -> typeTable[expandedTypeId] - else -> error("No expandedType in ProtoBuf.TypeAlias") -} - -fun ProtoBuf.Expression.isInstanceType(typeTable: TypeTable): ProtoBuf.Type? = when { - hasIsInstanceType() -> isInstanceType - hasIsInstanceTypeId() -> typeTable[isInstanceTypeId] - else -> null -} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java index 98b5d4f960..05b4e5a6ae 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java @@ -5,22 +5,8 @@ public final class JvmProtoBuf { private JvmProtoBuf() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - registry.add(JvmProtoBuf.constructorSignature); + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { registry.add(JvmProtoBuf.methodSignature); - registry.add(JvmProtoBuf.lambdaClassOriginName); - registry.add(JvmProtoBuf.propertySignature); - registry.add(JvmProtoBuf.flags); - registry.add(JvmProtoBuf.typeAnnotation); - registry.add(JvmProtoBuf.isRaw); - registry.add(JvmProtoBuf.typeParameterAnnotation); - registry.add(JvmProtoBuf.classModuleName); - registry.add(JvmProtoBuf.classLocalVariable); - registry.add(JvmProtoBuf.anonymousObjectOriginName); - registry.add(JvmProtoBuf.jvmClassFlags); - registry.add(JvmProtoBuf.packageModuleName); - registry.add(JvmProtoBuf.packageLocalVariable); } public interface StringTableTypesOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) @@ -31,14 +17,6 @@ public interface StringTableTypesOrBuilder extends */ java.util.List getRecordList(); - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - StringTableTypes.Record getRecord(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - int getRecordCount(); /** * repeated int32 local_name = 5 [packed = true]; @@ -48,22 +26,6 @@ public interface StringTableTypesOrBuilder extends *
*/ 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.metadata.jvm.StringTableTypes} @@ -657,7 +619,7 @@ public String getString() { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { @@ -678,7 +640,7 @@ public String getString() { getStringBytes() { Object ref = string_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (String) ref); string_ = b; @@ -1083,7 +1045,7 @@ public Builder mergeFrom(Record other) { if (other.hasString()) { bitField0_ |= 0x00000004; string_ = other.string_; - + } if (other.hasOperation()) { setOperation(other.getOperation()); @@ -1096,7 +1058,7 @@ public Builder mergeFrom(Record other) { ensureSubstringIndexIsMutable(); substringIndex_.addAll(other.substringIndex_); } - + } if (!other.replaceChar_.isEmpty()) { if (replaceChar_.isEmpty()) { @@ -1106,7 +1068,7 @@ public Builder mergeFrom(Record other) { ensureReplaceCharIsMutable(); replaceChar_.addAll(other.replaceChar_); } - + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -1171,7 +1133,7 @@ public int getRange() { public Builder setRange(int value) { bitField0_ |= 0x00000001; range_ = value; - + return this; } /** @@ -1184,7 +1146,7 @@ public Builder setRange(int value) { public Builder clearRange() { bitField0_ = (bitField0_ & ~0x00000001); range_ = 1; - + return this; } @@ -1221,7 +1183,7 @@ public int getPredefinedIndex() { public Builder setPredefinedIndex(int value) { bitField0_ |= 0x00000002; predefinedIndex_ = value; - + return this; } /** @@ -1234,7 +1196,7 @@ public Builder setPredefinedIndex(int value) { public Builder clearPredefinedIndex() { bitField0_ = (bitField0_ & ~0x00000002); predefinedIndex_ = 0; - + return this; } @@ -1284,7 +1246,7 @@ public String getString() { getStringBytes() { Object ref = string_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (String) ref); string_ = b; @@ -1307,7 +1269,7 @@ public Builder setString( } bitField0_ |= 0x00000004; string_ = value; - + return this; } /** @@ -1320,7 +1282,7 @@ public Builder setString( public Builder clearString() { bitField0_ = (bitField0_ & ~0x00000004); string_ = getDefaultInstance().getString(); - + return this; } /** @@ -1337,7 +1299,7 @@ public Builder setStringBytes( } bitField0_ |= 0x00000004; string_ = value; - + return this; } @@ -1377,7 +1339,7 @@ public Builder setOperation(Operation value) { } bitField0_ |= 0x00000008; operation_ = value; - + return this; } /** @@ -1390,7 +1352,7 @@ public Builder setOperation(Operation value) { public Builder clearOperation() { bitField0_ = (bitField0_ & ~0x00000008); operation_ = Operation.NONE; - + return this; } @@ -1454,7 +1416,7 @@ public Builder setSubstringIndex( int index, int value) { ensureSubstringIndexIsMutable(); substringIndex_.set(index, value); - + return this; } /** @@ -1469,7 +1431,7 @@ public Builder setSubstringIndex( public Builder addSubstringIndex(int value) { ensureSubstringIndexIsMutable(); substringIndex_.add(value); - + return this; } /** @@ -1486,7 +1448,7 @@ public Builder addAllSubstringIndex( ensureSubstringIndexIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, substringIndex_); - + return this; } /** @@ -1501,7 +1463,7 @@ public Builder addAllSubstringIndex( public Builder clearSubstringIndex() { substringIndex_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); - + return this; } @@ -1561,7 +1523,7 @@ public Builder setReplaceChar( int index, int value) { ensureReplaceCharIsMutable(); replaceChar_.set(index, value); - + return this; } /** @@ -1575,7 +1537,7 @@ public Builder setReplaceChar( public Builder addReplaceChar(int value) { ensureReplaceCharIsMutable(); replaceChar_.add(value); - + return this; } /** @@ -1591,7 +1553,7 @@ public Builder addAllReplaceChar( ensureReplaceCharIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, replaceChar_); - + return this; } /** @@ -1605,7 +1567,7 @@ public Builder addAllReplaceChar( public Builder clearReplaceChar() { replaceChar_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); - + return this; } @@ -1636,20 +1598,6 @@ public java.util.List getRecordList() { getRecordOrBuilderList() { return record_; } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - @Override - public int getRecordCount() { - return record_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - @Override - public Record getRecord(int index) { - return record_.get(index); - } /** * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; */ @@ -1672,28 +1620,6 @@ public RecordOrBuilder getRecordOrBuilder( getLocalNameList() { return localName_; } - /** - * repeated int32 local_name = 5 [packed = true]; - * - *
-     * Indices of strings which are names of local classes or anonymous objects
-     * 
- */ - @Override - 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
-     * 
- */ - @Override - public int getLocalName(int index) { - return localName_.get(index); - } private int localNameMemoizedSerializedSize = -1; private void initFields() { @@ -1905,7 +1831,7 @@ public Builder mergeFrom(StringTableTypes other) { ensureRecordIsMutable(); record_.addAll(other.record_); } - + } if (!other.localName_.isEmpty()) { if (localName_.isEmpty()) { @@ -1915,7 +1841,7 @@ public Builder mergeFrom(StringTableTypes other) { ensureLocalNameIsMutable(); localName_.addAll(other.localName_); } - + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -1963,117 +1889,6 @@ private void ensureRecordIsMutable() { public java.util.List getRecordList() { return java.util.Collections.unmodifiableList(record_); } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - @Override - public int getRecordCount() { - return record_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - @Override - public Record getRecord(int index) { - return record_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder setRecord( - int index, Record value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRecordIsMutable(); - record_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder setRecord( - int index, Record.Builder builderForValue) { - ensureRecordIsMutable(); - record_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder addRecord(Record value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRecordIsMutable(); - record_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder addRecord( - int index, Record value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRecordIsMutable(); - record_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder addRecord( - Record.Builder builderForValue) { - ensureRecordIsMutable(); - record_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder addRecord( - int index, Record.Builder builderForValue) { - ensureRecordIsMutable(); - record_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder addAllRecord( - Iterable values) { - ensureRecordIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, record_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder clearRecord() { - record_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public Builder removeRecord(int index) { - ensureRecordIsMutable(); - record_.remove(index); - - return this; - } private java.util.List localName_ = java.util.Collections.emptyList(); private void ensureLocalNameIsMutable() { @@ -2094,83 +1909,6 @@ private void ensureLocalNameIsMutable() { 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
-       * 
- */ - @Override - 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
-       * 
- */ - @Override - 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( - Iterable values) { - ensureLocalNameIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.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.metadata.jvm.StringTableTypes) } @@ -2598,7 +2336,7 @@ public int getName() { public Builder setName(int value) { bitField0_ |= 0x00000001; name_ = value; - + return this; } /** @@ -2607,7 +2345,7 @@ public Builder setName(int value) { public Builder clearName() { bitField0_ = (bitField0_ & ~0x00000001); name_ = 0; - + return this; } @@ -2644,7 +2382,7 @@ public int getDesc() { public Builder setDesc(int value) { bitField0_ |= 0x00000002; desc_ = value; - + return this; } /** @@ -2657,7 +2395,7 @@ public Builder setDesc(int value) { public Builder clearDesc() { bitField0_ = (bitField0_ & ~0x00000002); desc_ = 0; - + return this; } @@ -2672,1280 +2410,9 @@ public Builder clearDesc() { // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) } - public interface JvmFieldSignatureOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional int32 name = 1; - */ - boolean hasName(); - /** - * optional int32 name = 1; - */ - int getName(); - - /** - * optional int32 desc = 2; - * - *
-     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
-     * 
- */ - boolean hasDesc(); - /** - * optional int32 desc = 2; - * - *
-     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
-     * 
- */ - int getDesc(); - } + public static final int METHOD_SIGNATURE_FIELD_NUMBER = 100; /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature} - */ - public static final class JvmFieldSignature extends - com.google.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) - JvmFieldSignatureOrBuilder { - // Use JvmFieldSignature.newBuilder() to construct. - private JvmFieldSignature(com.google.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private JvmFieldSignature(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - - private static final JvmFieldSignature defaultInstance; - public static JvmFieldSignature getDefaultInstance() { - return defaultInstance; - } - - @Override - public JvmFieldSignature getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.ByteString unknownFields; - private JvmFieldSignature( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - name_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - desc_ = input.readInt32(); - 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 { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @Override public JvmFieldSignature parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JvmFieldSignature(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private int name_; - /** - * optional int32 name = 1; - */ - @Override - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 name = 1; - */ - @Override - public int getName() { - return name_; - } - - public static final int DESC_FIELD_NUMBER = 2; - private int desc_; - /** - * optional int32 desc = 2; - * - *
-     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
-     * 
- */ - @Override - public boolean hasDesc() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 desc = 2; - * - *
-     * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
-     * 
- */ - @Override - public int getDesc() { - return desc_; - } - - private void initFields() { - name_ = 0; - desc_ = 0; - } - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, name_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, desc_); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - - @Override - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, name_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, desc_); - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static JvmFieldSignature parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static JvmFieldSignature parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static JvmFieldSignature parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static JvmFieldSignature parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static JvmFieldSignature parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static JvmFieldSignature parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static JvmFieldSignature parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static JvmFieldSignature parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static JvmFieldSignature parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static JvmFieldSignature 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(); } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(JvmFieldSignature prototype) { - return newBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - JvmFieldSignature, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) - JvmFieldSignatureOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.JvmFieldSignature.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override public Builder clear() { - super.clear(); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - desc_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @Override public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override - public JvmFieldSignature getDefaultInstanceForType() { - return JvmFieldSignature.getDefaultInstance(); - } - - @Override - public JvmFieldSignature build() { - JvmFieldSignature result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public JvmFieldSignature buildPartial() { - JvmFieldSignature result = new JvmFieldSignature(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.desc_ = desc_; - result.bitField0_ = to_bitField0_; - return result; - } - - @Override - public Builder mergeFrom(JvmFieldSignature other) { - if (other == JvmFieldSignature.getDefaultInstance()) return this; - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasDesc()) { - setDesc(other.getDesc()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - JvmFieldSignature parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (JvmFieldSignature) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int name_ ; - /** - * optional int32 name = 1; - */ - @Override - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 name = 1; - */ - @Override - public int getName() { - return name_; - } - /** - * optional int32 name = 1; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000001; - name_ = value; - - return this; - } - /** - * optional int32 name = 1; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - - return this; - } - - private int desc_ ; - /** - * optional int32 desc = 2; - * - *
-       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
-       * 
- */ - @Override - public boolean hasDesc() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 desc = 2; - * - *
-       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
-       * 
- */ - @Override public int getDesc() { - return desc_; - } - /** - * optional int32 desc = 2; - * - *
-       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
-       * 
- */ - public Builder setDesc(int value) { - bitField0_ |= 0x00000002; - desc_ = value; - - return this; - } - /** - * optional int32 desc = 2; - * - *
-       * JVM descriptor of the field type, e.g. 'Ljava/lang/String;'
-       * 
- */ - public Builder clearDesc() { - bitField0_ = (bitField0_ & ~0x00000002); - desc_ = 0; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) - } - - static { - defaultInstance = new JvmFieldSignature(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature) - } - - public interface JvmPropertySignatureOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - boolean hasField(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - JvmFieldSignature getField(); - - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-     * Annotations on properties are written on a synthetic method with this signature
-     * 
- */ - boolean hasSyntheticMethod(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-     * Annotations on properties are written on a synthetic method with this signature
-     * 
- */ - JvmMethodSignature getSyntheticMethod(); - - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - boolean hasGetter(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - JvmMethodSignature getGetter(); - - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - boolean hasSetter(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - JvmMethodSignature getSetter(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature} - */ - public static final class JvmPropertySignature extends - com.google.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) - JvmPropertySignatureOrBuilder { - // Use JvmPropertySignature.newBuilder() to construct. - private JvmPropertySignature(com.google.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private JvmPropertySignature(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} - - private static final JvmPropertySignature defaultInstance; - public static JvmPropertySignature getDefaultInstance() { - return defaultInstance; - } - - @Override public JvmPropertySignature getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.ByteString unknownFields; - private JvmPropertySignature( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - JvmFieldSignature.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = field_.toBuilder(); - } - field_ = input.readMessage(JvmFieldSignature.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(field_); - field_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: { - JvmMethodSignature.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = syntheticMethod_.toBuilder(); - } - syntheticMethod_ = input.readMessage(JvmMethodSignature.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(syntheticMethod_); - syntheticMethod_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 26: { - JvmMethodSignature.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = getter_.toBuilder(); - } - getter_ = input.readMessage(JvmMethodSignature.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(getter_); - getter_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 34: { - JvmMethodSignature.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - subBuilder = setter_.toBuilder(); - } - setter_ = input.readMessage(JvmMethodSignature.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(setter_); - setter_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000008; - 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 { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @Override public JvmPropertySignature parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JvmPropertySignature(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int FIELD_FIELD_NUMBER = 1; - private JvmFieldSignature field_; - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - @Override public boolean hasField() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - @Override public JvmFieldSignature getField() { - return field_; - } - - public static final int SYNTHETIC_METHOD_FIELD_NUMBER = 2; - private JvmMethodSignature syntheticMethod_; - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-     * Annotations on properties are written on a synthetic method with this signature
-     * 
- */ - @Override public boolean hasSyntheticMethod() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-     * Annotations on properties are written on a synthetic method with this signature
-     * 
- */ - @Override public JvmMethodSignature getSyntheticMethod() { - return syntheticMethod_; - } - - public static final int GETTER_FIELD_NUMBER = 3; - private JvmMethodSignature getter_; - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - @Override public boolean hasGetter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - @Override public JvmMethodSignature getGetter() { - return getter_; - } - - public static final int SETTER_FIELD_NUMBER = 4; - private JvmMethodSignature setter_; - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - @Override public boolean hasSetter() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - @Override public JvmMethodSignature getSetter() { - return setter_; - } - - private void initFields() { - field_ = JvmFieldSignature.getDefaultInstance(); - syntheticMethod_ = JvmMethodSignature.getDefaultInstance(); - getter_ = JvmMethodSignature.getDefaultInstance(); - setter_ = JvmMethodSignature.getDefaultInstance(); - } - private byte memoizedIsInitialized = -1; - @Override public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, field_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, syntheticMethod_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(3, getter_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(4, setter_); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, field_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, syntheticMethod_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getter_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, setter_); - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static JvmPropertySignature parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static JvmPropertySignature parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static JvmPropertySignature parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static JvmPropertySignature parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static JvmPropertySignature parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static JvmPropertySignature parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static JvmPropertySignature parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static JvmPropertySignature parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static JvmPropertySignature parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static JvmPropertySignature 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(); } - @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(JvmPropertySignature prototype) { - return newBuilder().mergeFrom(prototype); - } - @Override public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - JvmPropertySignature, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) - JvmPropertySignatureOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.JvmPropertySignature.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override public Builder clear() { - super.clear(); - field_ = JvmFieldSignature.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000001); - syntheticMethod_ = JvmMethodSignature.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000002); - getter_ = JvmMethodSignature.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000004); - setter_ = JvmMethodSignature.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @Override public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override public JvmPropertySignature getDefaultInstanceForType() { - return JvmPropertySignature.getDefaultInstance(); - } - - @Override public JvmPropertySignature build() { - JvmPropertySignature result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override public JvmPropertySignature buildPartial() { - JvmPropertySignature result = new JvmPropertySignature(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.field_ = field_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.syntheticMethod_ = syntheticMethod_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.getter_ = getter_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.setter_ = setter_; - result.bitField0_ = to_bitField0_; - return result; - } - - @Override public Builder mergeFrom(JvmPropertySignature other) { - if (other == JvmPropertySignature.getDefaultInstance()) return this; - if (other.hasField()) { - mergeField(other.getField()); - } - if (other.hasSyntheticMethod()) { - mergeSyntheticMethod(other.getSyntheticMethod()); - } - if (other.hasGetter()) { - mergeGetter(other.getGetter()); - } - if (other.hasSetter()) { - mergeSetter(other.getSetter()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override public final boolean isInitialized() { - return true; - } - - @Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - JvmPropertySignature parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (JvmPropertySignature) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private JvmFieldSignature field_ = JvmFieldSignature.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - @Override public boolean hasField() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - @Override public JvmFieldSignature getField() { - return field_; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - public Builder setField(JvmFieldSignature value) { - if (value == null) { - throw new NullPointerException(); - } - field_ = value; - - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - public Builder setField( - JvmFieldSignature.Builder builderForValue) { - field_ = builderForValue.build(); - - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - public Builder mergeField(JvmFieldSignature value) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - field_ != JvmFieldSignature.getDefaultInstance()) { - field_ = - JvmFieldSignature.newBuilder(field_).mergeFrom(value).buildPartial(); - } else { - field_ = value; - } - - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmFieldSignature field = 1; - */ - public Builder clearField() { - field_ = JvmFieldSignature.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - private JvmMethodSignature syntheticMethod_ = JvmMethodSignature.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-       * Annotations on properties are written on a synthetic method with this signature
-       * 
- */ - @Override public boolean hasSyntheticMethod() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-       * Annotations on properties are written on a synthetic method with this signature
-       * 
- */ - @Override public JvmMethodSignature getSyntheticMethod() { - return syntheticMethod_; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-       * Annotations on properties are written on a synthetic method with this signature
-       * 
- */ - public Builder setSyntheticMethod(JvmMethodSignature value) { - if (value == null) { - throw new NullPointerException(); - } - syntheticMethod_ = value; - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-       * Annotations on properties are written on a synthetic method with this signature
-       * 
- */ - public Builder setSyntheticMethod( - JvmMethodSignature.Builder builderForValue) { - syntheticMethod_ = builderForValue.build(); - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-       * Annotations on properties are written on a synthetic method with this signature
-       * 
- */ - public Builder mergeSyntheticMethod(JvmMethodSignature value) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - syntheticMethod_ != JvmMethodSignature.getDefaultInstance()) { - syntheticMethod_ = - JvmMethodSignature.newBuilder(syntheticMethod_).mergeFrom(value).buildPartial(); - } else { - syntheticMethod_ = value; - } - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature synthetic_method = 2; - * - *
-       * Annotations on properties are written on a synthetic method with this signature
-       * 
- */ - public Builder clearSyntheticMethod() { - syntheticMethod_ = JvmMethodSignature.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - private JvmMethodSignature getter_ = JvmMethodSignature.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - @Override public boolean hasGetter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - @Override public JvmMethodSignature getGetter() { - return getter_; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - public Builder setGetter(JvmMethodSignature value) { - if (value == null) { - throw new NullPointerException(); - } - getter_ = value; - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - public Builder setGetter( - JvmMethodSignature.Builder builderForValue) { - getter_ = builderForValue.build(); - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - public Builder mergeGetter(JvmMethodSignature value) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - getter_ != JvmMethodSignature.getDefaultInstance()) { - getter_ = - JvmMethodSignature.newBuilder(getter_).mergeFrom(value).buildPartial(); - } else { - getter_ = value; - } - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature getter = 3; - */ - public Builder clearGetter() { - getter_ = JvmMethodSignature.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - private JvmMethodSignature setter_ = JvmMethodSignature.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - @Override public boolean hasSetter() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - @Override public JvmMethodSignature getSetter() { - return setter_; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - public Builder setSetter(JvmMethodSignature value) { - if (value == null) { - throw new NullPointerException(); - } - setter_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - public Builder setSetter( - JvmMethodSignature.Builder builderForValue) { - setter_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - public Builder mergeSetter(JvmMethodSignature value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - setter_ != JvmMethodSignature.getDefaultInstance()) { - setter_ = - JvmMethodSignature.newBuilder(setter_).mergeFrom(value).buildPartial(); - } else { - setter_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature setter = 4; - */ - public Builder clearSetter() { - setter_ = JvmMethodSignature.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) - } - - static { - defaultInstance = new JvmPropertySignature(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.JvmPropertySignature) - } - - public static final int CONSTRUCTOR_SIGNATURE_FIELD_NUMBER = 100; - /** - * extend .org.jetbrains.kotlin.metadata.Constructor { ... } - */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Constructor, - JvmMethodSignature> constructorSignature = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance(), - JvmMethodSignature.getDefaultInstance(), - JvmMethodSignature.getDefaultInstance(), - null, - 100, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - JvmMethodSignature.class); - public static final int METHOD_SIGNATURE_FIELD_NUMBER = 100; - /** - * extend .org.jetbrains.kotlin.metadata.Function { ... } + * extend .org.jetbrains.kotlin.metadata.Function { ... } */ public static final com.google.protobuf.GeneratedMessageLite.GeneratedExtension< @@ -3959,225 +2426,6 @@ public Builder clearSetter() { 100, com.google.protobuf.WireFormat.FieldType.MESSAGE, JvmMethodSignature.class); - public static final int LAMBDA_CLASS_ORIGIN_NAME_FIELD_NUMBER = 101; - /** - * extend .org.jetbrains.kotlin.metadata.Function { ... } - * - *
-   * For lambdas from bodies of inline functions copied to the use site, the JVM internal name of the original
-   * lambda class this class is copied from
-   * 
- */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Function, - Integer> lambdaClassOriginName = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance(), - 0, - null, - null, - 101, - com.google.protobuf.WireFormat.FieldType.INT32, - Integer.class); - public static final int PROPERTY_SIGNATURE_FIELD_NUMBER = 100; - /** - * extend .org.jetbrains.kotlin.metadata.Property { ... } - */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Property, - JvmPropertySignature> propertySignature = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(), - JvmPropertySignature.getDefaultInstance(), - JvmPropertySignature.getDefaultInstance(), - null, - 100, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - JvmPropertySignature.class); - public static final int FLAGS_FIELD_NUMBER = 101; - /** - * extend .org.jetbrains.kotlin.metadata.Property { ... } - * - *
-   **
-   *isMovedFromInterfaceCompanion   true if this property is declared in an interface companion, and the field is stored in the interface
-   * 
- */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Property, - Integer> flags = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(), - 0, - null, - null, - 101, - com.google.protobuf.WireFormat.FieldType.INT32, - Integer.class); - public static final int TYPE_ANNOTATION_FIELD_NUMBER = 100; - /** - * extend .org.jetbrains.kotlin.metadata.Type { ... } - */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Type, - java.util.List> typeAnnotation = com.google.protobuf.GeneratedMessageLite - .newRepeatedGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(), - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(), - null, - 100, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - false, - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class); - public static final int IS_RAW_FIELD_NUMBER = 101; - /** - * extend .org.jetbrains.kotlin.metadata.Type { ... } - */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Type, - Boolean> isRaw = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(), - false, - null, - null, - 101, - com.google.protobuf.WireFormat.FieldType.BOOL, - Boolean.class); - public static final int TYPE_PARAMETER_ANNOTATION_FIELD_NUMBER = 100; - /** - * extend .org.jetbrains.kotlin.metadata.TypeParameter { ... } - */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter, - java.util.List> typeParameterAnnotation = com.google.protobuf.GeneratedMessageLite - .newRepeatedGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.getDefaultInstance(), - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(), - null, - 100, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - false, - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class); - public static final int CLASS_MODULE_NAME_FIELD_NUMBER = 101; - /** - * extend .org.jetbrains.kotlin.metadata.Class { ... } - * - *
-   * If absent, assumed to be "main" (JvmProtoBufUtil.DEFAULT_MODULE_NAME)
-   * 
- */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Class, - Integer> classModuleName = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(), - 0, - null, - null, - 101, - com.google.protobuf.WireFormat.FieldType.INT32, - Integer.class); - public static final int CLASS_LOCAL_VARIABLE_FIELD_NUMBER = 102; - /** - * extend .org.jetbrains.kotlin.metadata.Class { ... } - */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Class, - java.util.List> classLocalVariable = com.google.protobuf.GeneratedMessageLite - .newRepeatedGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(), - org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(), - null, - 102, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - false, - org.jetbrains.kotlin.metadata.ProtoBuf.Property.class); - public static final int ANONYMOUS_OBJECT_ORIGIN_NAME_FIELD_NUMBER = 103; - /** - * extend .org.jetbrains.kotlin.metadata.Class { ... } - * - *
-   * For anonymous objects from bodies of inline functions copied to the use site, the JVM internal name of the original
-   * anonymous object this class is copied from
-   * 
- */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Class, - Integer> anonymousObjectOriginName = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(), - 0, - null, - null, - 103, - com.google.protobuf.WireFormat.FieldType.INT32, - Integer.class); - public static final int JVM_CLASS_FLAGS_FIELD_NUMBER = 104; - /** - * extend .org.jetbrains.kotlin.metadata.Class { ... } - * - *
-   * first bit: isFunctionBodyInInterface: 0 if actual body generated in DefaultImpl, 1 - otherwise (in interface default method)
-   * second bit: is all-compatibility mode or not, 1 - yes, 0 - no
-   * 
- */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Class, - Integer> jvmClassFlags = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(), - 0, - null, - null, - 104, - com.google.protobuf.WireFormat.FieldType.INT32, - Integer.class); - public static final int PACKAGE_MODULE_NAME_FIELD_NUMBER = 101; - /** - * extend .org.jetbrains.kotlin.metadata.Package { ... } - */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Package, - Integer> packageModuleName = com.google.protobuf.GeneratedMessageLite - .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(), - 0, - null, - null, - 101, - com.google.protobuf.WireFormat.FieldType.INT32, - Integer.class); - public static final int PACKAGE_LOCAL_VARIABLE_FIELD_NUMBER = 102; - /** - * extend .org.jetbrains.kotlin.metadata.Package { ... } - */ - public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Package, - java.util.List> packageLocalVariable = com.google.protobuf.GeneratedMessageLite - .newRepeatedGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Package.getDefaultInstance(), - org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(), - null, - 102, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - false, - org.jetbrains.kotlin.metadata.ProtoBuf.Property.class); - - static { - } // @@protoc_insertion_point(outer_class_scope) } \ No newline at end of file diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java index 1fa961b25d..20d7042b94 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java @@ -13,164 +13,18 @@ import static org.jetbrains.kotlin.metadata.jvm.deserialization.UtfEncodingKt.MAX_UTF8_INFO_LENGTH; public class BitEncoding { - private static final boolean FORCE_8TO7_ENCODING; - - static { - String use8to7; - try { - use8to7 = System.getProperty("kotlin.jvm.serialization.use8to7"); - } - catch (SecurityException e) { - use8to7 = null; - } - - FORCE_8TO7_ENCODING = "true".equals(use8to7); - } private static final char _8TO7_MODE_MARKER = (char) -1; private BitEncoding() { } - /** - * Converts a byte array of serialized data to an array of {@code String} satisfying JVM annotation value argument restrictions: - *
    - *
  1. Each string's length should be no more than 65535
  2. - *
  3. UTF-8 representation of each string cannot contain bytes in the range 0xf0..0xff
  4. - *
- */ - @NotNull - public static String[] encodeBytes(@NotNull byte[] data) { - // TODO: try both encodings here and choose the best one (with the smallest size) - if (!FORCE_8TO7_ENCODING) { - return UtfEncodingKt.bytesToStrings(data); - } - byte[] bytes = encode8to7(data); - // Since 0x0 byte is encoded as two bytes in the Modified UTF-8 (0xc0 0x80) and zero is rather common to byte arrays, we increment - // every byte by one modulo max byte value, so that the less common value 0x7f will be represented as two bytes instead. - addModuloByte(bytes, 1); - return splitBytesToStringArray(bytes); - } - - /** - * Converts a byte array to another byte array, every element of which is in the range 0x0..0x7f. - * - * The conversion is equivalent to the following: input bytes are combined into one long bit string. This big string is then split into - * groups of 7 bits. Each resulting 7-bit chunk is then converted to a byte (with a leading bit = 0). The last chunk may have less than - * 7 bits, it's prepended with zeros to form a byte. The result is then the array of these bytes, each of which is obviously in the - * range 0x0..0x7f. - * - * Suppose the input of 4 bytes is given (bytes are listed from the beginning to the end, each byte from the least significant bit to - * the most significant bit, bits within each byte are numbered): - * - * 01234567 01234567 01234567 01234567 - * - * The output for this kind of input will be of the following form ('#' represents a zero bit): - * - * 0123456# 7012345# 6701234# 5670123# 4567#### - */ - @NotNull - private static byte[] encode8to7(@NotNull byte[] data) { - // ceil(data.length * 8 / 7) - int resultLength = (data.length * 8 + 6) / 7; - byte[] result = new byte[resultLength]; - - // We maintain a pointer to the bit in the input, which is represented by two numbers: index of the current byte in the input and - // the index of a bit inside this byte (0 is least significant, 7 is most significant) - int byteIndex = 0; - int bit = 0; - - // Write all resulting bytes except the last one. To do this we need to collect exactly 7 bits, starting from the current, into a - // byte. In almost all cases these 7 bits can be collected from two parts: the first is several (at least one) most significant bits - // from the current byte, the second is several (maybe zero) least significant bits from the next byte. The special case is when the - // current bit is the first (least significant) bit in its byte (bit == 0): then the 7 needed bits are just the 7 least significant - // of the current byte. - for (int i = 0; i < resultLength - 1; i++) { - if (bit == 0) { - result[i] = (byte) (data[byteIndex] & 0x7f); - bit = 7; - continue; - } - - int firstPart = (data[byteIndex] & 0xff) >>> bit; - int newBit = (bit + 7) & 7; - int secondPart = (data[++byteIndex] & ((1 << newBit) - 1)) << 8 - bit; - result[i] = (byte) (firstPart + secondPart); - bit = newBit; - } - - // Write the last byte, which is just several most significant bits of the last byte in the input, padded with zeros - if (resultLength > 0) { - assert bit != 0 : "The last chunk cannot start from the input byte since otherwise at least one bit will remain unprocessed"; - assert byteIndex == data.length - 1 : "The last 7-bit chunk should be encoded from the last input byte: " + - byteIndex + " != " + (data.length - 1); - result[resultLength - 1] = (byte) ((data[byteIndex] & 0xff) >>> bit); - } - - return result; - } - private static void addModuloByte(@NotNull byte[] data, int increment) { for (int i = 0, n = data.length; i < n; i++) { data[i] = (byte) ((data[i] + increment) & 0x7f); } } - /** - * Converts a big byte array into the array of strings, where each string, when written to the constant pool table in bytecode, produces - * a byte array of not more than MAX_UTF8_INFO_LENGTH. Each byte, except those which are 0x0, occupies exactly one byte in the constant - * pool table. Zero bytes occupy two bytes in the table each. - * - * When strings are constructed from the array of bytes here, they are encoded in the platform's default encoding. This is fine: the - * conversion to the Modified UTF-8 (which here would be equivalent to replacing each 0x0 with 0xc0 0x80) will happen later by ASM, when - * it writes these strings to the bytecode - */ - @NotNull - private static String[] splitBytesToStringArray(@NotNull byte[] data) { - List result = new ArrayList(); - - // The offset where the currently processed string starts - int off = 0; - - // The effective length the bytes of the current string would occupy in the constant pool table. - // 2 because the first char is -1 which denotes the encoding mode and occupies two bytes in Modified UTF-8 - int len = 2; - - boolean encodingModeAdded = false; - - for (int i = 0, n = data.length; i < n; i++) { - // When the effective length reaches at least MAX - 1, we add the current string to the result. Note that the effective length - // is at most MAX here: non-zero bytes occupy 1 byte and zero bytes occupy 2 bytes, so we couldn't jump over more than one byte - if (len >= MAX_UTF8_INFO_LENGTH - 1) { - assert len <= MAX_UTF8_INFO_LENGTH : "Produced strings cannot contain more than " + MAX_UTF8_INFO_LENGTH + " bytes: " + len; - String string = new String(data, off, i - off); - if (!encodingModeAdded) { - encodingModeAdded = true; - result.add(_8TO7_MODE_MARKER + string); - } - else { - result.add(string); - } - off = i; - len = 0; - } - - if (data[i] == 0) { - len += 2; - } - else { - len++; - } - } - - if (len >= 0) { - result.add(new String(data, off, data.length - off)); - } - - //noinspection SSBasedInspection - return result.toArray(new String[result.size()]); - } - /** * Converts encoded array of {@code String} obtained by {@link BitEncoding#encodeBytes(byte[])} back to a byte array. */ diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmFlags.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmFlags.kt deleted file mode 100644 index c1471b4cc1..0000000000 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmFlags.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.metadata.jvm.deserialization - -import org.jetbrains.kotlin.metadata.deserialization.Flags - -/** - * @see Flags - */ -object JvmFlags { - // Properties - val IS_MOVED_FROM_INTERFACE_COMPANION = Flags.FlagField.booleanFirst() - - //Class - val ARE_INTERFACE_METHOD_BODIES_INSIDE = Flags.FlagField.booleanFirst() - val IS_ALL_COMPATIBILITY_MODE = Flags.FlagField.booleanAfter(ARE_INTERFACE_METHOD_BODIES_INSIDE) - - fun getPropertyFlags(isMovedFromInterfaceCompanion: Boolean): Int = - IS_MOVED_FROM_INTERFACE_COMPANION.toFlags(isMovedFromInterfaceCompanion) - - fun getClassFlags(isAllInterfaceBodiesInside: Boolean, isAllCompatibilityMode: Boolean): Int = - ARE_INTERFACE_METHOD_BODIES_INSIDE.toFlags(isAllInterfaceBodiesInside) or IS_ALL_COMPATIBILITY_MODE.toFlags(isAllCompatibilityMode) - -} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt index 22ae894022..00861f4eac 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt @@ -27,8 +27,5 @@ class JvmMetadataVersion(versionArray: IntArray, val isStrictSemantics: Boolean) companion object { @JvmField val INSTANCE = JvmMetadataVersion(1, 5, 1) - - @JvmField - val INVALID_VERSION = JvmMetadataVersion() } } diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt index 45dfe1d8ea..2ff5324918 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt @@ -112,9 +112,5 @@ class JvmNameResolver( "$kotlin/collections/Iterator", "$kotlin/collections/MutableIterator", "$kotlin/collections/ListIterator", "$kotlin/collections/MutableListIterator" ) - - private val PREDEFINED_STRINGS_MAP = PREDEFINED_STRINGS.withIndex().associateBy({ it.value }, { it.index }) - - fun getPredefinedStringIndex(string: String): Int? = PREDEFINED_STRINGS_MAP[string] } } diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt index 1df851e6dd..380da878d5 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt @@ -6,23 +6,16 @@ package org.jetbrains.kotlin.metadata.jvm.deserialization import com.google.protobuf.ExtensionRegistryLite -import com.google.protobuf.MessageLite import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.metadata.deserialization.* import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf -import org.jetbrains.kotlin.metadata.jvm.serialization.JvmStringTable import java.io.ByteArrayInputStream -import java.io.ByteArrayOutputStream import java.io.InputStream object JvmProtoBufUtil { val EXTENSION_REGISTRY: ExtensionRegistryLite = ExtensionRegistryLite.newInstance().apply(JvmProtoBuf::registerAllExtensions) - const val PLATFORM_TYPE_ID = "kotlin.jvm.PlatformType" - - const val DEFAULT_MODULE_NAME = "main" - @JvmStatic fun readClassDataFrom(data: Array, strings: Array): Pair = readClassDataFrom(BitEncoding.decodeBytes(data), strings) @@ -33,35 +26,9 @@ object JvmProtoBufUtil { return Pair(input.readNameResolver(strings), ProtoBuf.Class.parseFrom(input, EXTENSION_REGISTRY)) } - @JvmStatic - fun readPackageDataFrom(data: Array, strings: Array): Pair = - readPackageDataFrom(BitEncoding.decodeBytes(data), strings) - - @JvmStatic - fun readPackageDataFrom(bytes: ByteArray, strings: Array): Pair { - val input = ByteArrayInputStream(bytes) - return Pair(input.readNameResolver(strings), ProtoBuf.Package.parseFrom(input, EXTENSION_REGISTRY)) - } - - @JvmStatic - fun readFunctionDataFrom(data: Array, strings: Array): Pair { - val input = ByteArrayInputStream(BitEncoding.decodeBytes(data)) - return Pair(input.readNameResolver(strings), ProtoBuf.Function.parseFrom(input, EXTENSION_REGISTRY)) - } - private fun InputStream.readNameResolver(strings: Array): JvmNameResolver = JvmNameResolver(JvmProtoBuf.StringTableTypes.parseDelimitedFrom(this, EXTENSION_REGISTRY), strings) - /** - * Serializes [message] and [stringTable] into a string array which must be further written to [Metadata.data1] - */ - @JvmStatic - fun writeData(message: MessageLite, stringTable: JvmStringTable): Array = - BitEncoding.encodeBytes(ByteArrayOutputStream().apply { - stringTable.serializeTo(this) - message.writeTo(this) - }.toByteArray()) - // returns JVM signature in the format: "equals(Ljava/lang/Object;)Z" fun getJvmMethodSignature( proto: ProtoBuf.Function, @@ -83,55 +50,7 @@ object JvmProtoBufUtil { return JvmMemberSignature.Method(nameResolver.getString(name), desc) } - fun getJvmConstructorSignature( - proto: ProtoBuf.Constructor, - nameResolver: NameResolver, - typeTable: TypeTable - ): JvmMemberSignature.Method? { - val signature = proto.getExtensionOrNull(JvmProtoBuf.constructorSignature) - val name = if (signature != null && signature.hasName()) { - nameResolver.getString(signature.name) - } else { - "" - } - val desc = if (signature != null && signature.hasDesc()) { - nameResolver.getString(signature.desc) - } else { - proto.valueParameterList.map { - mapTypeDefault(it.type(typeTable), nameResolver) ?: return null - }.joinToString(separator = "", prefix = "(", postfix = ")V") - } - return JvmMemberSignature.Method(name, desc) - } - - fun getJvmFieldSignature( - proto: ProtoBuf.Property, - nameResolver: NameResolver, - typeTable: TypeTable, - requireHasFieldFlag: Boolean = true - ): JvmMemberSignature.Field? { - val signature = proto.getExtensionOrNull(JvmProtoBuf.propertySignature) ?: return null - val field = if (signature.hasField()) signature.field else null - if (field == null && requireHasFieldFlag) return null - - val name = if (field != null && field.hasName()) field.name else proto.name - val desc = - if (field != null && field.hasDesc()) nameResolver.getString(field.desc) - else mapTypeDefault(proto.returnType(typeTable), nameResolver) ?: return null - - return JvmMemberSignature.Field(nameResolver.getString(name), desc) - } - - private fun mapTypeDefault(type: ProtoBuf.Type, nameResolver: NameResolver): String? { return if (type.hasClassName()) ClassMapperLite.mapClass(nameResolver.getQualifiedClassName(type.className)) else null } - - @JvmStatic - fun isMovedFromInterfaceCompanion(proto: ProtoBuf.Property): Boolean = - JvmFlags.IS_MOVED_FROM_INTERFACE_COMPANION.get(proto.getExtension(JvmProtoBuf.flags)) - - @JvmStatic - fun isNewPlaceForBodyGeneration(proto: ProtoBuf.Class): Boolean = - JvmFlags.ARE_INTERFACE_METHOD_BODIES_INSIDE.get(proto.getExtension(JvmProtoBuf.jvmClassFlags)) } diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt index 9d8f3ad993..afb257c6d7 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt +++ b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt @@ -23,38 +23,6 @@ const val MAX_UTF8_INFO_LENGTH = 65535 const val UTF8_MODE_MARKER = 0.toChar() -fun bytesToStrings(bytes: ByteArray): Array { - val result = ArrayList(1) - val buffer = StringBuilder() - var bytesInBuffer = 0 - - buffer.append(UTF8_MODE_MARKER) - // Zeros effectively occupy two bytes because each 0x0 is converted to 0x80 0xc0 in Modified UTF-8, see JVMS7 4.4.7 - bytesInBuffer += 2 - - for (b in bytes) { - val c = b.toInt() and 0xFF // 0 <= c <= 255 - buffer.append(c.toChar()) - if (b in 1..127) { - bytesInBuffer++ - } else { - bytesInBuffer += 2 - } - - if (bytesInBuffer >= MAX_UTF8_INFO_LENGTH - 1) { - result.add(buffer.toString()) - buffer.setLength(0) - bytesInBuffer = 0 - } - } - - if (!buffer.isEmpty()) { - result.add(buffer.toString()) - } - - return result.toTypedArray() -} - fun stringsToBytes(strings: Array): ByteArray { val resultLength = strings.sumBy { it.length } val result = ByteArray(resultLength) diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/serialization/JvmStringTable.kt b/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/serialization/JvmStringTable.kt deleted file mode 100644 index d9676c752b..0000000000 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/serialization/JvmStringTable.kt +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.metadata.jvm.serialization - -import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf -import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record -import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolver -import org.jetbrains.kotlin.metadata.serialization.StringTable -import java.io.OutputStream - -// TODO: optimize by reordering records to minimize storage of 'range' fields -open class JvmStringTable(nameResolver: JvmNameResolver? = null) : StringTable { - val strings = ArrayList() - private val records = ArrayList() - private val map = HashMap() - private val localNames = LinkedHashSet() - - init { - if (nameResolver != null) { - strings.addAll(nameResolver.strings) - nameResolver.types.recordList.mapTo(records, JvmProtoBuf.StringTableTypes.Record::toBuilder) - for (index in strings.indices) { - map[nameResolver.getString(index)] = index - } - localNames.addAll(nameResolver.types.localNameList) - } - } - - override fun getStringIndex(string: String): Int = - map.getOrPut(string) { - strings.size.apply { - strings.add(string) - - val lastRecord = records.lastOrNull() - if (lastRecord != null && lastRecord.isTrivial()) { - lastRecord.range = lastRecord.range + 1 - } else records.add(Record.newBuilder()) - } - } - - private fun Record.Builder.isTrivial(): Boolean { - return !hasPredefinedIndex() && !hasOperation() && substringIndexCount == 0 && replaceCharCount == 0 - } - - // We use the following format to encode ClassId: "pkg/Outer.Inner". - // It represents a unique name, but such names don't usually appear in the constant pool, so we're writing "Lpkg/Outer$Inner;" - // instead and an instruction to drop the first and the last character in this string and replace all '$' with '.'. - // This works most of the time, except in two rare cases: - // - the name of the class or any of its outer classes contains dollars. In this case we're just storing the described - // string literally: "pkg/Outer.Inner$with$dollars" - // - the class is local or nested in local. In this case we're also storing the literal string, and also storing the fact that - // this name represents a local class in a separate list - override fun getQualifiedClassNameIndex(className: String, isLocal: Boolean): Int { - map[className]?.let { recordedIndex -> - // If we already recorded such string, we only return its index if it's local and our name is local - // OR it's not local and our name is not local as well - if (isLocal == (recordedIndex in localNames)) { - return recordedIndex - } - } - - val index = strings.size - if (isLocal) { - localNames.add(index) - } - - val record = Record.newBuilder() - - // If the class is local or any of its outer class names contains '$', store a literal string - if (isLocal || '$' in className) { - strings.add(className) - } else { - val predefinedIndex = JvmNameResolver.getPredefinedStringIndex(className) - if (predefinedIndex != null) { - record.predefinedIndex = predefinedIndex - // 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.operation = Record.Operation.DESC_TO_CLASS_ID - strings.add("L${className.replace('.', '$')};") - } - } - - records.add(record) - - map[className] = index - - return index - } - - fun serializeTo(output: OutputStream) { - with(JvmProtoBuf.StringTableTypes.newBuilder()) { - addAllRecord(records.map { it.build() }) - addAllLocalName(localNames) - build().writeDelimitedTo(output) - } - } -} diff --git a/retrofit/src/main/resources/META-INF/services/kotlinx.metadata.impl.extensions.MetadataExtensions b/retrofit/src/main/resources/META-INF/services/kotlinx.metadata.impl.extensions.MetadataExtensions deleted file mode 100644 index 7ac2235c4e..0000000000 --- a/retrofit/src/main/resources/META-INF/services/kotlinx.metadata.impl.extensions.MetadataExtensions +++ /dev/null @@ -1 +0,0 @@ -kotlinx.metadata.jvm.impl.JvmMetadataExtensions diff --git a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt index d3fe430ae5..5f96eea3a0 100644 --- a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt +++ b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt @@ -43,7 +43,11 @@ import kotlin.coroutines.CoroutineContext class KotlinSuspendTest { @get:Rule val server = MockWebServer() - interface Service { + interface SuperService { + @GET("/") suspend fun noBody(@Query("x") arg: Long) + } + + interface Service : SuperService { @GET("/") suspend fun body(): String @GET("/") suspend fun bodyNullable(): String? @GET("/") suspend fun noBody() @@ -165,13 +169,9 @@ class KotlinSuspendTest { .build() val example = retrofit.create(Service::class.java) - server.enqueue(MockResponse()) - server.enqueue(MockResponse()) - server.enqueue(MockResponse()) - server.enqueue(MockResponse()) - server.enqueue(MockResponse()) - server.enqueue(MockResponse()) - server.enqueue(MockResponse()) + repeat(8) { + server.enqueue(MockResponse()) + } runBlocking { example.noBody() @@ -181,6 +181,7 @@ class KotlinSuspendTest { example.noBody(intArrayOf(1)) example.noBody(arrayOf("")) example.noBody(1u) + example.noBody(1L) } } From eec3e853bdc62ab813ac77668b6e000083b0005d Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Tue, 20 Apr 2021 10:46:07 +0200 Subject: [PATCH 03/15] Move metadata parsing under retrofit package --- .../main/java/retrofit2/KotlinExtensions.kt | 10 +- .../kotlin/metadata/ProtoBuf.java | 5006 +++++++++-------- .../metadata/deserialization/BinaryVersion.kt | 2 +- .../metadata/deserialization/Flags.java | 5 +- .../metadata/deserialization/NameResolver.kt | 2 +- .../metadata/deserialization/ProtoBufUtil.kt | 4 +- .../metadata/deserialization/TypeTable.kt | 4 +- .../deserialization/VersionRequirement.kt | 4 +- .../deserialization/protoTypeTableUtil.kt | 4 +- .../kotlin/metadata/jvm/JvmProtoBuf.java | 319 +- .../jvm/deserialization/BitEncoding.java | 7 +- .../jvm/deserialization/ClassMapperLite.kt | 2 +- .../jvm/deserialization/JvmMemberSignature.kt | 2 +- .../jvm/deserialization/JvmMetadataVersion.kt | 4 +- .../jvm/deserialization/JvmNameResolver.kt | 10 +- .../jvm/deserialization/JvmProtoBufUtil.kt | 10 +- .../jvm/deserialization/utfEncoding.kt | 2 +- .../kotlin}/protobuf/AbstractMessageLite.java | 2 +- .../kotlin}/protobuf/AbstractParser.java | 4 +- .../kotlin}/protobuf/BoundedByteString.java | 2 +- .../kotlin}/protobuf/ByteString.java | 2 +- .../kotlin}/protobuf/CodedInputStream.java | 2 +- .../kotlin}/protobuf/CodedOutputStream.java | 2 +- .../protobuf/ExtensionRegistryLite.java | 2 +- .../kotlin}/protobuf/FieldSet.java | 6 +- .../protobuf/GeneratedMessageLite.java | 4 +- .../kotlin}/protobuf/Internal.java | 3 +- .../InvalidProtocolBufferException.java | 2 +- .../kotlin}/protobuf/LazyField.java | 2 +- .../kotlin}/protobuf/LazyFieldLite.java | 2 +- .../kotlin}/protobuf/LazyStringArrayList.java | 2 +- .../kotlin}/protobuf/LazyStringList.java | 2 +- .../kotlin}/protobuf/LiteralByteString.java | 4 +- .../kotlin}/protobuf/MessageLite.java | 2 +- .../protobuf/MessageLiteOrBuilder.java | 2 +- .../kotlin}/protobuf/Parser.java | 2 +- .../kotlin}/protobuf/ProtocolStringList.java | 2 +- .../kotlin}/protobuf/RopeByteString.java | 6 +- .../kotlin}/protobuf/SmallSortedMap.java | 2 +- .../UninitializedMessageException.java | 2 +- .../protobuf/UnmodifiableLazyStringList.java | 2 +- .../kotlin}/protobuf/Utf8.java | 2 +- .../kotlin}/protobuf/WireFormat.java | 2 +- .../kotlinx/metadata.impl/readUtils.kt | 6 +- .../kotlinx/metadata.impl/readers.kt | 16 +- .../kotlinx/metadata/ClassName.kt | 2 +- .../{ => retrofit2}/kotlinx/metadata/Flag.kt | 7 +- .../{ => retrofit2}/kotlinx/metadata/Flags.kt | 2 +- .../InconsistentKotlinMetadataException.kt | 2 +- .../kotlinx/metadata/extensions.kt | 2 +- .../impl/extensions/MetadataExtensions.kt | 11 +- .../impl/extensions/extensionNodes.kt | 5 +- .../impl/extensions/extensionUtils.kt | 5 +- .../metadata/jvm/JvmMemberSignature.kt | 4 +- .../kotlinx/metadata/jvm/KotlinClassHeader.kt | 4 +- .../metadata/jvm/KotlinClassMetadata.kt | 13 +- .../jvm/impl/JvmMetadataExtensions.kt | 18 +- .../metadata/jvm/impl/jvmExtensionNodes.kt | 10 +- .../metadata/jvm/jvmExtensionVisitors.kt | 5 +- .../kotlinx/metadata/jvm/jvmExtensions.kt | 6 +- .../{ => retrofit2}/kotlinx/metadata/nodes.kt | 7 +- .../kotlinx/metadata/visitors.kt | 2 +- 62 files changed, 2797 insertions(+), 2794 deletions(-) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/ProtoBuf.java (76%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/deserialization/BinaryVersion.kt (97%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/deserialization/Flags.java (85%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/deserialization/NameResolver.kt (89%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/deserialization/ProtoBufUtil.kt (81%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/deserialization/TypeTable.kt (91%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/deserialization/VersionRequirement.kt (87%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/deserialization/protoTypeTableUtil.kt (92%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/jvm/JvmProtoBuf.java (87%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/jvm/deserialization/BitEncoding.java (95%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt (98%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt (94%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt (91%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt (92%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt (90%) rename retrofit/src/main/java/{org/jetbrains => retrofit2}/kotlin/metadata/jvm/deserialization/utfEncoding.kt (95%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/AbstractMessageLite.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/AbstractParser.java (98%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/BoundedByteString.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/ByteString.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/CodedInputStream.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/CodedOutputStream.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/ExtensionRegistryLite.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/FieldSet.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/GeneratedMessageLite.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/Internal.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/InvalidProtocolBufferException.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/LazyField.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/LazyFieldLite.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/LazyStringArrayList.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/LazyStringList.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/LiteralByteString.java (98%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/MessageLite.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/MessageLiteOrBuilder.java (98%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/Parser.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/ProtocolStringList.java (98%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/RopeByteString.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/SmallSortedMap.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/UninitializedMessageException.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/UnmodifiableLazyStringList.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/Utf8.java (99%) rename retrofit/src/main/java/{com/google => retrofit2/kotlin}/protobuf/WireFormat.java (99%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata.impl/readUtils.kt (72%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata.impl/readers.kt (80%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/ClassName.kt (96%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/Flag.kt (92%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/Flags.kt (95%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/InconsistentKotlinMetadataException.kt (90%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/extensions.kt (98%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/impl/extensions/MetadataExtensions.kt (67%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/impl/extensions/extensionNodes.kt (71%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/impl/extensions/extensionUtils.kt (84%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/jvm/JvmMemberSignature.kt (90%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/jvm/KotlinClassHeader.kt (97%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/jvm/KotlinClassMetadata.kt (88%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt (58%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt (69%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/jvm/jvmExtensionVisitors.kt (89%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/jvm/jvmExtensions.kt (80%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/nodes.kt (92%) rename retrofit/src/main/java/{ => retrofit2}/kotlinx/metadata/visitors.kt (98%) diff --git a/retrofit/src/main/java/retrofit2/KotlinExtensions.kt b/retrofit/src/main/java/retrofit2/KotlinExtensions.kt index f419786047..f3ce9173e5 100644 --- a/retrofit/src/main/java/retrofit2/KotlinExtensions.kt +++ b/retrofit/src/main/java/retrofit2/KotlinExtensions.kt @@ -20,11 +20,11 @@ package retrofit2 import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.suspendCancellableCoroutine -import kotlinx.metadata.Flag -import kotlinx.metadata.KmClassifier -import kotlinx.metadata.jvm.KotlinClassHeader -import kotlinx.metadata.jvm.KotlinClassMetadata -import kotlinx.metadata.jvm.signature +import retrofit2.kotlinx.metadata.Flag +import retrofit2.kotlinx.metadata.KmClassifier +import retrofit2.kotlinx.metadata.jvm.KotlinClassHeader +import retrofit2.kotlinx.metadata.jvm.KotlinClassMetadata +import retrofit2.kotlinx.metadata.jvm.signature import java.lang.reflect.Method import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED import kotlin.coroutines.intrinsics.intercepted diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/ProtoBuf.java similarity index 76% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java rename to retrofit/src/main/java/retrofit2/kotlin/metadata/ProtoBuf.java index 329ba88bfb..b0ef82fc75 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/ProtoBuf.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/ProtoBuf.java @@ -1,19 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: core/metadata/src/metadata.proto -package org.jetbrains.kotlin.metadata; +package retrofit2.kotlin.metadata; + +import retrofit2.kotlin.protobuf.*; public final class ProtoBuf { private ProtoBuf() {} public interface StringTableOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.StringTable) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * repeated string string = 1; */ - com.google.protobuf.ProtocolStringList + ProtocolStringList getStringList(); /** * repeated string string = 1; @@ -26,23 +28,23 @@ public interface StringTableOrBuilder extends /** * repeated string string = 1; */ - com.google.protobuf.ByteString + ByteString getStringBytes(int index); } /** * Protobuf type {@code org.jetbrains.kotlin.metadata.StringTable} */ public static final class StringTable extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.StringTable) StringTableOrBuilder { // Use StringTable.newBuilder() to construct. - private StringTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private StringTable(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private StringTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private StringTable(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final StringTable defaultInstance; public static StringTable getDefaultInstance() { @@ -53,17 +55,17 @@ public static StringTable getDefaultInstance() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private StringTable( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -81,9 +83,9 @@ private StringTable( break; } case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); + ByteString bs = input.readBytes(); if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - string_ = new com.google.protobuf.LazyStringArrayList(); + string_ = new LazyStringArrayList(); mutable_bitField0_ |= 0x00000001; } string_.add(bs); @@ -91,10 +93,10 @@ private StringTable( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { @@ -110,27 +112,27 @@ private StringTable( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public StringTable parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new StringTable(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } public static final int STRING_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList string_; + private LazyStringList string_; /** * repeated string string = 1; */ - @Override public com.google.protobuf.ProtocolStringList + @Override public ProtocolStringList getStringList() { return string_; } @@ -149,13 +151,13 @@ public com.google.protobuf.Parser getParserForType() { /** * repeated string string = 1; */ - @Override public com.google.protobuf.ByteString + @Override public ByteString getStringBytes(int index) { return string_.getByteString(index); } private void initFields() { - string_ = com.google.protobuf.LazyStringArrayList.EMPTY; + string_ = LazyStringArrayList.EMPTY; } private byte memoizedIsInitialized = -1; @Override public final boolean isInitialized() { @@ -167,7 +169,7 @@ private void initFields() { return true; } - @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + @Override public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < string_.size(); i++) { @@ -185,7 +187,7 @@ private void initFields() { { int dataSize = 0; for (int i = 0; i < string_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeBytesSizeNoTag(string_.getByteString(i)); } size += dataSize; @@ -203,62 +205,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.StringTable parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.StringTable parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.StringTable parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( + public static ProtoBuf.StringTable parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom(java.io.InputStream input) + public static ProtoBuf.StringTable parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( + public static ProtoBuf.StringTable parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.StringTable parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseDelimitedFrom( + public static ProtoBuf.StringTable parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.StringTable parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.StringTable parseFrom( + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static Builder newBuilder() { return Builder.create(); } @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable prototype) { + public static Builder newBuilder(ProtoBuf.StringTable prototype) { return newBuilder().mergeFrom(prototype); } @Override public Builder toBuilder() { return newBuilder(this); } @@ -267,12 +269,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.StringTa * Protobuf type {@code org.jetbrains.kotlin.metadata.StringTable} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.StringTable, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.StringTable, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.StringTable) - org.jetbrains.kotlin.metadata.ProtoBuf.StringTableOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.newBuilder() + ProtoBuf.StringTableOrBuilder { + // Construct using ProtoBuf.StringTable.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -285,7 +287,7 @@ private static Builder create() { @Override public Builder clear() { super.clear(); - string_ = com.google.protobuf.LazyStringArrayList.EMPTY; + string_ = LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -294,20 +296,20 @@ private static Builder create() { return create().mergeFrom(buildPartial()); } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance(); + @Override public ProtoBuf.StringTable getDefaultInstanceForType() { + return ProtoBuf.StringTable.getDefaultInstance(); } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable build() { - org.jetbrains.kotlin.metadata.ProtoBuf.StringTable result = buildPartial(); + @Override public ProtoBuf.StringTable build() { + ProtoBuf.StringTable result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.StringTable buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.StringTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.StringTable(this); + @Override public ProtoBuf.StringTable buildPartial() { + ProtoBuf.StringTable result = new ProtoBuf.StringTable(this); if (((bitField0_ & 0x00000001) == 0x00000001)) { string_ = string_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); @@ -316,8 +318,8 @@ private static Builder create() { return result; } - @Override public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.StringTable other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.StringTable.getDefaultInstance()) return this; + @Override public Builder mergeFrom(ProtoBuf.StringTable other) { + if (other == ProtoBuf.StringTable.getDefaultInstance()) return this; if (!other.string_.isEmpty()) { if (string_.isEmpty()) { string_ = other.string_; @@ -338,14 +340,14 @@ private static Builder create() { } @Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.StringTable parsedMessage = null; + ProtoBuf.StringTable parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.StringTable) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.StringTable) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -356,17 +358,17 @@ private static Builder create() { } private int bitField0_; - private com.google.protobuf.LazyStringList string_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private LazyStringList string_ = LazyStringArrayList.EMPTY; private void ensureStringIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { - string_ = new com.google.protobuf.LazyStringArrayList(string_); + string_ = new LazyStringArrayList(string_); bitField0_ |= 0x00000001; } } /** * repeated string string = 1; */ - @Override public com.google.protobuf.ProtocolStringList + @Override public ProtocolStringList getStringList() { return string_.getUnmodifiableView(); } @@ -385,7 +387,7 @@ private void ensureStringIsMutable() { /** * repeated string string = 1; */ - @Override public com.google.protobuf.ByteString + @Override public ByteString getStringBytes(int index) { return string_.getByteString(index); } @@ -421,7 +423,7 @@ public Builder addString( public Builder addAllString( java.lang.Iterable values) { ensureStringIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, string_); return this; @@ -430,7 +432,7 @@ public Builder addAllString( * repeated string string = 1; */ public Builder clearString() { - string_ = com.google.protobuf.LazyStringArrayList.EMPTY; + string_ = LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); return this; @@ -439,7 +441,7 @@ public Builder clearString() { * repeated string string = 1; */ public Builder addStringBytes( - com.google.protobuf.ByteString value) { + ByteString value) { if (value == null) { throw new NullPointerException(); } @@ -462,17 +464,17 @@ public Builder addStringBytes( public interface QualifiedNameTableOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.QualifiedNameTable) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - java.util.List + java.util.List getQualifiedNameList(); /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index); + ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index); /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ @@ -482,16 +484,16 @@ public interface QualifiedNameTableOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable} */ public static final class QualifiedNameTable extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable) QualifiedNameTableOrBuilder { // Use QualifiedNameTable.newBuilder() to construct. - private QualifiedNameTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private QualifiedNameTable(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private QualifiedNameTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private QualifiedNameTable(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final QualifiedNameTable defaultInstance; public static QualifiedNameTable getDefaultInstance() { @@ -502,17 +504,17 @@ public static QualifiedNameTable getDefaultInstance() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private QualifiedNameTable( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -531,18 +533,18 @@ private QualifiedNameTable( } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - qualifiedName_ = new java.util.ArrayList(); + qualifiedName_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - qualifiedName_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.PARSER, extensionRegistry)); + qualifiedName_.add(input.readMessage(ProtoBuf.QualifiedNameTable.QualifiedName.PARSER, extensionRegistry)); break; } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { @@ -558,24 +560,24 @@ private QualifiedNameTable( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public QualifiedNameTable parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new QualifiedNameTable(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } public interface QualifiedNameOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * optional int32 parent_qualified_name = 1 [default = -1]; @@ -610,22 +612,22 @@ public interface QualifiedNameOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; */ - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind(); + ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind(); } /** * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName} */ public static final class QualifiedName extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) QualifiedNameOrBuilder { // Use QualifiedName.newBuilder() to construct. - private QualifiedName(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private QualifiedName(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private QualifiedName(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private QualifiedName(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final QualifiedName defaultInstance; public static QualifiedName getDefaultInstance() { @@ -636,16 +638,16 @@ public static QualifiedName getDefaultInstance() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private QualifiedName( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -674,7 +676,7 @@ private QualifiedName( } case 24: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind value = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.valueOf(rawValue); + ProtoBuf.QualifiedNameTable.QualifiedName.Kind value = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -686,10 +688,10 @@ private QualifiedName( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { try { @@ -702,18 +704,18 @@ private QualifiedName( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public QualifiedName parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new QualifiedName(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -721,7 +723,7 @@ public com.google.protobuf.Parser getParserForType() { * Protobuf enum {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind} */ public enum Kind - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * CLASS = 0; */ @@ -761,13 +763,13 @@ public static Kind valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { @Override public Kind findValueByNumber(int number) { return Kind.valueOf(number); } @@ -823,7 +825,7 @@ private Kind(int index, int value) { } public static final int KIND_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind kind_; + private ProtoBuf.QualifiedNameTable.QualifiedName.Kind kind_; /** * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; */ @@ -833,14 +835,14 @@ private Kind(int index, int value) { /** * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind() { + @Override public ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind() { return kind_; } private void initFields() { parentQualifiedName_ = -1; shortName_ = 0; - kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; + kind_ = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; } private byte memoizedIsInitialized = -1; @Override public final boolean isInitialized() { @@ -856,7 +858,7 @@ private void initFields() { return true; } - @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + @Override public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -878,15 +880,15 @@ private void initFields() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, parentQualifiedName_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, shortName_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(3, kind_.getNumber()); } size += unknownFields.size(); @@ -901,62 +903,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom(java.io.InputStream input) + public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.QualifiedNameTable.QualifiedName parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseDelimitedFrom( + public static ProtoBuf.QualifiedNameTable.QualifiedName parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static Builder newBuilder() { return Builder.create(); } @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName prototype) { + public static Builder newBuilder(ProtoBuf.QualifiedNameTable.QualifiedName prototype) { return newBuilder().mergeFrom(prototype); } @Override public Builder toBuilder() { return newBuilder(this); } @@ -965,12 +967,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Qualifie * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.QualifiedNameTable.QualifiedName, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedNameOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.newBuilder() + ProtoBuf.QualifiedNameTable.QualifiedNameOrBuilder { + // Construct using ProtoBuf.QualifiedNameTable.QualifiedName.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -987,7 +989,7 @@ private static Builder create() { bitField0_ = (bitField0_ & ~0x00000001); shortName_ = 0; bitField0_ = (bitField0_ & ~0x00000002); - kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; + kind_ = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -996,20 +998,20 @@ private static Builder create() { return create().mergeFrom(buildPartial()); } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.getDefaultInstance(); + @Override public ProtoBuf.QualifiedNameTable.QualifiedName getDefaultInstanceForType() { + return ProtoBuf.QualifiedNameTable.QualifiedName.getDefaultInstance(); } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName build() { - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName result = buildPartial(); + @Override public ProtoBuf.QualifiedNameTable.QualifiedName build() { + ProtoBuf.QualifiedNameTable.QualifiedName result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName result = new org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName(this); + @Override public ProtoBuf.QualifiedNameTable.QualifiedName buildPartial() { + ProtoBuf.QualifiedNameTable.QualifiedName result = new ProtoBuf.QualifiedNameTable.QualifiedName(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -1028,8 +1030,8 @@ private static Builder create() { return result; } - @Override public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.getDefaultInstance()) return this; + @Override public Builder mergeFrom(ProtoBuf.QualifiedNameTable.QualifiedName other) { + if (other == ProtoBuf.QualifiedNameTable.QualifiedName.getDefaultInstance()) return this; if (other.hasParentQualifiedName()) { setParentQualifiedName(other.getParentQualifiedName()); } @@ -1053,14 +1055,14 @@ private static Builder create() { } @Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName parsedMessage = null; + ProtoBuf.QualifiedNameTable.QualifiedName parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.QualifiedNameTable.QualifiedName) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -1151,7 +1153,7 @@ public Builder clearShortName() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; + private ProtoBuf.QualifiedNameTable.QualifiedName.Kind kind_ = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; /** * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; */ @@ -1161,13 +1163,13 @@ public Builder clearShortName() { /** * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind() { + @Override public ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind() { return kind_; } /** * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; */ - public Builder setKind(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind value) { + public Builder setKind(ProtoBuf.QualifiedNameTable.QualifiedName.Kind value) { if (value == null) { throw new NullPointerException(); } @@ -1181,7 +1183,7 @@ public Builder setKind(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable */ public Builder clearKind() { bitField0_ = (bitField0_ & ~0x00000004); - kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; + kind_ = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; return this; } @@ -1198,17 +1200,17 @@ public Builder clearKind() { } public static final int QUALIFIED_NAME_FIELD_NUMBER = 1; - private java.util.List qualifiedName_; + private java.util.List qualifiedName_; /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - @Override public java.util.List getQualifiedNameList() { + @Override public java.util.List getQualifiedNameList() { return qualifiedName_; } /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - public java.util.List + public java.util.List getQualifiedNameOrBuilderList() { return qualifiedName_; } @@ -1221,13 +1223,13 @@ public Builder clearKind() { /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index) { + @Override public ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index) { return qualifiedName_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedNameOrBuilder getQualifiedNameOrBuilder( + public ProtoBuf.QualifiedNameTable.QualifiedNameOrBuilder getQualifiedNameOrBuilder( int index) { return qualifiedName_.get(index); } @@ -1251,7 +1253,7 @@ private void initFields() { return true; } - @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + @Override public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < qualifiedName_.size(); i++) { @@ -1267,7 +1269,7 @@ private void initFields() { size = 0; for (int i = 0; i < qualifiedName_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(1, qualifiedName_.get(i)); } size += unknownFields.size(); @@ -1282,62 +1284,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.QualifiedNameTable parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.QualifiedNameTable parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.QualifiedNameTable parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( + public static ProtoBuf.QualifiedNameTable parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom(java.io.InputStream input) + public static ProtoBuf.QualifiedNameTable parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( + public static ProtoBuf.QualifiedNameTable parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.QualifiedNameTable parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseDelimitedFrom( + public static ProtoBuf.QualifiedNameTable parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.QualifiedNameTable parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.QualifiedNameTable parseFrom( + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static Builder newBuilder() { return Builder.create(); } @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable prototype) { + public static Builder newBuilder(ProtoBuf.QualifiedNameTable prototype) { return newBuilder().mergeFrom(prototype); } @Override public Builder toBuilder() { return newBuilder(this); } @@ -1346,12 +1348,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Qualifie * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.QualifiedNameTable, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable) - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTableOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.newBuilder() + ProtoBuf.QualifiedNameTableOrBuilder { + // Construct using ProtoBuf.QualifiedNameTable.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -1373,20 +1375,20 @@ private static Builder create() { return create().mergeFrom(buildPartial()); } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance(); + @Override public ProtoBuf.QualifiedNameTable getDefaultInstanceForType() { + return ProtoBuf.QualifiedNameTable.getDefaultInstance(); } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable build() { - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable result = buildPartial(); + @Override public ProtoBuf.QualifiedNameTable build() { + ProtoBuf.QualifiedNameTable result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable(this); + @Override public ProtoBuf.QualifiedNameTable buildPartial() { + ProtoBuf.QualifiedNameTable result = new ProtoBuf.QualifiedNameTable(this); if (((bitField0_ & 0x00000001) == 0x00000001)) { qualifiedName_ = java.util.Collections.unmodifiableList(qualifiedName_); bitField0_ = (bitField0_ & ~0x00000001); @@ -1395,8 +1397,8 @@ private static Builder create() { return result; } - @Override public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.getDefaultInstance()) return this; + @Override public Builder mergeFrom(ProtoBuf.QualifiedNameTable other) { + if (other == ProtoBuf.QualifiedNameTable.getDefaultInstance()) return this; if (!other.qualifiedName_.isEmpty()) { if (qualifiedName_.isEmpty()) { qualifiedName_ = other.qualifiedName_; @@ -1423,14 +1425,14 @@ private static Builder create() { } @Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable parsedMessage = null; + ProtoBuf.QualifiedNameTable parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.QualifiedNameTable) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -1441,11 +1443,11 @@ private static Builder create() { } private int bitField0_; - private java.util.List qualifiedName_ = + private java.util.List qualifiedName_ = java.util.Collections.emptyList(); private void ensureQualifiedNameIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { - qualifiedName_ = new java.util.ArrayList(qualifiedName_); + qualifiedName_ = new java.util.ArrayList(qualifiedName_); bitField0_ |= 0x00000001; } } @@ -1453,7 +1455,7 @@ private void ensureQualifiedNameIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - @Override public java.util.List getQualifiedNameList() { + @Override public java.util.List getQualifiedNameList() { return java.util.Collections.unmodifiableList(qualifiedName_); } /** @@ -1465,14 +1467,14 @@ private void ensureQualifiedNameIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index) { + @Override public ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index) { return qualifiedName_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ public Builder setQualifiedName( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName value) { + int index, ProtoBuf.QualifiedNameTable.QualifiedName value) { if (value == null) { throw new NullPointerException(); } @@ -1485,7 +1487,7 @@ public Builder setQualifiedName( * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ public Builder setQualifiedName( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { + int index, ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { ensureQualifiedNameIsMutable(); qualifiedName_.set(index, builderForValue.build()); @@ -1494,7 +1496,7 @@ public Builder setQualifiedName( /** * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ - public Builder addQualifiedName(org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName value) { + public Builder addQualifiedName(ProtoBuf.QualifiedNameTable.QualifiedName value) { if (value == null) { throw new NullPointerException(); } @@ -1507,7 +1509,7 @@ public Builder addQualifiedName(org.jetbrains.kotlin.metadata.ProtoBuf.Qualified * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ public Builder addQualifiedName( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName value) { + int index, ProtoBuf.QualifiedNameTable.QualifiedName value) { if (value == null) { throw new NullPointerException(); } @@ -1520,7 +1522,7 @@ public Builder addQualifiedName( * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ public Builder addQualifiedName( - org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { + ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { ensureQualifiedNameIsMutable(); qualifiedName_.add(builderForValue.build()); @@ -1530,7 +1532,7 @@ public Builder addQualifiedName( * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ public Builder addQualifiedName( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { + int index, ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { ensureQualifiedNameIsMutable(); qualifiedName_.add(index, builderForValue.build()); @@ -1540,9 +1542,9 @@ public Builder addQualifiedName( * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; */ public Builder addAllQualifiedName( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureQualifiedNameIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, qualifiedName_); return this; @@ -1579,7 +1581,7 @@ public Builder removeQualifiedName(int index) { public interface AnnotationOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * required int32 id = 1; @@ -1593,12 +1595,12 @@ public interface AnnotationOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - java.util.List + java.util.List getArgumentList(); /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument getArgument(int index); + ProtoBuf.Annotation.Argument getArgument(int index); /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ @@ -1608,16 +1610,16 @@ public interface AnnotationOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation} */ public static final class Annotation extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation) AnnotationOrBuilder { // Use Annotation.newBuilder() to construct. - private Annotation(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Annotation(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Annotation(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Annotation(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Annotation defaultInstance; public static Annotation getDefaultInstance() { @@ -1628,17 +1630,17 @@ public static Annotation getDefaultInstance() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Annotation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -1662,18 +1664,18 @@ private Annotation( } case 18: { if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - argument_ = new java.util.ArrayList(); + argument_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000002; } - argument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.PARSER, extensionRegistry)); + argument_.add(input.readMessage(ProtoBuf.Annotation.Argument.PARSER, extensionRegistry)); break; } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { @@ -1689,24 +1691,24 @@ private Annotation( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public Annotation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Annotation(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } public interface ArgumentOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation.Argument) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * required int32 name_id = 1; @@ -1724,22 +1726,22 @@ public interface ArgumentOrBuilder extends /** * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getValue(); + ProtoBuf.Annotation.Argument.Value getValue(); } /** * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument} */ public static final class Argument extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation.Argument) ArgumentOrBuilder { // Use Argument.newBuilder() to construct. - private Argument(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Argument(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Argument(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Argument(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Argument defaultInstance; public static Argument getDefaultInstance() { @@ -1750,16 +1752,16 @@ public static Argument getDefaultInstance() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Argument( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -1782,11 +1784,11 @@ private Argument( break; } case 18: { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder subBuilder = null; + ProtoBuf.Annotation.Argument.Value.Builder subBuilder = null; if (((bitField0_ & 0x00000002) == 0x00000002)) { subBuilder = value_.toBuilder(); } - value_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.PARSER, extensionRegistry); + value_ = input.readMessage(ProtoBuf.Annotation.Argument.Value.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(value_); value_ = subBuilder.buildPartial(); @@ -1796,10 +1798,10 @@ private Argument( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { try { @@ -1812,24 +1814,24 @@ private Argument( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public Argument parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Argument(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } public interface ValueOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; @@ -1850,7 +1852,7 @@ public interface ValueOrBuilder extends * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required * */ - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type getType(); + ProtoBuf.Annotation.Argument.Value.Type getType(); /** * optional sint64 int_value = 2; @@ -1921,17 +1923,17 @@ public interface ValueOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(); + ProtoBuf.Annotation getAnnotation(); /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - java.util.List + java.util.List getArrayElementList(); /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getArrayElement(int index); + ProtoBuf.Annotation.Argument.Value getArrayElement(int index); /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ @@ -1991,16 +1993,16 @@ public interface ValueOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value} */ public static final class Value extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) ValueOrBuilder { // Use Value.newBuilder() to construct. - private Value(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Value(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Value(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Value(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Value defaultInstance; public static Value getDefaultInstance() { @@ -2011,17 +2013,17 @@ public static Value getDefaultInstance() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Value( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -2040,7 +2042,7 @@ private Value( } case 8: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type value = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.valueOf(rawValue); + ProtoBuf.Annotation.Argument.Value.Type value = ProtoBuf.Annotation.Argument.Value.Type.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -2081,11 +2083,11 @@ private Value( break; } case 66: { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder subBuilder = null; + ProtoBuf.Annotation.Builder subBuilder = null; if (((bitField0_ & 0x00000080) == 0x00000080)) { subBuilder = annotation_.toBuilder(); } - annotation_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.PARSER, extensionRegistry); + annotation_ = input.readMessage(ProtoBuf.Annotation.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(annotation_); annotation_ = subBuilder.buildPartial(); @@ -2095,10 +2097,10 @@ private Value( } case 74: { if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - arrayElement_ = new java.util.ArrayList(); + arrayElement_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000100; } - arrayElement_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.PARSER, extensionRegistry)); + arrayElement_.add(input.readMessage(ProtoBuf.Annotation.Argument.Value.PARSER, extensionRegistry)); break; } case 80: { @@ -2113,10 +2115,10 @@ private Value( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { @@ -2132,18 +2134,18 @@ private Value( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public Value parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Value(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -2151,7 +2153,7 @@ public com.google.protobuf.Parser getParserForType() { * Protobuf enum {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type} */ public enum Type - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * BYTE = 0; */ @@ -2281,13 +2283,13 @@ public static Type valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { @Override public Type findValueByNumber(int number) { return Type.valueOf(number); } @@ -2305,7 +2307,7 @@ private Type(int index, int value) { private int bitField0_; public static final int TYPE_FIELD_NUMBER = 1; - private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type type_; + private ProtoBuf.Annotation.Argument.Value.Type type_; /** * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; * @@ -2327,7 +2329,7 @@ private Type(int index, int value) { * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required * */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type getType() { + @Override public ProtoBuf.Annotation.Argument.Value.Type getType() { return type_; } @@ -2430,7 +2432,7 @@ private Type(int index, int value) { } public static final int ANNOTATION_FIELD_NUMBER = 8; - private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation annotation_; + private ProtoBuf.Annotation annotation_; /** * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ @@ -2440,22 +2442,22 @@ private Type(int index, int value) { /** * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation() { + @Override public ProtoBuf.Annotation getAnnotation() { return annotation_; } public static final int ARRAY_ELEMENT_FIELD_NUMBER = 9; - private java.util.List arrayElement_; + private java.util.List arrayElement_; /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - @Override public java.util.List getArrayElementList() { + @Override public java.util.List getArrayElementList() { return arrayElement_; } /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - public java.util.List + public java.util.List getArrayElementOrBuilderList() { return arrayElement_; } @@ -2468,13 +2470,13 @@ private Type(int index, int value) { /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { + @Override public ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { return arrayElement_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.ValueOrBuilder getArrayElementOrBuilder( + public ProtoBuf.Annotation.Argument.ValueOrBuilder getArrayElementOrBuilder( int index) { return arrayElement_.get(index); } @@ -2542,14 +2544,14 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.ValueOrBuilder } private void initFields() { - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + type_ = ProtoBuf.Annotation.Argument.Value.Type.BYTE; intValue_ = 0L; floatValue_ = 0F; doubleValue_ = 0D; stringValue_ = 0; classId_ = 0; enumValueId_ = 0; - annotation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + annotation_ = ProtoBuf.Annotation.getDefaultInstance(); arrayElement_ = java.util.Collections.emptyList(); arrayDimensionCount_ = 0; flags_ = 0; @@ -2576,7 +2578,7 @@ private void initFields() { return true; } - @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + @Override public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -2622,47 +2624,47 @@ private void initFields() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(1, type_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeSInt64Size(2, intValue_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeFloatSize(3, floatValue_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeDoubleSize(4, doubleValue_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(5, stringValue_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(6, classId_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(7, enumValueId_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(8, annotation_); } for (int i = 0; i < arrayElement_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(9, arrayElement_.get(i)); } if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(10, flags_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(11, arrayDimensionCount_); } size += unknownFields.size(); @@ -2677,62 +2679,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation.Argument.Value parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation.Argument.Value parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation.Argument.Value parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( + public static ProtoBuf.Annotation.Argument.Value parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom(java.io.InputStream input) + public static ProtoBuf.Annotation.Argument.Value parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( + public static ProtoBuf.Annotation.Argument.Value parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Annotation.Argument.Value parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseDelimitedFrom( + public static ProtoBuf.Annotation.Argument.Value parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Annotation.Argument.Value parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Annotation.Argument.Value parseFrom( + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static Builder newBuilder() { return Builder.create(); } @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value prototype) { + public static Builder newBuilder(ProtoBuf.Annotation.Argument.Value prototype) { return newBuilder().mergeFrom(prototype); } @Override public Builder toBuilder() { return newBuilder(this); } @@ -2741,12 +2743,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Annotati * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.Annotation.Argument.Value, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.ValueOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.newBuilder() + ProtoBuf.Annotation.Argument.ValueOrBuilder { + // Construct using ProtoBuf.Annotation.Argument.Value.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -2759,7 +2761,7 @@ private static Builder create() { @Override public Builder clear() { super.clear(); - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + type_ = ProtoBuf.Annotation.Argument.Value.Type.BYTE; bitField0_ = (bitField0_ & ~0x00000001); intValue_ = 0L; bitField0_ = (bitField0_ & ~0x00000002); @@ -2773,7 +2775,7 @@ private static Builder create() { bitField0_ = (bitField0_ & ~0x00000020); enumValueId_ = 0; bitField0_ = (bitField0_ & ~0x00000040); - annotation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + annotation_ = ProtoBuf.Annotation.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000080); arrayElement_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000100); @@ -2788,20 +2790,20 @@ private static Builder create() { return create().mergeFrom(buildPartial()); } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + @Override public ProtoBuf.Annotation.Argument.Value getDefaultInstanceForType() { + return ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value result = buildPartial(); + @Override public ProtoBuf.Annotation.Argument.Value build() { + ProtoBuf.Annotation.Argument.Value result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value result = new org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value(this); + @Override public ProtoBuf.Annotation.Argument.Value buildPartial() { + ProtoBuf.Annotation.Argument.Value result = new ProtoBuf.Annotation.Argument.Value(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -2853,8 +2855,8 @@ private static Builder create() { return result; } - @Override public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) return this; + @Override public Builder mergeFrom(ProtoBuf.Annotation.Argument.Value other) { + if (other == ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } @@ -2917,14 +2919,14 @@ private static Builder create() { } @Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value parsedMessage = null; + ProtoBuf.Annotation.Argument.Value parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Annotation.Argument.Value) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -2935,7 +2937,7 @@ private static Builder create() { } private int bitField0_; - private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + private ProtoBuf.Annotation.Argument.Value.Type type_ = ProtoBuf.Annotation.Argument.Value.Type.BYTE; /** * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; * @@ -2957,7 +2959,7 @@ private static Builder create() { * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required * */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type getType() { + @Override public ProtoBuf.Annotation.Argument.Value.Type getType() { return type_; } /** @@ -2969,7 +2971,7 @@ private static Builder create() { * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required * */ - public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type value) { + public Builder setType(ProtoBuf.Annotation.Argument.Value.Type value) { if (value == null) { throw new NullPointerException(); } @@ -2989,7 +2991,7 @@ public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argumen */ public Builder clearType() { bitField0_ = (bitField0_ & ~0x00000001); - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + type_ = ProtoBuf.Annotation.Argument.Value.Type.BYTE; return this; } @@ -3202,7 +3204,7 @@ public Builder clearEnumValueId() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation annotation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + private ProtoBuf.Annotation annotation_ = ProtoBuf.Annotation.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ @@ -3212,13 +3214,13 @@ public Builder clearEnumValueId() { /** * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation() { + @Override public ProtoBuf.Annotation getAnnotation() { return annotation_; } /** * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public Builder setAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + public Builder setAnnotation(ProtoBuf.Annotation value) { if (value == null) { throw new NullPointerException(); } @@ -3231,7 +3233,7 @@ public Builder setAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation v * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ public Builder setAnnotation( - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + ProtoBuf.Annotation.Builder builderForValue) { annotation_ = builderForValue.build(); bitField0_ |= 0x00000080; @@ -3240,11 +3242,11 @@ public Builder setAnnotation( /** * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public Builder mergeAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + public Builder mergeAnnotation(ProtoBuf.Annotation value) { if (((bitField0_ & 0x00000080) == 0x00000080) && - annotation_ != org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance()) { + annotation_ != ProtoBuf.Annotation.getDefaultInstance()) { annotation_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.newBuilder(annotation_).mergeFrom(value).buildPartial(); + ProtoBuf.Annotation.newBuilder(annotation_).mergeFrom(value).buildPartial(); } else { annotation_ = value; } @@ -3256,17 +3258,17 @@ public Builder mergeAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ public Builder clearAnnotation() { - annotation_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + annotation_ = ProtoBuf.Annotation.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000080); return this; } - private java.util.List arrayElement_ = + private java.util.List arrayElement_ = java.util.Collections.emptyList(); private void ensureArrayElementIsMutable() { if (!((bitField0_ & 0x00000100) == 0x00000100)) { - arrayElement_ = new java.util.ArrayList(arrayElement_); + arrayElement_ = new java.util.ArrayList(arrayElement_); bitField0_ |= 0x00000100; } } @@ -3274,7 +3276,7 @@ private void ensureArrayElementIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - @Override public java.util.List getArrayElementList() { + @Override public java.util.List getArrayElementList() { return java.util.Collections.unmodifiableList(arrayElement_); } /** @@ -3286,14 +3288,14 @@ private void ensureArrayElementIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { + @Override public ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { return arrayElement_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ public Builder setArrayElement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + int index, ProtoBuf.Annotation.Argument.Value value) { if (value == null) { throw new NullPointerException(); } @@ -3306,7 +3308,7 @@ public Builder setArrayElement( * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ public Builder setArrayElement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + int index, ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { ensureArrayElementIsMutable(); arrayElement_.set(index, builderForValue.build()); @@ -3315,7 +3317,7 @@ public Builder setArrayElement( /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ - public Builder addArrayElement(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + public Builder addArrayElement(ProtoBuf.Annotation.Argument.Value value) { if (value == null) { throw new NullPointerException(); } @@ -3328,7 +3330,7 @@ public Builder addArrayElement(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ public Builder addArrayElement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + int index, ProtoBuf.Annotation.Argument.Value value) { if (value == null) { throw new NullPointerException(); } @@ -3341,7 +3343,7 @@ public Builder addArrayElement( * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ public Builder addArrayElement( - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { ensureArrayElementIsMutable(); arrayElement_.add(builderForValue.build()); @@ -3351,7 +3353,7 @@ public Builder addArrayElement( * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ public Builder addArrayElement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + int index, ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { ensureArrayElementIsMutable(); arrayElement_.add(index, builderForValue.build()); @@ -3361,9 +3363,9 @@ public Builder addArrayElement( * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; */ public Builder addAllArrayElement( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureArrayElementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, arrayElement_); return this; @@ -3543,7 +3545,7 @@ public Builder clearFlags() { } public static final int VALUE_FIELD_NUMBER = 2; - private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value_; + private ProtoBuf.Annotation.Argument.Value value_; /** * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ @@ -3553,13 +3555,13 @@ public Builder clearFlags() { /** * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ - @Override public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getValue() { + @Override public ProtoBuf.Annotation.Argument.Value getValue() { return value_; } private void initFields() { nameId_ = 0; - value_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + value_ = ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @Override public final boolean isInitialized() { @@ -3583,7 +3585,7 @@ private void initFields() { return true; } - @Override public void writeTo(com.google.protobuf.CodedOutputStream output) + @Override public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -3602,11 +3604,11 @@ private void initFields() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, nameId_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(2, value_); } size += unknownFields.size(); @@ -3621,62 +3623,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation.Argument parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation.Argument parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation.Argument parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( + public static ProtoBuf.Annotation.Argument parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom(java.io.InputStream input) + public static ProtoBuf.Annotation.Argument parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( + public static ProtoBuf.Annotation.Argument parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Annotation.Argument parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseDelimitedFrom( + public static ProtoBuf.Annotation.Argument parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Annotation.Argument parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Annotation.Argument parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Annotation.Argument prototype) { + public static Builder newBuilder(ProtoBuf.Annotation.Argument prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -3685,12 +3687,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Annotati * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.Annotation.Argument, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation.Argument) - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.ArgumentOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.newBuilder() + ProtoBuf.Annotation.ArgumentOrBuilder { + // Construct using ProtoBuf.Annotation.Argument.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3705,7 +3707,7 @@ public Builder clear() { super.clear(); nameId_ = 0; bitField0_ = (bitField0_ & ~0x00000001); - value_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + value_ = ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -3714,20 +3716,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.getDefaultInstance(); + public ProtoBuf.Annotation.Argument getDefaultInstanceForType() { + return ProtoBuf.Annotation.Argument.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument result = buildPartial(); + public ProtoBuf.Annotation.Argument build() { + ProtoBuf.Annotation.Argument result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument result = new org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument(this); + public ProtoBuf.Annotation.Argument buildPartial() { + ProtoBuf.Annotation.Argument result = new ProtoBuf.Annotation.Argument(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -3742,8 +3744,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument buildPartial() return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Annotation.Argument other) { + if (other == ProtoBuf.Annotation.Argument.getDefaultInstance()) return this; if (other.hasNameId()) { setNameId(other.getNameId()); } @@ -3772,14 +3774,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument parsedMessage = null; + ProtoBuf.Annotation.Argument parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Annotation.Argument) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -3822,7 +3824,7 @@ public Builder clearNameId() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + private ProtoBuf.Annotation.Argument.Value value_ = ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); /** * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ @@ -3832,13 +3834,13 @@ public boolean hasValue() { /** * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value getValue() { + public ProtoBuf.Annotation.Argument.Value getValue() { return value_; } /** * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ - public Builder setValue(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + public Builder setValue(ProtoBuf.Annotation.Argument.Value value) { if (value == null) { throw new NullPointerException(); } @@ -3851,7 +3853,7 @@ public Builder setValue(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argume * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ public Builder setValue( - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { value_ = builderForValue.build(); bitField0_ |= 0x00000002; @@ -3860,11 +3862,11 @@ public Builder setValue( /** * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ - public Builder mergeValue(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value value) { + public Builder mergeValue(ProtoBuf.Annotation.Argument.Value value) { if (((bitField0_ & 0x00000002) == 0x00000002) && - value_ != org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) { + value_ != ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) { value_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.newBuilder(value_).mergeFrom(value).buildPartial(); + ProtoBuf.Annotation.Argument.Value.newBuilder(value_).mergeFrom(value).buildPartial(); } else { value_ = value; } @@ -3876,7 +3878,7 @@ public Builder mergeValue(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argu * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; */ public Builder clearValue() { - value_ = org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + value_ = ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000002); return this; @@ -3910,17 +3912,17 @@ public int getId() { } public static final int ARGUMENT_FIELD_NUMBER = 2; - private java.util.List argument_; + private java.util.List argument_; /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - public java.util.List getArgumentList() { + public java.util.List getArgumentList() { return argument_; } /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - public java.util.List + public java.util.List getArgumentOrBuilderList() { return argument_; } @@ -3933,13 +3935,13 @@ public int getArgumentCount() { /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument getArgument(int index) { + public ProtoBuf.Annotation.Argument getArgument(int index) { return argument_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.ArgumentOrBuilder getArgumentOrBuilder( + public ProtoBuf.Annotation.ArgumentOrBuilder getArgumentOrBuilder( int index) { return argument_.get(index); } @@ -3968,7 +3970,7 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -3987,11 +3989,11 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, id_); } for (int i = 0; i < argument_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(2, argument_.get(i)); } size += unknownFields.size(); @@ -4006,62 +4008,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Annotation parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( + public static ProtoBuf.Annotation parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom(java.io.InputStream input) + public static ProtoBuf.Annotation parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( + public static ProtoBuf.Annotation parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Annotation parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseDelimitedFrom( + public static ProtoBuf.Annotation parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Annotation parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Annotation parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Annotation prototype) { + public static Builder newBuilder(ProtoBuf.Annotation prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -4070,12 +4072,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Annotati * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.Annotation, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation) - org.jetbrains.kotlin.metadata.ProtoBuf.AnnotationOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.newBuilder() + ProtoBuf.AnnotationOrBuilder { + // Construct using ProtoBuf.Annotation.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -4099,20 +4101,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(); + public ProtoBuf.Annotation getDefaultInstanceForType() { + return ProtoBuf.Annotation.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation result = buildPartial(); + public ProtoBuf.Annotation build() { + ProtoBuf.Annotation result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation result = new org.jetbrains.kotlin.metadata.ProtoBuf.Annotation(this); + public ProtoBuf.Annotation buildPartial() { + ProtoBuf.Annotation result = new ProtoBuf.Annotation(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -4128,8 +4130,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Annotation other) { + if (other == ProtoBuf.Annotation.getDefaultInstance()) return this; if (other.hasId()) { setId(other.getId()); } @@ -4163,14 +4165,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation parsedMessage = null; + ProtoBuf.Annotation parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Annotation) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Annotation) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -4213,11 +4215,11 @@ public Builder clearId() { return this; } - private java.util.List argument_ = + private java.util.List argument_ = java.util.Collections.emptyList(); private void ensureArgumentIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { - argument_ = new java.util.ArrayList(argument_); + argument_ = new java.util.ArrayList(argument_); bitField0_ |= 0x00000002; } } @@ -4225,7 +4227,7 @@ private void ensureArgumentIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - public java.util.List getArgumentList() { + public java.util.List getArgumentList() { return java.util.Collections.unmodifiableList(argument_); } /** @@ -4237,14 +4239,14 @@ public int getArgumentCount() { /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument getArgument(int index) { + public ProtoBuf.Annotation.Argument getArgument(int index) { return argument_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ public Builder setArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument value) { + int index, ProtoBuf.Annotation.Argument value) { if (value == null) { throw new NullPointerException(); } @@ -4257,7 +4259,7 @@ public Builder setArgument( * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ public Builder setArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Builder builderForValue) { + int index, ProtoBuf.Annotation.Argument.Builder builderForValue) { ensureArgumentIsMutable(); argument_.set(index, builderForValue.build()); @@ -4266,7 +4268,7 @@ public Builder setArgument( /** * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ - public Builder addArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument value) { + public Builder addArgument(ProtoBuf.Annotation.Argument value) { if (value == null) { throw new NullPointerException(); } @@ -4279,7 +4281,7 @@ public Builder addArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Arg * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ public Builder addArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument value) { + int index, ProtoBuf.Annotation.Argument value) { if (value == null) { throw new NullPointerException(); } @@ -4292,7 +4294,7 @@ public Builder addArgument( * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ public Builder addArgument( - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Builder builderForValue) { + ProtoBuf.Annotation.Argument.Builder builderForValue) { ensureArgumentIsMutable(); argument_.add(builderForValue.build()); @@ -4302,7 +4304,7 @@ public Builder addArgument( * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ public Builder addArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Argument.Builder builderForValue) { + int index, ProtoBuf.Annotation.Argument.Builder builderForValue) { ensureArgumentIsMutable(); argument_.add(index, builderForValue.build()); @@ -4312,9 +4314,9 @@ public Builder addArgument( * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; */ public Builder addAllArgument( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureArgumentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, argument_); return this; @@ -4351,18 +4353,18 @@ public Builder removeArgument(int index) { public interface TypeOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Type) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - java.util.List + java.util.List getArgumentList(); /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument getArgument(int index); + ProtoBuf.Type.Argument getArgument(int index); /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ @@ -4403,7 +4405,7 @@ public interface TypeOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getFlexibleUpperBound(); + ProtoBuf.Type getFlexibleUpperBound(); /** * optional int32 flexible_upper_bound_id = 8; @@ -4491,7 +4493,7 @@ public interface TypeOrBuilder extends * Outer type may be present only if class_name or type_alias_name is present * */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getOuterType(); + ProtoBuf.Type getOuterType(); /** * optional int32 outer_type_id = 11; @@ -4509,7 +4511,7 @@ public interface TypeOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getAbbreviatedType(); + ProtoBuf.Type getAbbreviatedType(); /** * optional int32 abbreviated_type_id = 14; @@ -4541,17 +4543,17 @@ public interface TypeOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.Type} */ public static final class Type extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< Type> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Type) TypeOrBuilder { // Use Type.newBuilder() to construct. - private Type(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private Type(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Type(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Type(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Type defaultInstance; public static Type getDefaultInstance() { @@ -4562,17 +4564,17 @@ public Type getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Type( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -4596,10 +4598,10 @@ private Type( } case 18: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - argument_ = new java.util.ArrayList(); + argument_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - argument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.PARSER, extensionRegistry)); + argument_.add(input.readMessage(ProtoBuf.Type.Argument.PARSER, extensionRegistry)); break; } case 24: { @@ -4613,11 +4615,11 @@ private Type( break; } case 42: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000004) == 0x00000004)) { subBuilder = flexibleUpperBound_.toBuilder(); } - flexibleUpperBound_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + flexibleUpperBound_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(flexibleUpperBound_); flexibleUpperBound_ = subBuilder.buildPartial(); @@ -4646,11 +4648,11 @@ private Type( break; } case 82: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000100) == 0x00000100)) { subBuilder = outerType_.toBuilder(); } - outerType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + outerType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(outerType_); outerType_ = subBuilder.buildPartial(); @@ -4669,11 +4671,11 @@ private Type( break; } case 106: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000400) == 0x00000400)) { subBuilder = abbreviatedType_.toBuilder(); } - abbreviatedType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + abbreviatedType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(abbreviatedType_); abbreviatedType_ = subBuilder.buildPartial(); @@ -4688,10 +4690,10 @@ private Type( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { @@ -4707,24 +4709,24 @@ private Type( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Type parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Type(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } public interface ArgumentOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Type.Argument) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; @@ -4733,7 +4735,7 @@ public interface ArgumentOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection getProjection(); + ProtoBuf.Type.Argument.Projection getProjection(); /** * optional .org.jetbrains.kotlin.metadata.Type type = 2; @@ -4750,7 +4752,7 @@ public interface ArgumentOrBuilder extends * When projection is STAR, no type is written, otherwise type must be specified * */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(); + ProtoBuf.Type getType(); /** * optional int32 type_id = 3; @@ -4765,16 +4767,16 @@ public interface ArgumentOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.Type.Argument} */ public static final class Argument extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Type.Argument) ArgumentOrBuilder { // Use Argument.newBuilder() to construct. - private Argument(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Argument(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Argument(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Argument(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Argument defaultInstance; public static Argument getDefaultInstance() { @@ -4785,16 +4787,16 @@ public Argument getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Argument( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -4813,7 +4815,7 @@ private Argument( } case 8: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection value = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.valueOf(rawValue); + ProtoBuf.Type.Argument.Projection value = ProtoBuf.Type.Argument.Projection.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -4824,11 +4826,11 @@ private Argument( break; } case 18: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000002) == 0x00000002)) { subBuilder = type_.toBuilder(); } - type_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + type_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(type_); type_ = subBuilder.buildPartial(); @@ -4843,10 +4845,10 @@ private Argument( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { try { @@ -4859,18 +4861,18 @@ private Argument( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Argument parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Argument(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -4878,7 +4880,7 @@ public com.google.protobuf.Parser getParserForType() { * Protobuf enum {@code org.jetbrains.kotlin.metadata.Type.Argument.Projection} */ public enum Projection - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * IN = 0; */ @@ -4927,13 +4929,13 @@ public static Projection valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { public Projection findValueByNumber(int number) { return Projection.valueOf(number); } @@ -4951,7 +4953,7 @@ private Projection(int index, int value) { private int bitField0_; public static final int PROJECTION_FIELD_NUMBER = 1; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection projection_; + private ProtoBuf.Type.Argument.Projection projection_; /** * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; */ @@ -4961,12 +4963,12 @@ public boolean hasProjection() { /** * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection getProjection() { + public ProtoBuf.Type.Argument.Projection getProjection() { return projection_; } public static final int TYPE_FIELD_NUMBER = 2; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_; + private ProtoBuf.Type type_; /** * optional .org.jetbrains.kotlin.metadata.Type type = 2; * @@ -4984,7 +4986,7 @@ public boolean hasType() { * When projection is STAR, no type is written, otherwise type must be specified * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + public ProtoBuf.Type getType() { return type_; } @@ -5004,8 +5006,8 @@ public int getTypeId() { } private void initFields() { - projection_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.INV; - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + projection_ = ProtoBuf.Type.Argument.Projection.INV; + type_ = ProtoBuf.Type.getDefaultInstance(); typeId_ = 0; } private byte memoizedIsInitialized = -1; @@ -5024,7 +5026,7 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -5046,15 +5048,15 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(1, projection_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(2, type_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(3, typeId_); } size += unknownFields.size(); @@ -5069,62 +5071,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Type.Argument parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Type.Argument parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Type.Argument parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( + public static ProtoBuf.Type.Argument parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom(java.io.InputStream input) + public static ProtoBuf.Type.Argument parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( + public static ProtoBuf.Type.Argument parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Type.Argument parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseDelimitedFrom( + public static ProtoBuf.Type.Argument parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Type.Argument parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Type.Argument parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Type.Argument prototype) { + public static Builder newBuilder(ProtoBuf.Type.Argument prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -5133,12 +5135,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Arg * Protobuf type {@code org.jetbrains.kotlin.metadata.Type.Argument} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.Type.Argument, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Type.Argument) - org.jetbrains.kotlin.metadata.ProtoBuf.Type.ArgumentOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.newBuilder() + ProtoBuf.Type.ArgumentOrBuilder { + // Construct using ProtoBuf.Type.Argument.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -5151,9 +5153,9 @@ private static Builder create() { public Builder clear() { super.clear(); - projection_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.INV; + projection_ = ProtoBuf.Type.Argument.Projection.INV; bitField0_ = (bitField0_ & ~0x00000001); - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + type_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000002); typeId_ = 0; bitField0_ = (bitField0_ & ~0x00000004); @@ -5164,20 +5166,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.getDefaultInstance(); + public ProtoBuf.Type.Argument getDefaultInstanceForType() { + return ProtoBuf.Type.Argument.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument result = buildPartial(); + public ProtoBuf.Type.Argument build() { + ProtoBuf.Type.Argument result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument result = new org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument(this); + public ProtoBuf.Type.Argument buildPartial() { + ProtoBuf.Type.Argument result = new ProtoBuf.Type.Argument(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -5196,8 +5198,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Type.Argument other) { + if (other == ProtoBuf.Type.Argument.getDefaultInstance()) return this; if (other.hasProjection()) { setProjection(other.getProjection()); } @@ -5223,14 +5225,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument parsedMessage = null; + ProtoBuf.Type.Argument parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Type.Argument) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -5241,7 +5243,7 @@ public Builder mergeFrom( } private int bitField0_; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection projection_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.INV; + private ProtoBuf.Type.Argument.Projection projection_ = ProtoBuf.Type.Argument.Projection.INV; /** * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; */ @@ -5251,13 +5253,13 @@ public boolean hasProjection() { /** * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection getProjection() { + public ProtoBuf.Type.Argument.Projection getProjection() { return projection_; } /** * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; */ - public Builder setProjection(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection value) { + public Builder setProjection(ProtoBuf.Type.Argument.Projection value) { if (value == null) { throw new NullPointerException(); } @@ -5271,12 +5273,12 @@ public Builder setProjection(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argumen */ public Builder clearProjection() { bitField0_ = (bitField0_ & ~0x00000001); - projection_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Projection.INV; + projection_ = ProtoBuf.Type.Argument.Projection.INV; return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type type_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type type = 2; * @@ -5294,7 +5296,7 @@ public boolean hasType() { * When projection is STAR, no type is written, otherwise type must be specified * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + public ProtoBuf.Type getType() { return type_; } /** @@ -5304,7 +5306,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { * When projection is STAR, no type is written, otherwise type must be specified * */ - public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -5321,7 +5323,7 @@ public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { * */ public Builder setType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { type_ = builderForValue.build(); bitField0_ |= 0x00000002; @@ -5334,11 +5336,11 @@ public Builder setType( * When projection is STAR, no type is written, otherwise type must be specified * */ - public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000002) == 0x00000002) && - type_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + type_ != ProtoBuf.Type.getDefaultInstance()) { type_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); } else { type_ = value; } @@ -5354,7 +5356,7 @@ public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { * */ public Builder clearType() { - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + type_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000002); return this; @@ -5405,17 +5407,17 @@ public Builder clearTypeId() { private int bitField0_; public static final int ARGUMENT_FIELD_NUMBER = 2; - private java.util.List argument_; + private java.util.List argument_; /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - public java.util.List getArgumentList() { + public java.util.List getArgumentList() { return argument_; } /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - public java.util.List + public java.util.List getArgumentOrBuilderList() { return argument_; } @@ -5428,13 +5430,13 @@ public int getArgumentCount() { /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument getArgument(int index) { + public ProtoBuf.Type.Argument getArgument(int index) { return argument_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type.ArgumentOrBuilder getArgumentOrBuilder( + public ProtoBuf.Type.ArgumentOrBuilder getArgumentOrBuilder( int index) { return argument_.get(index); } @@ -5480,7 +5482,7 @@ public int getFlexibleTypeCapabilitiesId() { } public static final int FLEXIBLE_UPPER_BOUND_FIELD_NUMBER = 5; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type flexibleUpperBound_; + private ProtoBuf.Type flexibleUpperBound_; /** * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ @@ -5490,7 +5492,7 @@ public boolean hasFlexibleUpperBound() { /** * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getFlexibleUpperBound() { + public ProtoBuf.Type getFlexibleUpperBound() { return flexibleUpperBound_; } @@ -5596,7 +5598,7 @@ public int getTypeAliasName() { } public static final int OUTER_TYPE_FIELD_NUMBER = 10; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type outerType_; + private ProtoBuf.Type outerType_; /** * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; * @@ -5614,7 +5616,7 @@ public boolean hasOuterType() { * Outer type may be present only if class_name or type_alias_name is present * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getOuterType() { + public ProtoBuf.Type getOuterType() { return outerType_; } @@ -5634,7 +5636,7 @@ public int getOuterTypeId() { } public static final int ABBREVIATED_TYPE_FIELD_NUMBER = 13; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type abbreviatedType_; + private ProtoBuf.Type abbreviatedType_; /** * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ @@ -5644,7 +5646,7 @@ public boolean hasAbbreviatedType() { /** * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getAbbreviatedType() { + public ProtoBuf.Type getAbbreviatedType() { return abbreviatedType_; } @@ -5690,15 +5692,15 @@ private void initFields() { argument_ = java.util.Collections.emptyList(); nullable_ = false; flexibleTypeCapabilitiesId_ = 0; - flexibleUpperBound_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + flexibleUpperBound_ = ProtoBuf.Type.getDefaultInstance(); flexibleUpperBoundId_ = 0; className_ = 0; typeParameter_ = 0; typeParameterName_ = 0; typeAliasName_ = 0; - outerType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + outerType_ = ProtoBuf.Type.getDefaultInstance(); outerTypeId_ = 0; - abbreviatedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + abbreviatedType_ = ProtoBuf.Type.getDefaultInstance(); abbreviatedTypeId_ = 0; flags_ = 0; } @@ -5740,11 +5742,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00001000) == 0x00001000)) { output.writeInt32(1, flags_); @@ -5799,59 +5801,59 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00001000) == 0x00001000)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, flags_); } for (int i = 0; i < argument_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(2, argument_.get(i)); } if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeBoolSize(3, nullable_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(4, flexibleTypeCapabilitiesId_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(5, flexibleUpperBound_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(6, className_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(7, typeParameter_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(8, flexibleUpperBoundId_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(9, typeParameterName_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(10, outerType_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(11, outerTypeId_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(12, typeAliasName_); } if (((bitField0_ & 0x00000400) == 0x00000400)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(13, abbreviatedType_); } if (((bitField0_ & 0x00000800) == 0x00000800)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(14, abbreviatedTypeId_); } size += extensionsSerializedSize(); @@ -5867,62 +5869,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Type parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Type parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Type parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( + public static ProtoBuf.Type parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom(java.io.InputStream input) + public static ProtoBuf.Type parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( + public static ProtoBuf.Type parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Type parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseDelimitedFrom( + public static ProtoBuf.Type parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Type parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Type parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Type parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Type prototype) { + public static Builder newBuilder(ProtoBuf.Type prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -5931,11 +5933,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Type pro * Protobuf type {@code org.jetbrains.kotlin.metadata.Type} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.Type, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.Type, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Type) - org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder() + ProtoBuf.TypeOrBuilder { + // Construct using ProtoBuf.Type.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -5954,7 +5956,7 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000002); flexibleTypeCapabilitiesId_ = 0; bitField0_ = (bitField0_ & ~0x00000004); - flexibleUpperBound_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + flexibleUpperBound_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); flexibleUpperBoundId_ = 0; bitField0_ = (bitField0_ & ~0x00000010); @@ -5966,11 +5968,11 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000080); typeAliasName_ = 0; bitField0_ = (bitField0_ & ~0x00000100); - outerType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + outerType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000200); outerTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000400); - abbreviatedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + abbreviatedType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000800); abbreviatedTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00001000); @@ -5983,20 +5985,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + public ProtoBuf.Type getDefaultInstanceForType() { + return ProtoBuf.Type.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Type build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Type result = buildPartial(); + public ProtoBuf.Type build() { + ProtoBuf.Type result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Type buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Type result = new org.jetbrains.kotlin.metadata.ProtoBuf.Type(this); + public ProtoBuf.Type buildPartial() { + ProtoBuf.Type result = new ProtoBuf.Type(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -6060,8 +6062,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Type buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Type other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Type other) { + if (other == ProtoBuf.Type.getDefaultInstance()) return this; if (!other.argument_.isEmpty()) { if (argument_.isEmpty()) { argument_ = other.argument_; @@ -6150,14 +6152,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Type parsedMessage = null; + ProtoBuf.Type parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Type) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Type) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -6168,11 +6170,11 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List argument_ = + private java.util.List argument_ = java.util.Collections.emptyList(); private void ensureArgumentIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { - argument_ = new java.util.ArrayList(argument_); + argument_ = new java.util.ArrayList(argument_); bitField0_ |= 0x00000001; } } @@ -6180,7 +6182,7 @@ private void ensureArgumentIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - public java.util.List getArgumentList() { + public java.util.List getArgumentList() { return java.util.Collections.unmodifiableList(argument_); } /** @@ -6192,14 +6194,14 @@ public int getArgumentCount() { /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument getArgument(int index) { + public ProtoBuf.Type.Argument getArgument(int index) { return argument_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ public Builder setArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument value) { + int index, ProtoBuf.Type.Argument value) { if (value == null) { throw new NullPointerException(); } @@ -6212,7 +6214,7 @@ public Builder setArgument( * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ public Builder setArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Builder builderForValue) { + int index, ProtoBuf.Type.Argument.Builder builderForValue) { ensureArgumentIsMutable(); argument_.set(index, builderForValue.build()); @@ -6221,7 +6223,7 @@ public Builder setArgument( /** * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ - public Builder addArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument value) { + public Builder addArgument(ProtoBuf.Type.Argument value) { if (value == null) { throw new NullPointerException(); } @@ -6234,7 +6236,7 @@ public Builder addArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ public Builder addArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument value) { + int index, ProtoBuf.Type.Argument value) { if (value == null) { throw new NullPointerException(); } @@ -6247,7 +6249,7 @@ public Builder addArgument( * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ public Builder addArgument( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Builder builderForValue) { + ProtoBuf.Type.Argument.Builder builderForValue) { ensureArgumentIsMutable(); argument_.add(builderForValue.build()); @@ -6257,7 +6259,7 @@ public Builder addArgument( * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ public Builder addArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Argument.Builder builderForValue) { + int index, ProtoBuf.Type.Argument.Builder builderForValue) { ensureArgumentIsMutable(); argument_.add(index, builderForValue.build()); @@ -6267,9 +6269,9 @@ public Builder addArgument( * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; */ public Builder addAllArgument( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureArgumentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, argument_); return this; @@ -6377,7 +6379,7 @@ public Builder clearFlexibleTypeCapabilitiesId() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type flexibleUpperBound_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type flexibleUpperBound_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ @@ -6387,13 +6389,13 @@ public boolean hasFlexibleUpperBound() { /** * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getFlexibleUpperBound() { + public ProtoBuf.Type getFlexibleUpperBound() { return flexibleUpperBound_; } /** * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ - public Builder setFlexibleUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setFlexibleUpperBound(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -6406,7 +6408,7 @@ public Builder setFlexibleUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Type * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ public Builder setFlexibleUpperBound( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { flexibleUpperBound_ = builderForValue.build(); bitField0_ |= 0x00000008; @@ -6415,11 +6417,11 @@ public Builder setFlexibleUpperBound( /** * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ - public Builder mergeFlexibleUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeFlexibleUpperBound(ProtoBuf.Type value) { if (((bitField0_ & 0x00000008) == 0x00000008) && - flexibleUpperBound_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + flexibleUpperBound_ != ProtoBuf.Type.getDefaultInstance()) { flexibleUpperBound_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(flexibleUpperBound_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(flexibleUpperBound_).mergeFrom(value).buildPartial(); } else { flexibleUpperBound_ = value; } @@ -6431,7 +6433,7 @@ public Builder mergeFlexibleUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Ty * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; */ public Builder clearFlexibleUpperBound() { - flexibleUpperBound_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + flexibleUpperBound_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); return this; @@ -6649,7 +6651,7 @@ public Builder clearTypeAliasName() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type outerType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type outerType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; * @@ -6667,7 +6669,7 @@ public boolean hasOuterType() { * Outer type may be present only if class_name or type_alias_name is present * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getOuterType() { + public ProtoBuf.Type getOuterType() { return outerType_; } /** @@ -6677,7 +6679,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Type getOuterType() { * Outer type may be present only if class_name or type_alias_name is present * */ - public Builder setOuterType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setOuterType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -6694,7 +6696,7 @@ public Builder setOuterType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { * */ public Builder setOuterType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { outerType_ = builderForValue.build(); bitField0_ |= 0x00000200; @@ -6707,11 +6709,11 @@ public Builder setOuterType( * Outer type may be present only if class_name or type_alias_name is present * */ - public Builder mergeOuterType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeOuterType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000200) == 0x00000200) && - outerType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + outerType_ != ProtoBuf.Type.getDefaultInstance()) { outerType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(outerType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(outerType_).mergeFrom(value).buildPartial(); } else { outerType_ = value; } @@ -6727,7 +6729,7 @@ public Builder mergeOuterType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) * */ public Builder clearOuterType() { - outerType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + outerType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000200); return this; @@ -6765,7 +6767,7 @@ public Builder clearOuterTypeId() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type abbreviatedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type abbreviatedType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ @@ -6775,13 +6777,13 @@ public boolean hasAbbreviatedType() { /** * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getAbbreviatedType() { + public ProtoBuf.Type getAbbreviatedType() { return abbreviatedType_; } /** * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ - public Builder setAbbreviatedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setAbbreviatedType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -6794,7 +6796,7 @@ public Builder setAbbreviatedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type va * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ public Builder setAbbreviatedType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { abbreviatedType_ = builderForValue.build(); bitField0_ |= 0x00000800; @@ -6803,11 +6805,11 @@ public Builder setAbbreviatedType( /** * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ - public Builder mergeAbbreviatedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeAbbreviatedType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000800) == 0x00000800) && - abbreviatedType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + abbreviatedType_ != ProtoBuf.Type.getDefaultInstance()) { abbreviatedType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(abbreviatedType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(abbreviatedType_).mergeFrom(value).buildPartial(); } else { abbreviatedType_ = value; } @@ -6819,7 +6821,7 @@ public Builder mergeAbbreviatedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; */ public Builder clearAbbreviatedType() { - abbreviatedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + abbreviatedType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000800); return this; @@ -6918,7 +6920,7 @@ public Builder clearFlags() { public interface TypeParameterOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeParameter) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** @@ -6955,17 +6957,17 @@ public interface TypeParameterOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance getVariance(); + ProtoBuf.TypeParameter.Variance getVariance(); /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - java.util.List + java.util.List getUpperBoundList(); /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getUpperBound(int index); + ProtoBuf.Type getUpperBound(int index); /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ @@ -6988,17 +6990,17 @@ public interface TypeParameterOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeParameter} */ public static final class TypeParameter extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< TypeParameter> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeParameter) TypeParameterOrBuilder { // Use TypeParameter.newBuilder() to construct. - private TypeParameter(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private TypeParameter(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private TypeParameter(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private TypeParameter(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final TypeParameter defaultInstance; public static TypeParameter getDefaultInstance() { @@ -7009,17 +7011,17 @@ public TypeParameter getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private TypeParameter( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -7053,7 +7055,7 @@ private TypeParameter( } case 32: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance value = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.valueOf(rawValue); + ProtoBuf.TypeParameter.Variance value = ProtoBuf.TypeParameter.Variance.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -7065,10 +7067,10 @@ private TypeParameter( } case 42: { if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - upperBound_ = new java.util.ArrayList(); + upperBound_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000010; } - upperBound_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); + upperBound_.add(input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry)); break; } case 48: { @@ -7094,10 +7096,10 @@ private TypeParameter( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { @@ -7116,18 +7118,18 @@ private TypeParameter( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public TypeParameter parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new TypeParameter(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -7135,7 +7137,7 @@ public com.google.protobuf.Parser getParserForType() { * Protobuf enum {@code org.jetbrains.kotlin.metadata.TypeParameter.Variance} */ public enum Variance - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * IN = 0; */ @@ -7175,13 +7177,13 @@ public static Variance valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { public Variance findValueByNumber(int number) { return Variance.valueOf(number); } @@ -7244,7 +7246,7 @@ public boolean getReified() { } public static final int VARIANCE_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance variance_; + private ProtoBuf.TypeParameter.Variance variance_; /** * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; */ @@ -7254,22 +7256,22 @@ public boolean hasVariance() { /** * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance getVariance() { + public ProtoBuf.TypeParameter.Variance getVariance() { return variance_; } public static final int UPPER_BOUND_FIELD_NUMBER = 5; - private java.util.List upperBound_; + private java.util.List upperBound_; /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - public java.util.List getUpperBoundList() { + public java.util.List getUpperBoundList() { return upperBound_; } /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - public java.util.List + public java.util.List getUpperBoundOrBuilderList() { return upperBound_; } @@ -7282,13 +7284,13 @@ public int getUpperBoundCount() { /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUpperBound(int index) { + public ProtoBuf.Type getUpperBound(int index) { return upperBound_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getUpperBoundOrBuilder( + public ProtoBuf.TypeOrBuilder getUpperBoundOrBuilder( int index) { return upperBound_.get(index); } @@ -7320,7 +7322,7 @@ private void initFields() { id_ = 0; name_ = 0; reified_ = false; - variance_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.INV; + variance_ = ProtoBuf.TypeParameter.Variance.INV; upperBound_ = java.util.Collections.emptyList(); upperBoundId_ = java.util.Collections.emptyList(); } @@ -7352,11 +7354,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, id_); @@ -7391,35 +7393,35 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, id_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, name_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeBoolSize(3, reified_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(4, variance_.getNumber()); } for (int i = 0; i < upperBound_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(5, upperBound_.get(i)); } { int dataSize = 0; for (int i = 0; i < upperBoundId_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(upperBoundId_.get(i)); } size += dataSize; if (!getUpperBoundIdList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32SizeNoTag(dataSize); } upperBoundIdMemoizedSerializedSize = dataSize; @@ -7437,62 +7439,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeParameter parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeParameter parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeParameter parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( + public static ProtoBuf.TypeParameter parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom(java.io.InputStream input) + public static ProtoBuf.TypeParameter parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( + public static ProtoBuf.TypeParameter parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.TypeParameter parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseDelimitedFrom( + public static ProtoBuf.TypeParameter parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.TypeParameter parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.TypeParameter parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.TypeParameter prototype) { + public static Builder newBuilder(ProtoBuf.TypeParameter prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -7501,11 +7503,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.TypePara * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeParameter} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.TypeParameter, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeParameter) - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.newBuilder() + ProtoBuf.TypeParameterOrBuilder { + // Construct using ProtoBuf.TypeParameter.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -7524,7 +7526,7 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000002); reified_ = false; bitField0_ = (bitField0_ & ~0x00000004); - variance_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.INV; + variance_ = ProtoBuf.TypeParameter.Variance.INV; bitField0_ = (bitField0_ & ~0x00000008); upperBound_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); @@ -7537,20 +7539,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.getDefaultInstance(); + public ProtoBuf.TypeParameter getDefaultInstanceForType() { + return ProtoBuf.TypeParameter.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter build() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter result = buildPartial(); + public ProtoBuf.TypeParameter build() { + ProtoBuf.TypeParameter result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter(this); + public ProtoBuf.TypeParameter buildPartial() { + ProtoBuf.TypeParameter result = new ProtoBuf.TypeParameter(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -7583,8 +7585,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.TypeParameter other) { + if (other == ProtoBuf.TypeParameter.getDefaultInstance()) return this; if (other.hasId()) { setId(other.getId()); } @@ -7646,14 +7648,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter parsedMessage = null; + ProtoBuf.TypeParameter parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.TypeParameter) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -7760,7 +7762,7 @@ public Builder clearReified() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance variance_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.INV; + private ProtoBuf.TypeParameter.Variance variance_ = ProtoBuf.TypeParameter.Variance.INV; /** * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; */ @@ -7770,13 +7772,13 @@ public boolean hasVariance() { /** * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance getVariance() { + public ProtoBuf.TypeParameter.Variance getVariance() { return variance_; } /** * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; */ - public Builder setVariance(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance value) { + public Builder setVariance(ProtoBuf.TypeParameter.Variance value) { if (value == null) { throw new NullPointerException(); } @@ -7790,16 +7792,16 @@ public Builder setVariance(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter. */ public Builder clearVariance() { bitField0_ = (bitField0_ & ~0x00000008); - variance_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Variance.INV; + variance_ = ProtoBuf.TypeParameter.Variance.INV; return this; } - private java.util.List upperBound_ = + private java.util.List upperBound_ = java.util.Collections.emptyList(); private void ensureUpperBoundIsMutable() { if (!((bitField0_ & 0x00000010) == 0x00000010)) { - upperBound_ = new java.util.ArrayList(upperBound_); + upperBound_ = new java.util.ArrayList(upperBound_); bitField0_ |= 0x00000010; } } @@ -7807,7 +7809,7 @@ private void ensureUpperBoundIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - public java.util.List getUpperBoundList() { + public java.util.List getUpperBoundList() { return java.util.Collections.unmodifiableList(upperBound_); } /** @@ -7819,14 +7821,14 @@ public int getUpperBoundCount() { /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUpperBound(int index) { + public ProtoBuf.Type getUpperBound(int index) { return upperBound_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ public Builder setUpperBound( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + int index, ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -7839,7 +7841,7 @@ public Builder setUpperBound( * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ public Builder setUpperBound( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + int index, ProtoBuf.Type.Builder builderForValue) { ensureUpperBoundIsMutable(); upperBound_.set(index, builderForValue.build()); @@ -7848,7 +7850,7 @@ public Builder setUpperBound( /** * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ - public Builder addUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder addUpperBound(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -7861,7 +7863,7 @@ public Builder addUpperBound(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ public Builder addUpperBound( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + int index, ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -7874,7 +7876,7 @@ public Builder addUpperBound( * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ public Builder addUpperBound( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { ensureUpperBoundIsMutable(); upperBound_.add(builderForValue.build()); @@ -7884,7 +7886,7 @@ public Builder addUpperBound( * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ public Builder addUpperBound( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + int index, ProtoBuf.Type.Builder builderForValue) { ensureUpperBoundIsMutable(); upperBound_.add(index, builderForValue.build()); @@ -7894,9 +7896,9 @@ public Builder addUpperBound( * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; */ public Builder addAllUpperBound( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureUpperBoundIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, upperBound_); return this; @@ -7971,7 +7973,7 @@ public Builder addUpperBoundId(int value) { public Builder addAllUpperBoundId( java.lang.Iterable values) { ensureUpperBoundIdIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, upperBoundId_); return this; @@ -7999,7 +8001,7 @@ public Builder clearUpperBoundId() { public interface ClassOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Class) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** @@ -8058,12 +8060,12 @@ public interface ClassOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - java.util.List + java.util.List getTypeParameterList(); /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + ProtoBuf.TypeParameter getTypeParameter(int index); /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ @@ -8072,12 +8074,12 @@ public interface ClassOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - java.util.List + java.util.List getSupertypeList(); /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getSupertype(int index); + ProtoBuf.Type getSupertype(int index); /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ @@ -8112,12 +8114,12 @@ public interface ClassOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - java.util.List + java.util.List getConstructorList(); /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getConstructor(int index); + ProtoBuf.Constructor getConstructor(int index); /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ @@ -8126,12 +8128,12 @@ public interface ClassOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - java.util.List + java.util.List getFunctionList(); /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index); + ProtoBuf.Function getFunction(int index); /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ @@ -8140,12 +8142,12 @@ public interface ClassOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - java.util.List + java.util.List getPropertyList(); /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index); + ProtoBuf.Property getProperty(int index); /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ @@ -8154,12 +8156,12 @@ public interface ClassOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - java.util.List + java.util.List getTypeAliasList(); /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index); + ProtoBuf.TypeAlias getTypeAlias(int index); /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ @@ -8168,12 +8170,12 @@ public interface ClassOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - java.util.List + java.util.List getEnumEntryList(); /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getEnumEntry(int index); + ProtoBuf.EnumEntry getEnumEntry(int index); /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ @@ -8208,7 +8210,7 @@ public interface ClassOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getInlineClassUnderlyingType(); + ProtoBuf.Type getInlineClassUnderlyingType(); /** * optional int32 inline_class_underlying_type_id = 19; @@ -8226,7 +8228,7 @@ public interface ClassOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable(); + ProtoBuf.TypeTable getTypeTable(); /** * repeated int32 version_requirement = 31; @@ -8260,23 +8262,23 @@ public interface ClassOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable(); + ProtoBuf.VersionRequirementTable getVersionRequirementTable(); } /** * Protobuf type {@code org.jetbrains.kotlin.metadata.Class} */ public static final class Class extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< Class> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Class) ClassOrBuilder { // Use Class.newBuilder() to construct. - private Class(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private Class(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Class(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Class(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Class defaultInstance; public static Class getDefaultInstance() { @@ -8287,17 +8289,17 @@ public Class getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Class( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -8352,18 +8354,18 @@ private Class( } case 42: { if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - typeParameter_ = new java.util.ArrayList(); + typeParameter_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000008; } - typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + typeParameter_.add(input.readMessage(ProtoBuf.TypeParameter.PARSER, extensionRegistry)); break; } case 50: { if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - supertype_ = new java.util.ArrayList(); + supertype_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000010; } - supertype_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); + supertype_.add(input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry)); break; } case 56: { @@ -8389,42 +8391,42 @@ private Class( } case 66: { if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - constructor_ = new java.util.ArrayList(); + constructor_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000080; } - constructor_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.PARSER, extensionRegistry)); + constructor_.add(input.readMessage(ProtoBuf.Constructor.PARSER, extensionRegistry)); break; } case 74: { if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - function_ = new java.util.ArrayList(); + function_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000100; } - function_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Function.PARSER, extensionRegistry)); + function_.add(input.readMessage(ProtoBuf.Function.PARSER, extensionRegistry)); break; } case 82: { if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { - property_ = new java.util.ArrayList(); + property_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000200; } - property_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Property.PARSER, extensionRegistry)); + property_.add(input.readMessage(ProtoBuf.Property.PARSER, extensionRegistry)); break; } case 90: { if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { - typeAlias_ = new java.util.ArrayList(); + typeAlias_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000400; } - typeAlias_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.PARSER, extensionRegistry)); + typeAlias_.add(input.readMessage(ProtoBuf.TypeAlias.PARSER, extensionRegistry)); break; } case 106: { if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - enumEntry_ = new java.util.ArrayList(); + enumEntry_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000800; } - enumEntry_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.PARSER, extensionRegistry)); + enumEntry_.add(input.readMessage(ProtoBuf.EnumEntry.PARSER, extensionRegistry)); break; } case 128: { @@ -8454,11 +8456,11 @@ private Class( break; } case 146: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000010) == 0x00000010)) { subBuilder = inlineClassUnderlyingType_.toBuilder(); } - inlineClassUnderlyingType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + inlineClassUnderlyingType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(inlineClassUnderlyingType_); inlineClassUnderlyingType_ = subBuilder.buildPartial(); @@ -8472,11 +8474,11 @@ private Class( break; } case 242: { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; + ProtoBuf.TypeTable.Builder subBuilder = null; if (((bitField0_ & 0x00000040) == 0x00000040)) { subBuilder = typeTable_.toBuilder(); } - typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); + typeTable_ = input.readMessage(ProtoBuf.TypeTable.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(typeTable_); typeTable_ = subBuilder.buildPartial(); @@ -8506,11 +8508,11 @@ private Class( break; } case 258: { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder subBuilder = null; + ProtoBuf.VersionRequirementTable.Builder subBuilder = null; if (((bitField0_ & 0x00000080) == 0x00000080)) { subBuilder = versionRequirementTable_.toBuilder(); } - versionRequirementTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.PARSER, extensionRegistry); + versionRequirementTable_ = input.readMessage(ProtoBuf.VersionRequirementTable.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(versionRequirementTable_); versionRequirementTable_ = subBuilder.buildPartial(); @@ -8520,10 +8522,10 @@ private Class( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { @@ -8569,18 +8571,18 @@ private Class( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Class parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Class(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -8588,7 +8590,7 @@ public com.google.protobuf.Parser getParserForType() { * Protobuf enum {@code org.jetbrains.kotlin.metadata.Class.Kind} */ public enum Kind - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * CLASS = 0; * @@ -8672,13 +8674,13 @@ public static Kind valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { public Kind findValueByNumber(int number) { return Kind.valueOf(number); } @@ -8767,17 +8769,17 @@ public int getCompanionObjectName() { } public static final int TYPE_PARAMETER_FIELD_NUMBER = 5; - private java.util.List typeParameter_; + private java.util.List typeParameter_; /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - public java.util.List getTypeParameterList() { + public java.util.List getTypeParameterList() { return typeParameter_; } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - public java.util.List + public java.util.List getTypeParameterOrBuilderList() { return typeParameter_; } @@ -8790,29 +8792,29 @@ public int getTypeParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + public ProtoBuf.TypeParameter getTypeParameter(int index) { return typeParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + public ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( int index) { return typeParameter_.get(index); } public static final int SUPERTYPE_FIELD_NUMBER = 6; - private java.util.List supertype_; + private java.util.List supertype_; /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - public java.util.List getSupertypeList() { + public java.util.List getSupertypeList() { return supertype_; } /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - public java.util.List + public java.util.List getSupertypeOrBuilderList() { return supertype_; } @@ -8825,13 +8827,13 @@ public int getSupertypeCount() { /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getSupertype(int index) { + public ProtoBuf.Type getSupertype(int index) { return supertype_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getSupertypeOrBuilder( + public ProtoBuf.TypeOrBuilder getSupertypeOrBuilder( int index) { return supertype_.get(index); } @@ -8883,17 +8885,17 @@ public int getNestedClassName(int index) { private int nestedClassNameMemoizedSerializedSize = -1; public static final int CONSTRUCTOR_FIELD_NUMBER = 8; - private java.util.List constructor_; + private java.util.List constructor_; /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - public java.util.List getConstructorList() { + public java.util.List getConstructorList() { return constructor_; } /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - public java.util.List + public java.util.List getConstructorOrBuilderList() { return constructor_; } @@ -8906,29 +8908,29 @@ public int getConstructorCount() { /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getConstructor(int index) { + public ProtoBuf.Constructor getConstructor(int index) { return constructor_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ConstructorOrBuilder getConstructorOrBuilder( + public ProtoBuf.ConstructorOrBuilder getConstructorOrBuilder( int index) { return constructor_.get(index); } public static final int FUNCTION_FIELD_NUMBER = 9; - private java.util.List function_; + private java.util.List function_; /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - public java.util.List getFunctionList() { + public java.util.List getFunctionList() { return function_; } /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - public java.util.List + public java.util.List getFunctionOrBuilderList() { return function_; } @@ -8941,29 +8943,29 @@ public int getFunctionCount() { /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index) { + public ProtoBuf.Function getFunction(int index) { return function_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.FunctionOrBuilder getFunctionOrBuilder( + public ProtoBuf.FunctionOrBuilder getFunctionOrBuilder( int index) { return function_.get(index); } public static final int PROPERTY_FIELD_NUMBER = 10; - private java.util.List property_; + private java.util.List property_; /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - public java.util.List getPropertyList() { + public java.util.List getPropertyList() { return property_; } /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - public java.util.List + public java.util.List getPropertyOrBuilderList() { return property_; } @@ -8976,29 +8978,29 @@ public int getPropertyCount() { /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index) { + public ProtoBuf.Property getProperty(int index) { return property_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.PropertyOrBuilder getPropertyOrBuilder( + public ProtoBuf.PropertyOrBuilder getPropertyOrBuilder( int index) { return property_.get(index); } public static final int TYPE_ALIAS_FIELD_NUMBER = 11; - private java.util.List typeAlias_; + private java.util.List typeAlias_; /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - public java.util.List getTypeAliasList() { + public java.util.List getTypeAliasList() { return typeAlias_; } /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - public java.util.List + public java.util.List getTypeAliasOrBuilderList() { return typeAlias_; } @@ -9011,29 +9013,29 @@ public int getTypeAliasCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index) { + public ProtoBuf.TypeAlias getTypeAlias(int index) { return typeAlias_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAliasOrBuilder getTypeAliasOrBuilder( + public ProtoBuf.TypeAliasOrBuilder getTypeAliasOrBuilder( int index) { return typeAlias_.get(index); } public static final int ENUM_ENTRY_FIELD_NUMBER = 13; - private java.util.List enumEntry_; + private java.util.List enumEntry_; /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - public java.util.List getEnumEntryList() { + public java.util.List getEnumEntryList() { return enumEntry_; } /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - public java.util.List + public java.util.List getEnumEntryOrBuilderList() { return enumEntry_; } @@ -9046,13 +9048,13 @@ public int getEnumEntryCount() { /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getEnumEntry(int index) { + public ProtoBuf.EnumEntry getEnumEntry(int index) { return enumEntry_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntryOrBuilder getEnumEntryOrBuilder( + public ProtoBuf.EnumEntryOrBuilder getEnumEntryOrBuilder( int index) { return enumEntry_.get(index); } @@ -9096,7 +9098,7 @@ public int getInlineClassUnderlyingPropertyName() { } public static final int INLINE_CLASS_UNDERLYING_TYPE_FIELD_NUMBER = 18; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type inlineClassUnderlyingType_; + private ProtoBuf.Type inlineClassUnderlyingType_; /** * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ @@ -9106,7 +9108,7 @@ public boolean hasInlineClassUnderlyingType() { /** * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getInlineClassUnderlyingType() { + public ProtoBuf.Type getInlineClassUnderlyingType() { return inlineClassUnderlyingType_; } @@ -9126,7 +9128,7 @@ public int getInlineClassUnderlyingTypeId() { } public static final int TYPE_TABLE_FIELD_NUMBER = 30; - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; + private ProtoBuf.TypeTable typeTable_; /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ @@ -9136,7 +9138,7 @@ public boolean hasTypeTable() { /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + public ProtoBuf.TypeTable getTypeTable() { return typeTable_; } @@ -9175,7 +9177,7 @@ public int getVersionRequirement(int index) { } public static final int VERSION_REQUIREMENT_TABLE_FIELD_NUMBER = 32; - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable versionRequirementTable_; + private ProtoBuf.VersionRequirementTable versionRequirementTable_; /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ @@ -9185,7 +9187,7 @@ public boolean hasVersionRequirementTable() { /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable() { + public ProtoBuf.VersionRequirementTable getVersionRequirementTable() { return versionRequirementTable_; } @@ -9204,11 +9206,11 @@ private void initFields() { enumEntry_ = java.util.Collections.emptyList(); sealedSubclassFqName_ = java.util.Collections.emptyList(); inlineClassUnderlyingPropertyName_ = 0; - inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + inlineClassUnderlyingType_ = ProtoBuf.Type.getDefaultInstance(); inlineClassUnderlyingTypeId_ = 0; - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); versionRequirement_ = java.util.Collections.emptyList(); - versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + versionRequirementTable_ = ProtoBuf.VersionRequirementTable.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -9282,11 +9284,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, flags_); @@ -9368,114 +9370,114 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, flags_); } { int dataSize = 0; for (int i = 0; i < supertypeId_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(supertypeId_.get(i)); } size += dataSize; if (!getSupertypeIdList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32SizeNoTag(dataSize); } supertypeIdMemoizedSerializedSize = dataSize; } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(3, fqName_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(4, companionObjectName_); } for (int i = 0; i < typeParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(5, typeParameter_.get(i)); } for (int i = 0; i < supertype_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(6, supertype_.get(i)); } { int dataSize = 0; for (int i = 0; i < nestedClassName_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(nestedClassName_.get(i)); } size += dataSize; if (!getNestedClassNameList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32SizeNoTag(dataSize); } nestedClassNameMemoizedSerializedSize = dataSize; } for (int i = 0; i < constructor_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(8, constructor_.get(i)); } for (int i = 0; i < function_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(9, function_.get(i)); } for (int i = 0; i < property_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(10, property_.get(i)); } for (int i = 0; i < typeAlias_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(11, typeAlias_.get(i)); } for (int i = 0; i < enumEntry_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(13, enumEntry_.get(i)); } { int dataSize = 0; for (int i = 0; i < sealedSubclassFqName_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(sealedSubclassFqName_.get(i)); } size += dataSize; if (!getSealedSubclassFqNameList().isEmpty()) { size += 2; - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32SizeNoTag(dataSize); } sealedSubclassFqNameMemoizedSerializedSize = dataSize; } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(17, inlineClassUnderlyingPropertyName_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(18, inlineClassUnderlyingType_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(19, inlineClassUnderlyingTypeId_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(30, typeTable_); } { int dataSize = 0; for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(versionRequirement_.get(i)); } size += dataSize; size += 2 * getVersionRequirementList().size(); } if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(32, versionRequirementTable_); } size += extensionsSerializedSize(); @@ -9491,62 +9493,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Class parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Class parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Class parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( + public static ProtoBuf.Class parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom(java.io.InputStream input) + public static ProtoBuf.Class parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( + public static ProtoBuf.Class parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Class parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseDelimitedFrom( + public static ProtoBuf.Class parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Class parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Class parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Class parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Class prototype) { + public static Builder newBuilder(ProtoBuf.Class prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -9555,11 +9557,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Class pr * Protobuf type {@code org.jetbrains.kotlin.metadata.Class} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.Class, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.Class, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Class) - org.jetbrains.kotlin.metadata.ProtoBuf.ClassOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Class.newBuilder() + ProtoBuf.ClassOrBuilder { + // Construct using ProtoBuf.Class.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -9600,15 +9602,15 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00001000); inlineClassUnderlyingPropertyName_ = 0; bitField0_ = (bitField0_ & ~0x00002000); - inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + inlineClassUnderlyingType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00004000); inlineClassUnderlyingTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00008000); - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00010000); versionRequirement_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00020000); - versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + versionRequirementTable_ = ProtoBuf.VersionRequirementTable.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00040000); return this; } @@ -9617,20 +9619,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Class getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance(); + public ProtoBuf.Class getDefaultInstanceForType() { + return ProtoBuf.Class.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Class build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Class result = buildPartial(); + public ProtoBuf.Class build() { + ProtoBuf.Class result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Class buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Class result = new org.jetbrains.kotlin.metadata.ProtoBuf.Class(this); + public ProtoBuf.Class buildPartial() { + ProtoBuf.Class result = new ProtoBuf.Class(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -9724,8 +9726,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Class buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Class other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Class.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Class other) { + if (other == ProtoBuf.Class.getDefaultInstance()) return this; if (other.hasFlags()) { setFlags(other.getFlags()); } @@ -9933,14 +9935,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Class parsedMessage = null; + ProtoBuf.Class parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Class) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Class) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -10099,11 +10101,11 @@ public Builder clearCompanionObjectName() { return this; } - private java.util.List typeParameter_ = + private java.util.List typeParameter_ = java.util.Collections.emptyList(); private void ensureTypeParameterIsMutable() { if (!((bitField0_ & 0x00000008) == 0x00000008)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); + typeParameter_ = new java.util.ArrayList(typeParameter_); bitField0_ |= 0x00000008; } } @@ -10111,7 +10113,7 @@ private void ensureTypeParameterIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - public java.util.List getTypeParameterList() { + public java.util.List getTypeParameterList() { return java.util.Collections.unmodifiableList(typeParameter_); } /** @@ -10123,14 +10125,14 @@ public int getTypeParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + public ProtoBuf.TypeParameter getTypeParameter(int index) { return typeParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + int index, ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -10143,7 +10145,7 @@ public Builder setTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + int index, ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.set(index, builderForValue.build()); @@ -10152,7 +10154,7 @@ public Builder setTypeParameter( /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ - public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + public Builder addTypeParameter(ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -10165,7 +10167,7 @@ public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParam * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + int index, ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -10178,7 +10180,7 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ public Builder addTypeParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.add(builderForValue.build()); @@ -10188,7 +10190,7 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + int index, ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.add(index, builderForValue.build()); @@ -10198,9 +10200,9 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; */ public Builder addAllTypeParameter( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureTypeParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, typeParameter_); return this; @@ -10224,11 +10226,11 @@ public Builder removeTypeParameter(int index) { return this; } - private java.util.List supertype_ = + private java.util.List supertype_ = java.util.Collections.emptyList(); private void ensureSupertypeIsMutable() { if (!((bitField0_ & 0x00000010) == 0x00000010)) { - supertype_ = new java.util.ArrayList(supertype_); + supertype_ = new java.util.ArrayList(supertype_); bitField0_ |= 0x00000010; } } @@ -10236,7 +10238,7 @@ private void ensureSupertypeIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - public java.util.List getSupertypeList() { + public java.util.List getSupertypeList() { return java.util.Collections.unmodifiableList(supertype_); } /** @@ -10248,14 +10250,14 @@ public int getSupertypeCount() { /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getSupertype(int index) { + public ProtoBuf.Type getSupertype(int index) { return supertype_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ public Builder setSupertype( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + int index, ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -10268,7 +10270,7 @@ public Builder setSupertype( * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ public Builder setSupertype( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + int index, ProtoBuf.Type.Builder builderForValue) { ensureSupertypeIsMutable(); supertype_.set(index, builderForValue.build()); @@ -10277,7 +10279,7 @@ public Builder setSupertype( /** * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ - public Builder addSupertype(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder addSupertype(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -10290,7 +10292,7 @@ public Builder addSupertype(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ public Builder addSupertype( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + int index, ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -10303,7 +10305,7 @@ public Builder addSupertype( * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ public Builder addSupertype( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { ensureSupertypeIsMutable(); supertype_.add(builderForValue.build()); @@ -10313,7 +10315,7 @@ public Builder addSupertype( * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ public Builder addSupertype( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + int index, ProtoBuf.Type.Builder builderForValue) { ensureSupertypeIsMutable(); supertype_.add(index, builderForValue.build()); @@ -10323,9 +10325,9 @@ public Builder addSupertype( * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; */ public Builder addAllSupertype( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureSupertypeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, supertype_); return this; @@ -10400,7 +10402,7 @@ public Builder addSupertypeId(int value) { public Builder addAllSupertypeId( java.lang.Iterable values) { ensureSupertypeIdIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, supertypeId_); return this; @@ -10466,7 +10468,7 @@ public Builder addNestedClassName(int value) { public Builder addAllNestedClassName( java.lang.Iterable values) { ensureNestedClassNameIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, nestedClassName_); return this; @@ -10481,11 +10483,11 @@ public Builder clearNestedClassName() { return this; } - private java.util.List constructor_ = + private java.util.List constructor_ = java.util.Collections.emptyList(); private void ensureConstructorIsMutable() { if (!((bitField0_ & 0x00000080) == 0x00000080)) { - constructor_ = new java.util.ArrayList(constructor_); + constructor_ = new java.util.ArrayList(constructor_); bitField0_ |= 0x00000080; } } @@ -10493,7 +10495,7 @@ private void ensureConstructorIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - public java.util.List getConstructorList() { + public java.util.List getConstructorList() { return java.util.Collections.unmodifiableList(constructor_); } /** @@ -10505,14 +10507,14 @@ public int getConstructorCount() { /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getConstructor(int index) { + public ProtoBuf.Constructor getConstructor(int index) { return constructor_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ public Builder setConstructor( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Constructor value) { + int index, ProtoBuf.Constructor value) { if (value == null) { throw new NullPointerException(); } @@ -10525,7 +10527,7 @@ public Builder setConstructor( * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ public Builder setConstructor( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.Builder builderForValue) { + int index, ProtoBuf.Constructor.Builder builderForValue) { ensureConstructorIsMutable(); constructor_.set(index, builderForValue.build()); @@ -10534,7 +10536,7 @@ public Builder setConstructor( /** * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ - public Builder addConstructor(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor value) { + public Builder addConstructor(ProtoBuf.Constructor value) { if (value == null) { throw new NullPointerException(); } @@ -10547,7 +10549,7 @@ public Builder addConstructor(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ public Builder addConstructor( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Constructor value) { + int index, ProtoBuf.Constructor value) { if (value == null) { throw new NullPointerException(); } @@ -10560,7 +10562,7 @@ public Builder addConstructor( * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ public Builder addConstructor( - org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.Builder builderForValue) { + ProtoBuf.Constructor.Builder builderForValue) { ensureConstructorIsMutable(); constructor_.add(builderForValue.build()); @@ -10570,7 +10572,7 @@ public Builder addConstructor( * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ public Builder addConstructor( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.Builder builderForValue) { + int index, ProtoBuf.Constructor.Builder builderForValue) { ensureConstructorIsMutable(); constructor_.add(index, builderForValue.build()); @@ -10580,9 +10582,9 @@ public Builder addConstructor( * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; */ public Builder addAllConstructor( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureConstructorIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, constructor_); return this; @@ -10606,11 +10608,11 @@ public Builder removeConstructor(int index) { return this; } - private java.util.List function_ = + private java.util.List function_ = java.util.Collections.emptyList(); private void ensureFunctionIsMutable() { if (!((bitField0_ & 0x00000100) == 0x00000100)) { - function_ = new java.util.ArrayList(function_); + function_ = new java.util.ArrayList(function_); bitField0_ |= 0x00000100; } } @@ -10618,7 +10620,7 @@ private void ensureFunctionIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - public java.util.List getFunctionList() { + public java.util.List getFunctionList() { return java.util.Collections.unmodifiableList(function_); } /** @@ -10630,14 +10632,14 @@ public int getFunctionCount() { /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Function getFunction(int index) { + public ProtoBuf.Function getFunction(int index) { return function_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ public Builder setFunction( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + int index, ProtoBuf.Function value) { if (value == null) { throw new NullPointerException(); } @@ -10650,7 +10652,7 @@ public Builder setFunction( * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ public Builder setFunction( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + int index, ProtoBuf.Function.Builder builderForValue) { ensureFunctionIsMutable(); function_.set(index, builderForValue.build()); @@ -10659,7 +10661,7 @@ public Builder setFunction( /** * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ - public Builder addFunction(org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + public Builder addFunction(ProtoBuf.Function value) { if (value == null) { throw new NullPointerException(); } @@ -10672,7 +10674,7 @@ public Builder addFunction(org.jetbrains.kotlin.metadata.ProtoBuf.Function value * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ public Builder addFunction( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function value) { + int index, ProtoBuf.Function value) { if (value == null) { throw new NullPointerException(); } @@ -10685,7 +10687,7 @@ public Builder addFunction( * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ public Builder addFunction( - org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + ProtoBuf.Function.Builder builderForValue) { ensureFunctionIsMutable(); function_.add(builderForValue.build()); @@ -10695,7 +10697,7 @@ public Builder addFunction( * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ public Builder addFunction( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Function.Builder builderForValue) { + int index, ProtoBuf.Function.Builder builderForValue) { ensureFunctionIsMutable(); function_.add(index, builderForValue.build()); @@ -10705,9 +10707,9 @@ public Builder addFunction( * repeated .org.jetbrains.kotlin.metadata.Function function = 9; */ public Builder addAllFunction( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureFunctionIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, function_); return this; @@ -10731,11 +10733,11 @@ public Builder removeFunction(int index) { return this; } - private java.util.List property_ = + private java.util.List property_ = java.util.Collections.emptyList(); private void ensurePropertyIsMutable() { if (!((bitField0_ & 0x00000200) == 0x00000200)) { - property_ = new java.util.ArrayList(property_); + property_ = new java.util.ArrayList(property_); bitField0_ |= 0x00000200; } } @@ -10743,7 +10745,7 @@ private void ensurePropertyIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - public java.util.List getPropertyList() { + public java.util.List getPropertyList() { return java.util.Collections.unmodifiableList(property_); } /** @@ -10755,14 +10757,14 @@ public int getPropertyCount() { /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Property getProperty(int index) { + public ProtoBuf.Property getProperty(int index) { return property_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ public Builder setProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + int index, ProtoBuf.Property value) { if (value == null) { throw new NullPointerException(); } @@ -10775,7 +10777,7 @@ public Builder setProperty( * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ public Builder setProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + int index, ProtoBuf.Property.Builder builderForValue) { ensurePropertyIsMutable(); property_.set(index, builderForValue.build()); @@ -10784,7 +10786,7 @@ public Builder setProperty( /** * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ - public Builder addProperty(org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + public Builder addProperty(ProtoBuf.Property value) { if (value == null) { throw new NullPointerException(); } @@ -10797,7 +10799,7 @@ public Builder addProperty(org.jetbrains.kotlin.metadata.ProtoBuf.Property value * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ public Builder addProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property value) { + int index, ProtoBuf.Property value) { if (value == null) { throw new NullPointerException(); } @@ -10810,7 +10812,7 @@ public Builder addProperty( * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ public Builder addProperty( - org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + ProtoBuf.Property.Builder builderForValue) { ensurePropertyIsMutable(); property_.add(builderForValue.build()); @@ -10820,7 +10822,7 @@ public Builder addProperty( * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ public Builder addProperty( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Property.Builder builderForValue) { + int index, ProtoBuf.Property.Builder builderForValue) { ensurePropertyIsMutable(); property_.add(index, builderForValue.build()); @@ -10830,9 +10832,9 @@ public Builder addProperty( * repeated .org.jetbrains.kotlin.metadata.Property property = 10; */ public Builder addAllProperty( - java.lang.Iterable values) { + java.lang.Iterable values) { ensurePropertyIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, property_); return this; @@ -10856,11 +10858,11 @@ public Builder removeProperty(int index) { return this; } - private java.util.List typeAlias_ = + private java.util.List typeAlias_ = java.util.Collections.emptyList(); private void ensureTypeAliasIsMutable() { if (!((bitField0_ & 0x00000400) == 0x00000400)) { - typeAlias_ = new java.util.ArrayList(typeAlias_); + typeAlias_ = new java.util.ArrayList(typeAlias_); bitField0_ |= 0x00000400; } } @@ -10868,7 +10870,7 @@ private void ensureTypeAliasIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - public java.util.List getTypeAliasList() { + public java.util.List getTypeAliasList() { return java.util.Collections.unmodifiableList(typeAlias_); } /** @@ -10880,14 +10882,14 @@ public int getTypeAliasCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getTypeAlias(int index) { + public ProtoBuf.TypeAlias getTypeAlias(int index) { return typeAlias_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ public Builder setTypeAlias( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + int index, ProtoBuf.TypeAlias value) { if (value == null) { throw new NullPointerException(); } @@ -10900,7 +10902,7 @@ public Builder setTypeAlias( * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ public Builder setTypeAlias( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + int index, ProtoBuf.TypeAlias.Builder builderForValue) { ensureTypeAliasIsMutable(); typeAlias_.set(index, builderForValue.build()); @@ -10909,7 +10911,7 @@ public Builder setTypeAlias( /** * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ - public Builder addTypeAlias(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + public Builder addTypeAlias(ProtoBuf.TypeAlias value) { if (value == null) { throw new NullPointerException(); } @@ -10922,7 +10924,7 @@ public Builder addTypeAlias(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias val * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ public Builder addTypeAlias( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias value) { + int index, ProtoBuf.TypeAlias value) { if (value == null) { throw new NullPointerException(); } @@ -10935,7 +10937,7 @@ public Builder addTypeAlias( * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ public Builder addTypeAlias( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + ProtoBuf.TypeAlias.Builder builderForValue) { ensureTypeAliasIsMutable(); typeAlias_.add(builderForValue.build()); @@ -10945,7 +10947,7 @@ public Builder addTypeAlias( * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ public Builder addTypeAlias( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.Builder builderForValue) { + int index, ProtoBuf.TypeAlias.Builder builderForValue) { ensureTypeAliasIsMutable(); typeAlias_.add(index, builderForValue.build()); @@ -10955,9 +10957,9 @@ public Builder addTypeAlias( * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; */ public Builder addAllTypeAlias( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureTypeAliasIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, typeAlias_); return this; @@ -10981,11 +10983,11 @@ public Builder removeTypeAlias(int index) { return this; } - private java.util.List enumEntry_ = + private java.util.List enumEntry_ = java.util.Collections.emptyList(); private void ensureEnumEntryIsMutable() { if (!((bitField0_ & 0x00000800) == 0x00000800)) { - enumEntry_ = new java.util.ArrayList(enumEntry_); + enumEntry_ = new java.util.ArrayList(enumEntry_); bitField0_ |= 0x00000800; } } @@ -10993,7 +10995,7 @@ private void ensureEnumEntryIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - public java.util.List getEnumEntryList() { + public java.util.List getEnumEntryList() { return java.util.Collections.unmodifiableList(enumEntry_); } /** @@ -11005,14 +11007,14 @@ public int getEnumEntryCount() { /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getEnumEntry(int index) { + public ProtoBuf.EnumEntry getEnumEntry(int index) { return enumEntry_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ public Builder setEnumEntry( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry value) { + int index, ProtoBuf.EnumEntry value) { if (value == null) { throw new NullPointerException(); } @@ -11025,7 +11027,7 @@ public Builder setEnumEntry( * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ public Builder setEnumEntry( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.Builder builderForValue) { + int index, ProtoBuf.EnumEntry.Builder builderForValue) { ensureEnumEntryIsMutable(); enumEntry_.set(index, builderForValue.build()); @@ -11034,7 +11036,7 @@ public Builder setEnumEntry( /** * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ - public Builder addEnumEntry(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry value) { + public Builder addEnumEntry(ProtoBuf.EnumEntry value) { if (value == null) { throw new NullPointerException(); } @@ -11047,7 +11049,7 @@ public Builder addEnumEntry(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry val * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ public Builder addEnumEntry( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry value) { + int index, ProtoBuf.EnumEntry value) { if (value == null) { throw new NullPointerException(); } @@ -11060,7 +11062,7 @@ public Builder addEnumEntry( * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ public Builder addEnumEntry( - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.Builder builderForValue) { + ProtoBuf.EnumEntry.Builder builderForValue) { ensureEnumEntryIsMutable(); enumEntry_.add(builderForValue.build()); @@ -11070,7 +11072,7 @@ public Builder addEnumEntry( * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ public Builder addEnumEntry( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.Builder builderForValue) { + int index, ProtoBuf.EnumEntry.Builder builderForValue) { ensureEnumEntryIsMutable(); enumEntry_.add(index, builderForValue.build()); @@ -11080,9 +11082,9 @@ public Builder addEnumEntry( * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; */ public Builder addAllEnumEntry( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureEnumEntryIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, enumEntry_); return this; @@ -11157,7 +11159,7 @@ public Builder addSealedSubclassFqName(int value) { public Builder addAllSealedSubclassFqName( java.lang.Iterable values) { ensureSealedSubclassFqNameIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, sealedSubclassFqName_); return this; @@ -11204,7 +11206,7 @@ public Builder clearInlineClassUnderlyingPropertyName() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type inlineClassUnderlyingType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ @@ -11214,13 +11216,13 @@ public boolean hasInlineClassUnderlyingType() { /** * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getInlineClassUnderlyingType() { + public ProtoBuf.Type getInlineClassUnderlyingType() { return inlineClassUnderlyingType_; } /** * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ - public Builder setInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setInlineClassUnderlyingType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -11233,7 +11235,7 @@ public Builder setInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.ProtoB * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ public Builder setInlineClassUnderlyingType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { inlineClassUnderlyingType_ = builderForValue.build(); bitField0_ |= 0x00004000; @@ -11242,11 +11244,11 @@ public Builder setInlineClassUnderlyingType( /** * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ - public Builder mergeInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeInlineClassUnderlyingType(ProtoBuf.Type value) { if (((bitField0_ & 0x00004000) == 0x00004000) && - inlineClassUnderlyingType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + inlineClassUnderlyingType_ != ProtoBuf.Type.getDefaultInstance()) { inlineClassUnderlyingType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(inlineClassUnderlyingType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(inlineClassUnderlyingType_).mergeFrom(value).buildPartial(); } else { inlineClassUnderlyingType_ = value; } @@ -11258,7 +11260,7 @@ public Builder mergeInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.Prot * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; */ public Builder clearInlineClassUnderlyingType() { - inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + inlineClassUnderlyingType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00004000); return this; @@ -11296,7 +11298,7 @@ public Builder clearInlineClassUnderlyingTypeId() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + private ProtoBuf.TypeTable typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ @@ -11306,13 +11308,13 @@ public boolean hasTypeTable() { /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + public ProtoBuf.TypeTable getTypeTable() { return typeTable_; } /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + public Builder setTypeTable(ProtoBuf.TypeTable value) { if (value == null) { throw new NullPointerException(); } @@ -11325,7 +11327,7 @@ public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable val * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public Builder setTypeTable( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { + ProtoBuf.TypeTable.Builder builderForValue) { typeTable_ = builderForValue.build(); bitField0_ |= 0x00010000; @@ -11334,11 +11336,11 @@ public Builder setTypeTable( /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + public Builder mergeTypeTable(ProtoBuf.TypeTable value) { if (((bitField0_ & 0x00010000) == 0x00010000) && - typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { + typeTable_ != ProtoBuf.TypeTable.getDefaultInstance()) { typeTable_ = - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); + ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); } else { typeTable_ = value; } @@ -11350,7 +11352,7 @@ public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable v * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public Builder clearTypeTable() { - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00010000); return this; @@ -11431,7 +11433,7 @@ public Builder addVersionRequirement(int value) { public Builder addAllVersionRequirement( java.lang.Iterable values) { ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, versionRequirement_); return this; @@ -11450,7 +11452,7 @@ public Builder clearVersionRequirement() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + private ProtoBuf.VersionRequirementTable versionRequirementTable_ = ProtoBuf.VersionRequirementTable.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ @@ -11460,13 +11462,13 @@ public boolean hasVersionRequirementTable() { /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getVersionRequirementTable() { + public ProtoBuf.VersionRequirementTable getVersionRequirementTable() { return versionRequirementTable_; } /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ - public Builder setVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { + public Builder setVersionRequirementTable(ProtoBuf.VersionRequirementTable value) { if (value == null) { throw new NullPointerException(); } @@ -11479,7 +11481,7 @@ public Builder setVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ public Builder setVersionRequirementTable( - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.Builder builderForValue) { + ProtoBuf.VersionRequirementTable.Builder builderForValue) { versionRequirementTable_ = builderForValue.build(); bitField0_ |= 0x00040000; @@ -11488,11 +11490,11 @@ public Builder setVersionRequirementTable( /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ - public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable value) { + public Builder mergeVersionRequirementTable(ProtoBuf.VersionRequirementTable value) { if (((bitField0_ & 0x00040000) == 0x00040000) && - versionRequirementTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) { + versionRequirementTable_ != ProtoBuf.VersionRequirementTable.getDefaultInstance()) { versionRequirementTable_ = - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial(); + ProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial(); } else { versionRequirementTable_ = value; } @@ -11504,7 +11506,7 @@ public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.ProtoB * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; */ public Builder clearVersionRequirementTable() { - versionRequirementTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + versionRequirementTable_ = ProtoBuf.VersionRequirementTable.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00040000); return this; @@ -11523,17 +11525,17 @@ public Builder clearVersionRequirementTable() { public interface TypeTableOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeTable) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - java.util.List + java.util.List getTypeList(); /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index); + ProtoBuf.Type getType(int index); /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ @@ -11562,16 +11564,16 @@ public interface TypeTableOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} */ public static final class TypeTable extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeTable) TypeTableOrBuilder { // Use TypeTable.newBuilder() to construct. - private TypeTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private TypeTable(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private TypeTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private TypeTable(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final TypeTable defaultInstance; public static TypeTable getDefaultInstance() { @@ -11582,17 +11584,17 @@ public TypeTable getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private TypeTable( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -11611,10 +11613,10 @@ private TypeTable( } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - type_ = new java.util.ArrayList(); + type_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - type_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry)); + type_.add(input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry)); break; } case 16: { @@ -11624,10 +11626,10 @@ private TypeTable( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { @@ -11643,34 +11645,34 @@ private TypeTable( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public TypeTable parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new TypeTable(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } private int bitField0_; public static final int TYPE_FIELD_NUMBER = 1; - private java.util.List type_; + private java.util.List type_; /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public java.util.List getTypeList() { + public java.util.List getTypeList() { return type_; } /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public java.util.List + public java.util.List getTypeOrBuilderList() { return type_; } @@ -11683,13 +11685,13 @@ public int getTypeCount() { /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index) { + public ProtoBuf.Type getType(int index) { return type_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeOrBuilder getTypeOrBuilder( + public ProtoBuf.TypeOrBuilder getTypeOrBuilder( int index) { return type_.get(index); } @@ -11739,7 +11741,7 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < type_.size(); i++) { @@ -11758,11 +11760,11 @@ public int getSerializedSize() { size = 0; for (int i = 0; i < type_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(1, type_.get(i)); } if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, firstNullable_); } size += unknownFields.size(); @@ -11777,62 +11779,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeTable parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeTable parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeTable parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + public static ProtoBuf.TypeTable parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom(java.io.InputStream input) + public static ProtoBuf.TypeTable parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( + public static ProtoBuf.TypeTable parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.TypeTable parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseDelimitedFrom( + public static ProtoBuf.TypeTable parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.TypeTable parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.TypeTable parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.TypeTable prototype) { + public static Builder newBuilder(ProtoBuf.TypeTable prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -11841,12 +11843,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTabl * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.TypeTable, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeTable) - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTableOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder() + ProtoBuf.TypeTableOrBuilder { + // Construct using ProtoBuf.TypeTable.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -11870,20 +11872,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + public ProtoBuf.TypeTable getDefaultInstanceForType() { + return ProtoBuf.TypeTable.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable build() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable result = buildPartial(); + public ProtoBuf.TypeTable build() { + ProtoBuf.TypeTable result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable(this); + public ProtoBuf.TypeTable buildPartial() { + ProtoBuf.TypeTable result = new ProtoBuf.TypeTable(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -11899,8 +11901,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.TypeTable other) { + if (other == ProtoBuf.TypeTable.getDefaultInstance()) return this; if (!other.type_.isEmpty()) { if (type_.isEmpty()) { type_ = other.type_; @@ -11930,14 +11932,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable parsedMessage = null; + ProtoBuf.TypeTable parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.TypeTable) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -11948,11 +11950,11 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List type_ = + private java.util.List type_ = java.util.Collections.emptyList(); private void ensureTypeIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { - type_ = new java.util.ArrayList(type_); + type_ = new java.util.ArrayList(type_); bitField0_ |= 0x00000001; } } @@ -11960,7 +11962,7 @@ private void ensureTypeIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public java.util.List getTypeList() { + public java.util.List getTypeList() { return java.util.Collections.unmodifiableList(type_); } /** @@ -11972,14 +11974,14 @@ public int getTypeCount() { /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(int index) { + public ProtoBuf.Type getType(int index) { return type_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ public Builder setType( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + int index, ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -11992,7 +11994,7 @@ public Builder setType( * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ public Builder setType( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + int index, ProtoBuf.Type.Builder builderForValue) { ensureTypeIsMutable(); type_.set(index, builderForValue.build()); @@ -12001,7 +12003,7 @@ public Builder setType( /** * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ - public Builder addType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder addType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -12014,7 +12016,7 @@ public Builder addType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ public Builder addType( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + int index, ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -12027,7 +12029,7 @@ public Builder addType( * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ public Builder addType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { ensureTypeIsMutable(); type_.add(builderForValue.build()); @@ -12037,7 +12039,7 @@ public Builder addType( * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ public Builder addType( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + int index, ProtoBuf.Type.Builder builderForValue) { ensureTypeIsMutable(); type_.add(index, builderForValue.build()); @@ -12047,9 +12049,9 @@ public Builder addType( * repeated .org.jetbrains.kotlin.metadata.Type type = 1; */ public Builder addAllType( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureTypeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, type_); return this; @@ -12138,7 +12140,7 @@ public Builder clearFirstNullable() { public interface ConstructorOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Constructor) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** @@ -12167,12 +12169,12 @@ public interface ConstructorOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - java.util.List + java.util.List getValueParameterList(); /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index); + ProtoBuf.ValueParameter getValueParameter(int index); /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ @@ -12207,17 +12209,17 @@ public interface ConstructorOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} */ public static final class Constructor extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< Constructor> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Constructor) ConstructorOrBuilder { // Use Constructor.newBuilder() to construct. - private Constructor(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private Constructor(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Constructor(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Constructor(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Constructor defaultInstance; public static Constructor getDefaultInstance() { @@ -12228,17 +12230,17 @@ public Constructor getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Constructor( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -12262,10 +12264,10 @@ private Constructor( } case 18: { if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - valueParameter_ = new java.util.ArrayList(); + valueParameter_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000002; } - valueParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry)); + valueParameter_.add(input.readMessage(ProtoBuf.ValueParameter.PARSER, extensionRegistry)); break; } case 248: { @@ -12291,10 +12293,10 @@ private Constructor( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { @@ -12313,18 +12315,18 @@ private Constructor( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Constructor parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Constructor(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -12359,17 +12361,17 @@ public int getFlags() { } public static final int VALUE_PARAMETER_FIELD_NUMBER = 2; - private java.util.List valueParameter_; + private java.util.List valueParameter_; /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public java.util.List getValueParameterList() { + public java.util.List getValueParameterList() { return valueParameter_; } /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public java.util.List + public java.util.List getValueParameterOrBuilderList() { return valueParameter_; } @@ -12382,13 +12384,13 @@ public int getValueParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + public ProtoBuf.ValueParameter getValueParameter(int index) { return valueParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( + public ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( int index) { return valueParameter_.get(index); } @@ -12452,11 +12454,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, flags_); @@ -12478,17 +12480,17 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, flags_); } for (int i = 0; i < valueParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(2, valueParameter_.get(i)); } { int dataSize = 0; for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(versionRequirement_.get(i)); } size += dataSize; @@ -12507,62 +12509,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Constructor parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Constructor parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Constructor parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( + public static ProtoBuf.Constructor parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom(java.io.InputStream input) + public static ProtoBuf.Constructor parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( + public static ProtoBuf.Constructor parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Constructor parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseDelimitedFrom( + public static ProtoBuf.Constructor parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Constructor parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Constructor parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Constructor prototype) { + public static Builder newBuilder(ProtoBuf.Constructor prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -12571,11 +12573,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Construc * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.Constructor, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.Constructor, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Constructor) - org.jetbrains.kotlin.metadata.ProtoBuf.ConstructorOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.newBuilder() + ProtoBuf.ConstructorOrBuilder { + // Construct using ProtoBuf.Constructor.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -12601,20 +12603,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance(); + public ProtoBuf.Constructor getDefaultInstanceForType() { + return ProtoBuf.Constructor.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Constructor result = buildPartial(); + public ProtoBuf.Constructor build() { + ProtoBuf.Constructor result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Constructor result = new org.jetbrains.kotlin.metadata.ProtoBuf.Constructor(this); + public ProtoBuf.Constructor buildPartial() { + ProtoBuf.Constructor result = new ProtoBuf.Constructor(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -12635,8 +12637,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Constructor buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Constructor other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Constructor.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Constructor other) { + if (other == ProtoBuf.Constructor.getDefaultInstance()) return this; if (other.hasFlags()) { setFlags(other.getFlags()); } @@ -12681,14 +12683,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Constructor parsedMessage = null; + ProtoBuf.Constructor parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Constructor) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Constructor) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -12759,11 +12761,11 @@ public Builder clearFlags() { return this; } - private java.util.List valueParameter_ = + private java.util.List valueParameter_ = java.util.Collections.emptyList(); private void ensureValueParameterIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { - valueParameter_ = new java.util.ArrayList(valueParameter_); + valueParameter_ = new java.util.ArrayList(valueParameter_); bitField0_ |= 0x00000002; } } @@ -12771,7 +12773,7 @@ private void ensureValueParameterIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public java.util.List getValueParameterList() { + public java.util.List getValueParameterList() { return java.util.Collections.unmodifiableList(valueParameter_); } /** @@ -12783,14 +12785,14 @@ public int getValueParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + public ProtoBuf.ValueParameter getValueParameter(int index) { return valueParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ public Builder setValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + int index, ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } @@ -12803,7 +12805,7 @@ public Builder setValueParameter( * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ public Builder setValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + int index, ProtoBuf.ValueParameter.Builder builderForValue) { ensureValueParameterIsMutable(); valueParameter_.set(index, builderForValue.build()); @@ -12812,7 +12814,7 @@ public Builder setValueParameter( /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ - public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + public Builder addValueParameter(ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } @@ -12825,7 +12827,7 @@ public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValuePar * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ public Builder addValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + int index, ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } @@ -12838,7 +12840,7 @@ public Builder addValueParameter( * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ public Builder addValueParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ProtoBuf.ValueParameter.Builder builderForValue) { ensureValueParameterIsMutable(); valueParameter_.add(builderForValue.build()); @@ -12848,7 +12850,7 @@ public Builder addValueParameter( * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ public Builder addValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + int index, ProtoBuf.ValueParameter.Builder builderForValue) { ensureValueParameterIsMutable(); valueParameter_.add(index, builderForValue.build()); @@ -12858,9 +12860,9 @@ public Builder addValueParameter( * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; */ public Builder addAllValueParameter( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureValueParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, valueParameter_); return this; @@ -12959,7 +12961,7 @@ public Builder addVersionRequirement(int value) { public Builder addAllVersionRequirement( java.lang.Iterable values) { ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, versionRequirement_); return this; @@ -12991,7 +12993,7 @@ public Builder clearVersionRequirement() { public interface FunctionOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Function) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** @@ -13058,7 +13060,7 @@ public interface FunctionOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType(); + ProtoBuf.Type getReturnType(); /** * optional int32 return_type_id = 7; @@ -13072,12 +13074,12 @@ public interface FunctionOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - java.util.List + java.util.List getTypeParameterList(); /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + ProtoBuf.TypeParameter getTypeParameter(int index); /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ @@ -13090,7 +13092,7 @@ public interface FunctionOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType(); + ProtoBuf.Type getReceiverType(); /** * optional int32 receiver_type_id = 8; @@ -13104,12 +13106,12 @@ public interface FunctionOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - java.util.List + java.util.List getValueParameterList(); /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index); + ProtoBuf.ValueParameter getValueParameter(int index); /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ @@ -13122,7 +13124,7 @@ public interface FunctionOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable(); + ProtoBuf.TypeTable getTypeTable(); /** * repeated int32 version_requirement = 31; @@ -13156,23 +13158,23 @@ public interface FunctionOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract(); + ProtoBuf.Contract getContract(); } /** * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} */ public static final class Function extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< Function> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Function) FunctionOrBuilder { // Use Function.newBuilder() to construct. - private Function(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private Function(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Function(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Function(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Function defaultInstance; public static Function getDefaultInstance() { @@ -13183,17 +13185,17 @@ public Function getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Function( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -13221,11 +13223,11 @@ private Function( break; } case 26: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000008) == 0x00000008)) { subBuilder = returnType_.toBuilder(); } - returnType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + returnType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(returnType_); returnType_ = subBuilder.buildPartial(); @@ -13235,18 +13237,18 @@ private Function( } case 34: { if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(); + typeParameter_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000020; } - typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + typeParameter_.add(input.readMessage(ProtoBuf.TypeParameter.PARSER, extensionRegistry)); break; } case 42: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000020) == 0x00000020)) { subBuilder = receiverType_.toBuilder(); } - receiverType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + receiverType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(receiverType_); receiverType_ = subBuilder.buildPartial(); @@ -13256,10 +13258,10 @@ private Function( } case 50: { if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = new java.util.ArrayList(); + valueParameter_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000100; } - valueParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry)); + valueParameter_.add(input.readMessage(ProtoBuf.ValueParameter.PARSER, extensionRegistry)); break; } case 56: { @@ -13278,11 +13280,11 @@ private Function( break; } case 242: { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder subBuilder = null; + ProtoBuf.TypeTable.Builder subBuilder = null; if (((bitField0_ & 0x00000080) == 0x00000080)) { subBuilder = typeTable_.toBuilder(); } - typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.PARSER, extensionRegistry); + typeTable_ = input.readMessage(ProtoBuf.TypeTable.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(typeTable_); typeTable_ = subBuilder.buildPartial(); @@ -13312,11 +13314,11 @@ private Function( break; } case 258: { - org.jetbrains.kotlin.metadata.ProtoBuf.Contract.Builder subBuilder = null; + ProtoBuf.Contract.Builder subBuilder = null; if (((bitField0_ & 0x00000100) == 0x00000100)) { subBuilder = contract_.toBuilder(); } - contract_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Contract.PARSER, extensionRegistry); + contract_ = input.readMessage(ProtoBuf.Contract.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(contract_); contract_ = subBuilder.buildPartial(); @@ -13326,10 +13328,10 @@ private Function( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { @@ -13351,18 +13353,18 @@ private Function( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Function parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Function(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -13443,7 +13445,7 @@ public int getName() { } public static final int RETURN_TYPE_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_; + private ProtoBuf.Type returnType_; /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ @@ -13453,7 +13455,7 @@ public boolean hasReturnType() { /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + public ProtoBuf.Type getReturnType() { return returnType_; } @@ -13473,17 +13475,17 @@ public int getReturnTypeId() { } public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; - private java.util.List typeParameter_; + private java.util.List typeParameter_; /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public java.util.List getTypeParameterList() { + public java.util.List getTypeParameterList() { return typeParameter_; } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public java.util.List + public java.util.List getTypeParameterOrBuilderList() { return typeParameter_; } @@ -13496,19 +13498,19 @@ public int getTypeParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + public ProtoBuf.TypeParameter getTypeParameter(int index) { return typeParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + public ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( int index) { return typeParameter_.get(index); } public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_; + private ProtoBuf.Type receiverType_; /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ @@ -13518,7 +13520,7 @@ public boolean hasReceiverType() { /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + public ProtoBuf.Type getReceiverType() { return receiverType_; } @@ -13538,17 +13540,17 @@ public int getReceiverTypeId() { } public static final int VALUE_PARAMETER_FIELD_NUMBER = 6; - private java.util.List valueParameter_; + private java.util.List valueParameter_; /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public java.util.List getValueParameterList() { + public java.util.List getValueParameterList() { return valueParameter_; } /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public java.util.List + public java.util.List getValueParameterOrBuilderList() { return valueParameter_; } @@ -13561,19 +13563,19 @@ public int getValueParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + public ProtoBuf.ValueParameter getValueParameter(int index) { return valueParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( + public ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( int index) { return valueParameter_.get(index); } public static final int TYPE_TABLE_FIELD_NUMBER = 30; - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_; + private ProtoBuf.TypeTable typeTable_; /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ @@ -13583,7 +13585,7 @@ public boolean hasTypeTable() { /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + public ProtoBuf.TypeTable getTypeTable() { return typeTable_; } @@ -13622,7 +13624,7 @@ public int getVersionRequirement(int index) { } public static final int CONTRACT_FIELD_NUMBER = 32; - private org.jetbrains.kotlin.metadata.ProtoBuf.Contract contract_; + private ProtoBuf.Contract contract_; /** * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ @@ -13632,7 +13634,7 @@ public boolean hasContract() { /** * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract() { + public ProtoBuf.Contract getContract() { return contract_; } @@ -13640,15 +13642,15 @@ private void initFields() { flags_ = 6; oldFlags_ = 6; name_ = 0; - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnType_ = ProtoBuf.Type.getDefaultInstance(); returnTypeId_ = 0; typeParameter_ = java.util.Collections.emptyList(); - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverType_ = ProtoBuf.Type.getDefaultInstance(); receiverTypeId_ = 0; valueParameter_ = java.util.Collections.emptyList(); - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); versionRequirement_ = java.util.Collections.emptyList(); - contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + contract_ = ProtoBuf.Contract.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -13704,11 +13706,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt32(1, oldFlags_); @@ -13757,56 +13759,56 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, oldFlags_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, name_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(3, returnType_); } for (int i = 0; i < typeParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(4, typeParameter_.get(i)); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(5, receiverType_); } for (int i = 0; i < valueParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(6, valueParameter_.get(i)); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(7, returnTypeId_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(8, receiverTypeId_); } if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(9, flags_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(30, typeTable_); } { int dataSize = 0; for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(versionRequirement_.get(i)); } size += dataSize; size += 2 * getVersionRequirementList().size(); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(32, contract_); } size += extensionsSerializedSize(); @@ -13822,62 +13824,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Function parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Function parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Function parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( + public static ProtoBuf.Function parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom(java.io.InputStream input) + public static ProtoBuf.Function parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( + public static ProtoBuf.Function parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Function parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseDelimitedFrom( + public static ProtoBuf.Function parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Function parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Function parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Function parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Function prototype) { + public static Builder newBuilder(ProtoBuf.Function prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -13886,11 +13888,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Function * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.Function, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.Function, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Function) - org.jetbrains.kotlin.metadata.ProtoBuf.FunctionOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Function.newBuilder() + ProtoBuf.FunctionOrBuilder { + // Construct using ProtoBuf.Function.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -13909,23 +13911,23 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000002); name_ = 0; bitField0_ = (bitField0_ & ~0x00000004); - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); returnTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000010); typeParameter_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000040); receiverTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000080); valueParameter_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000100); - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000200); versionRequirement_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000400); - contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + contract_ = ProtoBuf.Contract.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000800); return this; } @@ -13934,20 +13936,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Function getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance(); + public ProtoBuf.Function getDefaultInstanceForType() { + return ProtoBuf.Function.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Function build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Function result = buildPartial(); + public ProtoBuf.Function build() { + ProtoBuf.Function result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Function buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Function result = new org.jetbrains.kotlin.metadata.ProtoBuf.Function(this); + public ProtoBuf.Function buildPartial() { + ProtoBuf.Function result = new ProtoBuf.Function(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -14005,8 +14007,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Function buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Function other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Function other) { + if (other == ProtoBuf.Function.getDefaultInstance()) return this; if (other.hasFlags()) { setFlags(other.getFlags()); } @@ -14119,14 +14121,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Function parsedMessage = null; + ProtoBuf.Function parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Function) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Function) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -14293,7 +14295,7 @@ public Builder clearName() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type returnType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ @@ -14303,13 +14305,13 @@ public boolean hasReturnType() { /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + public ProtoBuf.Type getReturnType() { return returnType_; } /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setReturnType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -14322,7 +14324,7 @@ public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ public Builder setReturnType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { returnType_ = builderForValue.build(); bitField0_ |= 0x00000008; @@ -14331,11 +14333,11 @@ public Builder setReturnType( /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeReturnType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000008) == 0x00000008) && - returnType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + returnType_ != ProtoBuf.Type.getDefaultInstance()) { returnType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); } else { returnType_ = value; } @@ -14347,7 +14349,7 @@ public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ public Builder clearReturnType() { - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); return this; @@ -14385,11 +14387,11 @@ public Builder clearReturnTypeId() { return this; } - private java.util.List typeParameter_ = + private java.util.List typeParameter_ = java.util.Collections.emptyList(); private void ensureTypeParameterIsMutable() { if (!((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); + typeParameter_ = new java.util.ArrayList(typeParameter_); bitField0_ |= 0x00000020; } } @@ -14397,7 +14399,7 @@ private void ensureTypeParameterIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public java.util.List getTypeParameterList() { + public java.util.List getTypeParameterList() { return java.util.Collections.unmodifiableList(typeParameter_); } /** @@ -14409,14 +14411,14 @@ public int getTypeParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + public ProtoBuf.TypeParameter getTypeParameter(int index) { return typeParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + int index, ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -14429,7 +14431,7 @@ public Builder setTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + int index, ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.set(index, builderForValue.build()); @@ -14438,7 +14440,7 @@ public Builder setTypeParameter( /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + public Builder addTypeParameter(ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -14451,7 +14453,7 @@ public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParam * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + int index, ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -14464,7 +14466,7 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder addTypeParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.add(builderForValue.build()); @@ -14474,7 +14476,7 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + int index, ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.add(index, builderForValue.build()); @@ -14484,9 +14486,9 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder addAllTypeParameter( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureTypeParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, typeParameter_); return this; @@ -14510,7 +14512,7 @@ public Builder removeTypeParameter(int index) { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type receiverType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ @@ -14520,13 +14522,13 @@ public boolean hasReceiverType() { /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + public ProtoBuf.Type getReceiverType() { return receiverType_; } /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setReceiverType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -14539,7 +14541,7 @@ public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ public Builder setReceiverType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { receiverType_ = builderForValue.build(); bitField0_ |= 0x00000040; @@ -14548,11 +14550,11 @@ public Builder setReceiverType( /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeReceiverType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000040) == 0x00000040) && - receiverType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + receiverType_ != ProtoBuf.Type.getDefaultInstance()) { receiverType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); } else { receiverType_ = value; } @@ -14564,7 +14566,7 @@ public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type val * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ public Builder clearReceiverType() { - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000040); return this; @@ -14602,11 +14604,11 @@ public Builder clearReceiverTypeId() { return this; } - private java.util.List valueParameter_ = + private java.util.List valueParameter_ = java.util.Collections.emptyList(); private void ensureValueParameterIsMutable() { if (!((bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = new java.util.ArrayList(valueParameter_); + valueParameter_ = new java.util.ArrayList(valueParameter_); bitField0_ |= 0x00000100; } } @@ -14614,7 +14616,7 @@ private void ensureValueParameterIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public java.util.List getValueParameterList() { + public java.util.List getValueParameterList() { return java.util.Collections.unmodifiableList(valueParameter_); } /** @@ -14626,14 +14628,14 @@ public int getValueParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getValueParameter(int index) { + public ProtoBuf.ValueParameter getValueParameter(int index) { return valueParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public Builder setValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + int index, ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } @@ -14646,7 +14648,7 @@ public Builder setValueParameter( * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public Builder setValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + int index, ProtoBuf.ValueParameter.Builder builderForValue) { ensureValueParameterIsMutable(); valueParameter_.set(index, builderForValue.build()); @@ -14655,7 +14657,7 @@ public Builder setValueParameter( /** * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ - public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + public Builder addValueParameter(ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } @@ -14668,7 +14670,7 @@ public Builder addValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValuePar * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public Builder addValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + int index, ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } @@ -14681,7 +14683,7 @@ public Builder addValueParameter( * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public Builder addValueParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ProtoBuf.ValueParameter.Builder builderForValue) { ensureValueParameterIsMutable(); valueParameter_.add(builderForValue.build()); @@ -14691,7 +14693,7 @@ public Builder addValueParameter( * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public Builder addValueParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + int index, ProtoBuf.ValueParameter.Builder builderForValue) { ensureValueParameterIsMutable(); valueParameter_.add(index, builderForValue.build()); @@ -14701,9 +14703,9 @@ public Builder addValueParameter( * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; */ public Builder addAllValueParameter( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureValueParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, valueParameter_); return this; @@ -14727,7 +14729,7 @@ public Builder removeValueParameter(int index) { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + private ProtoBuf.TypeTable typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ @@ -14737,13 +14739,13 @@ public boolean hasTypeTable() { /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable getTypeTable() { + public ProtoBuf.TypeTable getTypeTable() { return typeTable_; } /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + public Builder setTypeTable(ProtoBuf.TypeTable value) { if (value == null) { throw new NullPointerException(); } @@ -14756,7 +14758,7 @@ public Builder setTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable val * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public Builder setTypeTable( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.Builder builderForValue) { + ProtoBuf.TypeTable.Builder builderForValue) { typeTable_ = builderForValue.build(); bitField0_ |= 0x00000200; @@ -14765,11 +14767,11 @@ public Builder setTypeTable( /** * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ - public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable value) { + public Builder mergeTypeTable(ProtoBuf.TypeTable value) { if (((bitField0_ & 0x00000200) == 0x00000200) && - typeTable_ != org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance()) { + typeTable_ != ProtoBuf.TypeTable.getDefaultInstance()) { typeTable_ = - org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); + ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); } else { typeTable_ = value; } @@ -14781,7 +14783,7 @@ public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable v * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; */ public Builder clearTypeTable() { - typeTable_ = org.jetbrains.kotlin.metadata.ProtoBuf.TypeTable.getDefaultInstance(); + typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000200); return this; @@ -14862,7 +14864,7 @@ public Builder addVersionRequirement(int value) { public Builder addAllVersionRequirement( java.lang.Iterable values) { ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, versionRequirement_); return this; @@ -14881,7 +14883,7 @@ public Builder clearVersionRequirement() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Contract contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + private ProtoBuf.Contract contract_ = ProtoBuf.Contract.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ @@ -14891,13 +14893,13 @@ public boolean hasContract() { /** * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getContract() { + public ProtoBuf.Contract getContract() { return contract_; } /** * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ - public Builder setContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value) { + public Builder setContract(ProtoBuf.Contract value) { if (value == null) { throw new NullPointerException(); } @@ -14910,7 +14912,7 @@ public Builder setContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ public Builder setContract( - org.jetbrains.kotlin.metadata.ProtoBuf.Contract.Builder builderForValue) { + ProtoBuf.Contract.Builder builderForValue) { contract_ = builderForValue.build(); bitField0_ |= 0x00000800; @@ -14919,11 +14921,11 @@ public Builder setContract( /** * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ - public Builder mergeContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract value) { + public Builder mergeContract(ProtoBuf.Contract value) { if (((bitField0_ & 0x00000800) == 0x00000800) && - contract_ != org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance()) { + contract_ != ProtoBuf.Contract.getDefaultInstance()) { contract_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Contract.newBuilder(contract_).mergeFrom(value).buildPartial(); + ProtoBuf.Contract.newBuilder(contract_).mergeFrom(value).buildPartial(); } else { contract_ = value; } @@ -14935,7 +14937,7 @@ public Builder mergeContract(org.jetbrains.kotlin.metadata.ProtoBuf.Contract val * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; */ public Builder clearContract() { - contract_ = org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + contract_ = ProtoBuf.Contract.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000800); return this; @@ -14954,7 +14956,7 @@ public Builder clearContract() { public interface PropertyOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Property) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** @@ -15023,7 +15025,7 @@ public interface PropertyOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType(); + ProtoBuf.Type getReturnType(); /** * optional int32 return_type_id = 9; @@ -15037,12 +15039,12 @@ public interface PropertyOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - java.util.List + java.util.List getTypeParameterList(); /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + ProtoBuf.TypeParameter getTypeParameter(int index); /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ @@ -15055,7 +15057,7 @@ public interface PropertyOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType(); + ProtoBuf.Type getReceiverType(); /** * optional int32 receiver_type_id = 10; @@ -15073,7 +15075,7 @@ public interface PropertyOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter(); + ProtoBuf.ValueParameter getSetterValueParameter(); /** * optional int32 getter_flags = 7; @@ -15146,17 +15148,17 @@ public interface PropertyOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} */ public static final class Property extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< Property> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Property) PropertyOrBuilder { // Use Property.newBuilder() to construct. - private Property(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private Property(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Property(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Property(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Property defaultInstance; public static Property getDefaultInstance() { @@ -15167,17 +15169,17 @@ public Property getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Property( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -15205,11 +15207,11 @@ private Property( break; } case 26: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000008) == 0x00000008)) { subBuilder = returnType_.toBuilder(); } - returnType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + returnType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(returnType_); returnType_ = subBuilder.buildPartial(); @@ -15219,18 +15221,18 @@ private Property( } case 34: { if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(); + typeParameter_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000020; } - typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + typeParameter_.add(input.readMessage(ProtoBuf.TypeParameter.PARSER, extensionRegistry)); break; } case 42: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000020) == 0x00000020)) { subBuilder = receiverType_.toBuilder(); } - receiverType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + receiverType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(receiverType_); receiverType_ = subBuilder.buildPartial(); @@ -15239,11 +15241,11 @@ private Property( break; } case 50: { - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder subBuilder = null; + ProtoBuf.ValueParameter.Builder subBuilder = null; if (((bitField0_ & 0x00000080) == 0x00000080)) { subBuilder = setterValueParameter_.toBuilder(); } - setterValueParameter_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.PARSER, extensionRegistry); + setterValueParameter_ = input.readMessage(ProtoBuf.ValueParameter.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(setterValueParameter_); setterValueParameter_ = subBuilder.buildPartial(); @@ -15299,10 +15301,10 @@ private Property( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { @@ -15321,18 +15323,18 @@ private Property( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Property parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Property(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -15415,7 +15417,7 @@ public int getName() { } public static final int RETURN_TYPE_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_; + private ProtoBuf.Type returnType_; /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ @@ -15425,7 +15427,7 @@ public boolean hasReturnType() { /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + public ProtoBuf.Type getReturnType() { return returnType_; } @@ -15445,17 +15447,17 @@ public int getReturnTypeId() { } public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; - private java.util.List typeParameter_; + private java.util.List typeParameter_; /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public java.util.List getTypeParameterList() { + public java.util.List getTypeParameterList() { return typeParameter_; } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public java.util.List + public java.util.List getTypeParameterOrBuilderList() { return typeParameter_; } @@ -15468,19 +15470,19 @@ public int getTypeParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + public ProtoBuf.TypeParameter getTypeParameter(int index) { return typeParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + public ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( int index) { return typeParameter_.get(index); } public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_; + private ProtoBuf.Type receiverType_; /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ @@ -15490,7 +15492,7 @@ public boolean hasReceiverType() { /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + public ProtoBuf.Type getReceiverType() { return receiverType_; } @@ -15510,7 +15512,7 @@ public int getReceiverTypeId() { } public static final int SETTER_VALUE_PARAMETER_FIELD_NUMBER = 6; - private org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter setterValueParameter_; + private ProtoBuf.ValueParameter setterValueParameter_; /** * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ @@ -15520,7 +15522,7 @@ public boolean hasSetterValueParameter() { /** * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter() { + public ProtoBuf.ValueParameter getSetterValueParameter() { return setterValueParameter_; } @@ -15616,12 +15618,12 @@ private void initFields() { flags_ = 518; oldFlags_ = 2054; name_ = 0; - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnType_ = ProtoBuf.Type.getDefaultInstance(); returnTypeId_ = 0; typeParameter_ = java.util.Collections.emptyList(); - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverType_ = ProtoBuf.Type.getDefaultInstance(); receiverTypeId_ = 0; - setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + setterValueParameter_ = ProtoBuf.ValueParameter.getDefaultInstance(); getterFlags_ = 0; setterFlags_ = 0; versionRequirement_ = java.util.Collections.emptyList(); @@ -15668,11 +15670,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt32(1, oldFlags_); @@ -15721,53 +15723,53 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, oldFlags_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, name_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(3, returnType_); } for (int i = 0; i < typeParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(4, typeParameter_.get(i)); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(5, receiverType_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(6, setterValueParameter_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(7, getterFlags_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(8, setterFlags_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(9, returnTypeId_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(10, receiverTypeId_); } if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(11, flags_); } { int dataSize = 0; for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(versionRequirement_.get(i)); } size += dataSize; @@ -15786,62 +15788,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Property parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Property parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Property parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + public static ProtoBuf.Property parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom(java.io.InputStream input) + public static ProtoBuf.Property parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( + public static ProtoBuf.Property parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Property parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseDelimitedFrom( + public static ProtoBuf.Property parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Property parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Property parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Property parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Property prototype) { + public static Builder newBuilder(ProtoBuf.Property prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -15850,11 +15852,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Property * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.Property, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.Property, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Property) - org.jetbrains.kotlin.metadata.ProtoBuf.PropertyOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Property.newBuilder() + ProtoBuf.PropertyOrBuilder { + // Construct using ProtoBuf.Property.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -15873,17 +15875,17 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000002); name_ = 0; bitField0_ = (bitField0_ & ~0x00000004); - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); returnTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000010); typeParameter_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000040); receiverTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000080); - setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + setterValueParameter_ = ProtoBuf.ValueParameter.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000100); getterFlags_ = 0; bitField0_ = (bitField0_ & ~0x00000200); @@ -15898,20 +15900,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Property getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(); + public ProtoBuf.Property getDefaultInstanceForType() { + return ProtoBuf.Property.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Property build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Property result = buildPartial(); + public ProtoBuf.Property build() { + ProtoBuf.Property result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Property buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Property result = new org.jetbrains.kotlin.metadata.ProtoBuf.Property(this); + public ProtoBuf.Property buildPartial() { + ProtoBuf.Property result = new ProtoBuf.Property(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -15968,8 +15970,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Property buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Property other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Property other) { + if (other == ProtoBuf.Property.getDefaultInstance()) return this; if (other.hasFlags()) { setFlags(other.getFlags()); } @@ -16063,14 +16065,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Property parsedMessage = null; + ProtoBuf.Property parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Property) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Property) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -16241,7 +16243,7 @@ public Builder clearName() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type returnType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ @@ -16251,13 +16253,13 @@ public boolean hasReturnType() { /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReturnType() { + public ProtoBuf.Type getReturnType() { return returnType_; } /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setReturnType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -16270,7 +16272,7 @@ public Builder setReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ public Builder setReturnType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { returnType_ = builderForValue.build(); bitField0_ |= 0x00000008; @@ -16279,11 +16281,11 @@ public Builder setReturnType( /** * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ - public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeReturnType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000008) == 0x00000008) && - returnType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + returnType_ != ProtoBuf.Type.getDefaultInstance()) { returnType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); } else { returnType_ = value; } @@ -16295,7 +16297,7 @@ public Builder mergeReturnType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; */ public Builder clearReturnType() { - returnType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + returnType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); return this; @@ -16333,11 +16335,11 @@ public Builder clearReturnTypeId() { return this; } - private java.util.List typeParameter_ = + private java.util.List typeParameter_ = java.util.Collections.emptyList(); private void ensureTypeParameterIsMutable() { if (!((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); + typeParameter_ = new java.util.ArrayList(typeParameter_); bitField0_ |= 0x00000020; } } @@ -16345,7 +16347,7 @@ private void ensureTypeParameterIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public java.util.List getTypeParameterList() { + public java.util.List getTypeParameterList() { return java.util.Collections.unmodifiableList(typeParameter_); } /** @@ -16357,14 +16359,14 @@ public int getTypeParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + public ProtoBuf.TypeParameter getTypeParameter(int index) { return typeParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + int index, ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -16377,7 +16379,7 @@ public Builder setTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + int index, ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.set(index, builderForValue.build()); @@ -16386,7 +16388,7 @@ public Builder setTypeParameter( /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ - public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + public Builder addTypeParameter(ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -16399,7 +16401,7 @@ public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParam * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + int index, ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -16412,7 +16414,7 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder addTypeParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.add(builderForValue.build()); @@ -16422,7 +16424,7 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + int index, ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.add(index, builderForValue.build()); @@ -16432,9 +16434,9 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; */ public Builder addAllTypeParameter( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureTypeParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, typeParameter_); return this; @@ -16458,7 +16460,7 @@ public Builder removeTypeParameter(int index) { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type receiverType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ @@ -16468,13 +16470,13 @@ public boolean hasReceiverType() { /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getReceiverType() { + public ProtoBuf.Type getReceiverType() { return receiverType_; } /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setReceiverType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -16487,7 +16489,7 @@ public Builder setReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ public Builder setReceiverType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { receiverType_ = builderForValue.build(); bitField0_ |= 0x00000040; @@ -16496,11 +16498,11 @@ public Builder setReceiverType( /** * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ - public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeReceiverType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000040) == 0x00000040) && - receiverType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + receiverType_ != ProtoBuf.Type.getDefaultInstance()) { receiverType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); } else { receiverType_ = value; } @@ -16512,7 +16514,7 @@ public Builder mergeReceiverType(org.jetbrains.kotlin.metadata.ProtoBuf.Type val * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; */ public Builder clearReceiverType() { - receiverType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + receiverType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000040); return this; @@ -16550,7 +16552,7 @@ public Builder clearReceiverTypeId() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + private ProtoBuf.ValueParameter setterValueParameter_ = ProtoBuf.ValueParameter.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ @@ -16560,13 +16562,13 @@ public boolean hasSetterValueParameter() { /** * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getSetterValueParameter() { + public ProtoBuf.ValueParameter getSetterValueParameter() { return setterValueParameter_; } /** * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public Builder setSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + public Builder setSetterValueParameter(ProtoBuf.ValueParameter value) { if (value == null) { throw new NullPointerException(); } @@ -16579,7 +16581,7 @@ public Builder setSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.Va * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ public Builder setSetterValueParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.Builder builderForValue) { + ProtoBuf.ValueParameter.Builder builderForValue) { setterValueParameter_ = builderForValue.build(); bitField0_ |= 0x00000100; @@ -16588,11 +16590,11 @@ public Builder setSetterValueParameter( /** * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ - public Builder mergeSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter value) { + public Builder mergeSetterValueParameter(ProtoBuf.ValueParameter value) { if (((bitField0_ & 0x00000100) == 0x00000100) && - setterValueParameter_ != org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance()) { + setterValueParameter_ != ProtoBuf.ValueParameter.getDefaultInstance()) { setterValueParameter_ = - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.newBuilder(setterValueParameter_).mergeFrom(value).buildPartial(); + ProtoBuf.ValueParameter.newBuilder(setterValueParameter_).mergeFrom(value).buildPartial(); } else { setterValueParameter_ = value; } @@ -16604,7 +16606,7 @@ public Builder mergeSetterValueParameter(org.jetbrains.kotlin.metadata.ProtoBuf. * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; */ public Builder clearSetterValueParameter() { - setterValueParameter_ = org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + setterValueParameter_ = ProtoBuf.ValueParameter.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000100); return this; @@ -16797,7 +16799,7 @@ public Builder addVersionRequirement(int value) { public Builder addAllVersionRequirement( java.lang.Iterable values) { ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, versionRequirement_); return this; @@ -16829,7 +16831,7 @@ public Builder clearVersionRequirement() { public interface ValueParameterOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.ValueParameter) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** @@ -16871,7 +16873,7 @@ public interface ValueParameterOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getType(); + ProtoBuf.Type getType(); /** * optional int32 type_id = 5; @@ -16889,7 +16891,7 @@ public interface ValueParameterOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType(); + ProtoBuf.Type getVarargElementType(); /** * optional int32 vararg_element_type_id = 6; @@ -16904,17 +16906,17 @@ public interface ValueParameterOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} */ public static final class ValueParameter extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< ValueParameter> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.ValueParameter) ValueParameterOrBuilder { // Use ValueParameter.newBuilder() to construct. - private ValueParameter(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private ValueParameter(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private ValueParameter(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private ValueParameter(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final ValueParameter defaultInstance; public static ValueParameter getDefaultInstance() { @@ -16925,16 +16927,16 @@ public ValueParameter getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private ValueParameter( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -16962,11 +16964,11 @@ private ValueParameter( break; } case 26: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000004) == 0x00000004)) { subBuilder = type_.toBuilder(); } - type_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + type_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(type_); type_ = subBuilder.buildPartial(); @@ -16975,11 +16977,11 @@ private ValueParameter( break; } case 34: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000010) == 0x00000010)) { subBuilder = varargElementType_.toBuilder(); } - varargElementType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + varargElementType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(varargElementType_); varargElementType_ = subBuilder.buildPartial(); @@ -16999,10 +17001,10 @@ private ValueParameter( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { try { @@ -17015,18 +17017,18 @@ private ValueParameter( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public ValueParameter parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new ValueParameter(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -17076,7 +17078,7 @@ public int getName() { } public static final int TYPE_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_; + private ProtoBuf.Type type_; /** * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ @@ -17086,7 +17088,7 @@ public boolean hasType() { /** * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + public ProtoBuf.Type getType() { return type_; } @@ -17106,7 +17108,7 @@ public int getTypeId() { } public static final int VARARG_ELEMENT_TYPE_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type varargElementType_; + private ProtoBuf.Type varargElementType_; /** * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ @@ -17116,7 +17118,7 @@ public boolean hasVarargElementType() { /** * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType() { + public ProtoBuf.Type getVarargElementType() { return varargElementType_; } @@ -17138,9 +17140,9 @@ public int getVarargElementTypeId() { private void initFields() { flags_ = 0; name_ = 0; - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + type_ = ProtoBuf.Type.getDefaultInstance(); typeId_ = 0; - varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + varargElementType_ = ProtoBuf.Type.getDefaultInstance(); varargElementTypeId_ = 0; } private byte memoizedIsInitialized = -1; @@ -17173,11 +17175,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, flags_); @@ -17208,27 +17210,27 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, flags_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, name_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(3, type_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(4, varargElementType_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(5, typeId_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(6, varargElementTypeId_); } size += extensionsSerializedSize(); @@ -17244,62 +17246,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.ValueParameter parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.ValueParameter parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.ValueParameter parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + public static ProtoBuf.ValueParameter parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom(java.io.InputStream input) + public static ProtoBuf.ValueParameter parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( + public static ProtoBuf.ValueParameter parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.ValueParameter parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseDelimitedFrom( + public static ProtoBuf.ValueParameter parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.ValueParameter parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.ValueParameter parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.ValueParameter prototype) { + public static Builder newBuilder(ProtoBuf.ValueParameter prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -17308,11 +17310,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.ValuePar * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.ValueParameter, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.ValueParameter) - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameterOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.newBuilder() + ProtoBuf.ValueParameterOrBuilder { + // Construct using ProtoBuf.ValueParameter.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -17329,11 +17331,11 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000001); name_ = 0; bitField0_ = (bitField0_ & ~0x00000002); - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + type_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000004); typeId_ = 0; bitField0_ = (bitField0_ & ~0x00000008); - varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + varargElementType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000010); varargElementTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000020); @@ -17344,20 +17346,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance(); + public ProtoBuf.ValueParameter getDefaultInstanceForType() { + return ProtoBuf.ValueParameter.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter build() { - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter result = buildPartial(); + public ProtoBuf.ValueParameter build() { + ProtoBuf.ValueParameter result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter result = new org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter(this); + public ProtoBuf.ValueParameter buildPartial() { + ProtoBuf.ValueParameter result = new ProtoBuf.ValueParameter(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -17388,8 +17390,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.ValueParameter other) { + if (other == ProtoBuf.ValueParameter.getDefaultInstance()) return this; if (other.hasFlags()) { setFlags(other.getFlags()); } @@ -17439,14 +17441,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter parsedMessage = null; + ProtoBuf.ValueParameter parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.ValueParameter) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.ValueParameter) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -17549,7 +17551,7 @@ public Builder clearName() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type type_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ @@ -17559,13 +17561,13 @@ public boolean hasType() { /** * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getType() { + public ProtoBuf.Type getType() { return type_; } /** * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -17578,7 +17580,7 @@ public Builder setType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ public Builder setType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { type_ = builderForValue.build(); bitField0_ |= 0x00000004; @@ -17587,11 +17589,11 @@ public Builder setType( /** * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ - public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000004) == 0x00000004) && - type_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + type_ != ProtoBuf.Type.getDefaultInstance()) { type_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); } else { type_ = value; } @@ -17603,7 +17605,7 @@ public Builder mergeType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { * optional .org.jetbrains.kotlin.metadata.Type type = 3; */ public Builder clearType() { - type_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + type_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000004); return this; @@ -17641,7 +17643,7 @@ public Builder clearTypeId() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type varargElementType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ @@ -17651,13 +17653,13 @@ public boolean hasVarargElementType() { /** * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getVarargElementType() { + public ProtoBuf.Type getVarargElementType() { return varargElementType_; } /** * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - public Builder setVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setVarargElementType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -17670,7 +17672,7 @@ public Builder setVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ public Builder setVarargElementType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { varargElementType_ = builderForValue.build(); bitField0_ |= 0x00000010; @@ -17679,11 +17681,11 @@ public Builder setVarargElementType( /** * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ - public Builder mergeVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeVarargElementType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000010) == 0x00000010) && - varargElementType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + varargElementType_ != ProtoBuf.Type.getDefaultInstance()) { varargElementType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(varargElementType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(varargElementType_).mergeFrom(value).buildPartial(); } else { varargElementType_ = value; } @@ -17695,7 +17697,7 @@ public Builder mergeVarargElementType(org.jetbrains.kotlin.metadata.ProtoBuf.Typ * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; */ public Builder clearVarargElementType() { - varargElementType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + varargElementType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000010); return this; @@ -17746,7 +17748,7 @@ public Builder clearVarargElementTypeId() { public interface TypeAliasOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeAlias) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** @@ -17780,12 +17782,12 @@ public interface TypeAliasOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - java.util.List + java.util.List getTypeParameterList(); /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index); + ProtoBuf.TypeParameter getTypeParameter(int index); /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ @@ -17798,7 +17800,7 @@ public interface TypeAliasOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType(); + ProtoBuf.Type getUnderlyingType(); /** * optional int32 underlying_type_id = 5; @@ -17816,7 +17818,7 @@ public interface TypeAliasOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType(); + ProtoBuf.Type getExpandedType(); /** * optional int32 expanded_type_id = 7; @@ -17830,12 +17832,12 @@ public interface TypeAliasOrBuilder extends /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - java.util.List + java.util.List getAnnotationList(); /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index); + ProtoBuf.Annotation getAnnotation(int index); /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ @@ -17870,17 +17872,17 @@ public interface TypeAliasOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} */ public static final class TypeAlias extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< TypeAlias> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeAlias) TypeAliasOrBuilder { // Use TypeAlias.newBuilder() to construct. - private TypeAlias(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private TypeAlias(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private TypeAlias(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private TypeAlias(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final TypeAlias defaultInstance; public static TypeAlias getDefaultInstance() { @@ -17891,17 +17893,17 @@ public TypeAlias getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private TypeAlias( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -17930,18 +17932,18 @@ private TypeAlias( } case 26: { if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = new java.util.ArrayList(); + typeParameter_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } - typeParameter_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.PARSER, extensionRegistry)); + typeParameter_.add(input.readMessage(ProtoBuf.TypeParameter.PARSER, extensionRegistry)); break; } case 34: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000004) == 0x00000004)) { subBuilder = underlyingType_.toBuilder(); } - underlyingType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + underlyingType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(underlyingType_); underlyingType_ = subBuilder.buildPartial(); @@ -17955,11 +17957,11 @@ private TypeAlias( break; } case 50: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000010) == 0x00000010)) { subBuilder = expandedType_.toBuilder(); } - expandedType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + expandedType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(expandedType_); expandedType_ = subBuilder.buildPartial(); @@ -17974,10 +17976,10 @@ private TypeAlias( } case 66: { if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = new java.util.ArrayList(); + annotation_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000080; } - annotation_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.PARSER, extensionRegistry)); + annotation_.add(input.readMessage(ProtoBuf.Annotation.PARSER, extensionRegistry)); break; } case 248: { @@ -18003,10 +18005,10 @@ private TypeAlias( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { @@ -18028,18 +18030,18 @@ private TypeAlias( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public TypeAlias parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new TypeAlias(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -18085,17 +18087,17 @@ public int getName() { } public static final int TYPE_PARAMETER_FIELD_NUMBER = 3; - private java.util.List typeParameter_; + private java.util.List typeParameter_; /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - public java.util.List getTypeParameterList() { + public java.util.List getTypeParameterList() { return typeParameter_; } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - public java.util.List + public java.util.List getTypeParameterOrBuilderList() { return typeParameter_; } @@ -18108,19 +18110,19 @@ public int getTypeParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + public ProtoBuf.TypeParameter getTypeParameter(int index) { return typeParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( + public ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( int index) { return typeParameter_.get(index); } public static final int UNDERLYING_TYPE_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type underlyingType_; + private ProtoBuf.Type underlyingType_; /** * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ @@ -18130,7 +18132,7 @@ public boolean hasUnderlyingType() { /** * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType() { + public ProtoBuf.Type getUnderlyingType() { return underlyingType_; } @@ -18150,7 +18152,7 @@ public int getUnderlyingTypeId() { } public static final int EXPANDED_TYPE_FIELD_NUMBER = 6; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type expandedType_; + private ProtoBuf.Type expandedType_; /** * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ @@ -18160,7 +18162,7 @@ public boolean hasExpandedType() { /** * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType() { + public ProtoBuf.Type getExpandedType() { return expandedType_; } @@ -18180,17 +18182,17 @@ public int getExpandedTypeId() { } public static final int ANNOTATION_FIELD_NUMBER = 8; - private java.util.List annotation_; + private java.util.List annotation_; /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public java.util.List getAnnotationList() { + public java.util.List getAnnotationList() { return annotation_; } /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public java.util.List + public java.util.List getAnnotationOrBuilderList() { return annotation_; } @@ -18203,13 +18205,13 @@ public int getAnnotationCount() { /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index) { + public ProtoBuf.Annotation getAnnotation(int index) { return annotation_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder( + public ProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder( int index) { return annotation_.get(index); } @@ -18252,9 +18254,9 @@ private void initFields() { flags_ = 6; name_ = 0; typeParameter_ = java.util.Collections.emptyList(); - underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + underlyingType_ = ProtoBuf.Type.getDefaultInstance(); underlyingTypeId_ = 0; - expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + expandedType_ = ProtoBuf.Type.getDefaultInstance(); expandedTypeId_ = 0; annotation_ = java.util.Collections.emptyList(); versionRequirement_ = java.util.Collections.emptyList(); @@ -18301,11 +18303,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, flags_); @@ -18345,41 +18347,41 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, flags_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, name_); } for (int i = 0; i < typeParameter_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(3, typeParameter_.get(i)); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(4, underlyingType_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(5, underlyingTypeId_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(6, expandedType_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(7, expandedTypeId_); } for (int i = 0; i < annotation_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(8, annotation_.get(i)); } { int dataSize = 0; for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(versionRequirement_.get(i)); } size += dataSize; @@ -18398,62 +18400,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeAlias parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeAlias parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.TypeAlias parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( + public static ProtoBuf.TypeAlias parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom(java.io.InputStream input) + public static ProtoBuf.TypeAlias parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( + public static ProtoBuf.TypeAlias parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.TypeAlias parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseDelimitedFrom( + public static ProtoBuf.TypeAlias parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.TypeAlias parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.TypeAlias parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.TypeAlias prototype) { + public static Builder newBuilder(ProtoBuf.TypeAlias prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -18462,11 +18464,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlia * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.TypeAlias, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeAlias) - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAliasOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.newBuilder() + ProtoBuf.TypeAliasOrBuilder { + // Construct using ProtoBuf.TypeAlias.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -18485,11 +18487,11 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000002); typeParameter_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); - underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + underlyingType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); underlyingTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000010); - expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + expandedType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000020); expandedTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000040); @@ -18504,20 +18506,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance(); + public ProtoBuf.TypeAlias getDefaultInstanceForType() { + return ProtoBuf.TypeAlias.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias build() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias result = buildPartial(); + public ProtoBuf.TypeAlias build() { + ProtoBuf.TypeAlias result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias result = new org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias(this); + public ProtoBuf.TypeAlias buildPartial() { + ProtoBuf.TypeAlias result = new ProtoBuf.TypeAlias(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -18563,8 +18565,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.TypeAlias other) { + if (other == ProtoBuf.TypeAlias.getDefaultInstance()) return this; if (other.hasFlags()) { setFlags(other.getFlags()); } @@ -18656,14 +18658,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias parsedMessage = null; + ProtoBuf.TypeAlias parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.TypeAlias) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -18758,11 +18760,11 @@ public Builder clearName() { return this; } - private java.util.List typeParameter_ = + private java.util.List typeParameter_ = java.util.Collections.emptyList(); private void ensureTypeParameterIsMutable() { if (!((bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); + typeParameter_ = new java.util.ArrayList(typeParameter_); bitField0_ |= 0x00000004; } } @@ -18770,7 +18772,7 @@ private void ensureTypeParameterIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - public java.util.List getTypeParameterList() { + public java.util.List getTypeParameterList() { return java.util.Collections.unmodifiableList(typeParameter_); } /** @@ -18782,14 +18784,14 @@ public int getTypeParameterCount() { /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter getTypeParameter(int index) { + public ProtoBuf.TypeParameter getTypeParameter(int index) { return typeParameter_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + int index, ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -18802,7 +18804,7 @@ public Builder setTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ public Builder setTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + int index, ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.set(index, builderForValue.build()); @@ -18811,7 +18813,7 @@ public Builder setTypeParameter( /** * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ - public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + public Builder addTypeParameter(ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -18824,7 +18826,7 @@ public Builder addTypeParameter(org.jetbrains.kotlin.metadata.ProtoBuf.TypeParam * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter value) { + int index, ProtoBuf.TypeParameter value) { if (value == null) { throw new NullPointerException(); } @@ -18837,7 +18839,7 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ public Builder addTypeParameter( - org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.add(builderForValue.build()); @@ -18847,7 +18849,7 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ public Builder addTypeParameter( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.TypeParameter.Builder builderForValue) { + int index, ProtoBuf.TypeParameter.Builder builderForValue) { ensureTypeParameterIsMutable(); typeParameter_.add(index, builderForValue.build()); @@ -18857,9 +18859,9 @@ public Builder addTypeParameter( * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; */ public Builder addAllTypeParameter( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureTypeParameterIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, typeParameter_); return this; @@ -18883,7 +18885,7 @@ public Builder removeTypeParameter(int index) { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type underlyingType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ @@ -18893,13 +18895,13 @@ public boolean hasUnderlyingType() { /** * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getUnderlyingType() { + public ProtoBuf.Type getUnderlyingType() { return underlyingType_; } /** * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ - public Builder setUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setUnderlyingType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -18912,7 +18914,7 @@ public Builder setUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type val * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ public Builder setUnderlyingType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { underlyingType_ = builderForValue.build(); bitField0_ |= 0x00000008; @@ -18921,11 +18923,11 @@ public Builder setUnderlyingType( /** * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ - public Builder mergeUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeUnderlyingType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000008) == 0x00000008) && - underlyingType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + underlyingType_ != ProtoBuf.Type.getDefaultInstance()) { underlyingType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(underlyingType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(underlyingType_).mergeFrom(value).buildPartial(); } else { underlyingType_ = value; } @@ -18937,7 +18939,7 @@ public Builder mergeUnderlyingType(org.jetbrains.kotlin.metadata.ProtoBuf.Type v * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; */ public Builder clearUnderlyingType() { - underlyingType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + underlyingType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); return this; @@ -18975,7 +18977,7 @@ public Builder clearUnderlyingTypeId() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type expandedType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ @@ -18985,13 +18987,13 @@ public boolean hasExpandedType() { /** * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getExpandedType() { + public ProtoBuf.Type getExpandedType() { return expandedType_; } /** * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ - public Builder setExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setExpandedType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -19004,7 +19006,7 @@ public Builder setExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ public Builder setExpandedType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { expandedType_ = builderForValue.build(); bitField0_ |= 0x00000020; @@ -19013,11 +19015,11 @@ public Builder setExpandedType( /** * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ - public Builder mergeExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeExpandedType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000020) == 0x00000020) && - expandedType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + expandedType_ != ProtoBuf.Type.getDefaultInstance()) { expandedType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(expandedType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(expandedType_).mergeFrom(value).buildPartial(); } else { expandedType_ = value; } @@ -19029,7 +19031,7 @@ public Builder mergeExpandedType(org.jetbrains.kotlin.metadata.ProtoBuf.Type val * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; */ public Builder clearExpandedType() { - expandedType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + expandedType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000020); return this; @@ -19067,11 +19069,11 @@ public Builder clearExpandedTypeId() { return this; } - private java.util.List annotation_ = + private java.util.List annotation_ = java.util.Collections.emptyList(); private void ensureAnnotationIsMutable() { if (!((bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = new java.util.ArrayList(annotation_); + annotation_ = new java.util.ArrayList(annotation_); bitField0_ |= 0x00000080; } } @@ -19079,7 +19081,7 @@ private void ensureAnnotationIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public java.util.List getAnnotationList() { + public java.util.List getAnnotationList() { return java.util.Collections.unmodifiableList(annotation_); } /** @@ -19091,14 +19093,14 @@ public int getAnnotationCount() { /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Annotation getAnnotation(int index) { + public ProtoBuf.Annotation getAnnotation(int index) { return annotation_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ public Builder setAnnotation( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + int index, ProtoBuf.Annotation value) { if (value == null) { throw new NullPointerException(); } @@ -19111,7 +19113,7 @@ public Builder setAnnotation( * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ public Builder setAnnotation( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + int index, ProtoBuf.Annotation.Builder builderForValue) { ensureAnnotationIsMutable(); annotation_.set(index, builderForValue.build()); @@ -19120,7 +19122,7 @@ public Builder setAnnotation( /** * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ - public Builder addAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + public Builder addAnnotation(ProtoBuf.Annotation value) { if (value == null) { throw new NullPointerException(); } @@ -19133,7 +19135,7 @@ public Builder addAnnotation(org.jetbrains.kotlin.metadata.ProtoBuf.Annotation v * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ public Builder addAnnotation( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation value) { + int index, ProtoBuf.Annotation value) { if (value == null) { throw new NullPointerException(); } @@ -19146,7 +19148,7 @@ public Builder addAnnotation( * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ public Builder addAnnotation( - org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + ProtoBuf.Annotation.Builder builderForValue) { ensureAnnotationIsMutable(); annotation_.add(builderForValue.build()); @@ -19156,7 +19158,7 @@ public Builder addAnnotation( * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ public Builder addAnnotation( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.Builder builderForValue) { + int index, ProtoBuf.Annotation.Builder builderForValue) { ensureAnnotationIsMutable(); annotation_.add(index, builderForValue.build()); @@ -19166,9 +19168,9 @@ public Builder addAnnotation( * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; */ public Builder addAllAnnotation( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureAnnotationIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, annotation_); return this; @@ -19267,7 +19269,7 @@ public Builder addVersionRequirement(int value) { public Builder addAllVersionRequirement( java.lang.Iterable values) { ensureVersionRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, versionRequirement_); return this; @@ -19299,7 +19301,7 @@ public Builder clearVersionRequirement() { public interface EnumEntryOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.EnumEntry) - com.google.protobuf.GeneratedMessageLite. + GeneratedMessageLite. ExtendableMessageOrBuilder { /** @@ -19315,17 +19317,17 @@ public interface EnumEntryOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} */ public static final class EnumEntry extends - com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + GeneratedMessageLite.ExtendableMessage< EnumEntry> implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.EnumEntry) EnumEntryOrBuilder { // Use EnumEntry.newBuilder() to construct. - private EnumEntry(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { + private EnumEntry(GeneratedMessageLite.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private EnumEntry(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private EnumEntry(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final EnumEntry defaultInstance; public static EnumEntry getDefaultInstance() { @@ -19336,16 +19338,16 @@ public EnumEntry getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private EnumEntry( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -19369,10 +19371,10 @@ private EnumEntry( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { try { @@ -19385,18 +19387,18 @@ private EnumEntry( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public EnumEntry parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new EnumEntry(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -19433,11 +19435,11 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - com.google.protobuf.GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = + GeneratedMessageLite + .ExtendableMessage.ExtensionWriter extensionWriter = newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, name_); @@ -19453,7 +19455,7 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, name_); } size += extensionsSerializedSize(); @@ -19469,62 +19471,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.EnumEntry parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.EnumEntry parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.EnumEntry parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( + public static ProtoBuf.EnumEntry parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom(java.io.InputStream input) + public static ProtoBuf.EnumEntry parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( + public static ProtoBuf.EnumEntry parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.EnumEntry parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseDelimitedFrom( + public static ProtoBuf.EnumEntry parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.EnumEntry parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.EnumEntry parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.EnumEntry prototype) { + public static Builder newBuilder(ProtoBuf.EnumEntry prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -19533,11 +19535,11 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntr * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry, Builder> implements + GeneratedMessageLite.ExtendableBuilder< + ProtoBuf.EnumEntry, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.EnumEntry) - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntryOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.newBuilder() + ProtoBuf.EnumEntryOrBuilder { + // Construct using ProtoBuf.EnumEntry.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -19559,20 +19561,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.getDefaultInstance(); + public ProtoBuf.EnumEntry getDefaultInstanceForType() { + return ProtoBuf.EnumEntry.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry build() { - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry result = buildPartial(); + public ProtoBuf.EnumEntry build() { + ProtoBuf.EnumEntry result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry result = new org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry(this); + public ProtoBuf.EnumEntry buildPartial() { + ProtoBuf.EnumEntry result = new ProtoBuf.EnumEntry(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -19583,8 +19585,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.EnumEntry other) { + if (other == ProtoBuf.EnumEntry.getDefaultInstance()) return this; if (other.hasName()) { setName(other.getName()); } @@ -19603,14 +19605,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry parsedMessage = null; + ProtoBuf.EnumEntry parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.EnumEntry) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.EnumEntry) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -19666,7 +19668,7 @@ public Builder clearName() { public interface VersionRequirementOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * optional int32 version = 1; @@ -19723,7 +19725,7 @@ public interface VersionRequirementOrBuilder extends * Level of the reported diagnostic * */ - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel(); + ProtoBuf.VersionRequirement.Level getLevel(); /** * optional int32 error_code = 4; @@ -19776,22 +19778,22 @@ public interface VersionRequirementOrBuilder extends * (the "-api-version" argument value when compiling the call site) to be of at least the specified value * */ - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind(); + ProtoBuf.VersionRequirement.VersionKind getVersionKind(); } /** * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} */ public static final class VersionRequirement extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) VersionRequirementOrBuilder { // Use VersionRequirement.newBuilder() to construct. - private VersionRequirement(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private VersionRequirement(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private VersionRequirement(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private VersionRequirement(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final VersionRequirement defaultInstance; public static VersionRequirement getDefaultInstance() { @@ -19802,16 +19804,16 @@ public VersionRequirement getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private VersionRequirement( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -19840,7 +19842,7 @@ private VersionRequirement( } case 24: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level value = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.valueOf(rawValue); + ProtoBuf.VersionRequirement.Level value = ProtoBuf.VersionRequirement.Level.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -19862,7 +19864,7 @@ private VersionRequirement( } case 48: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind value = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.valueOf(rawValue); + ProtoBuf.VersionRequirement.VersionKind value = ProtoBuf.VersionRequirement.VersionKind.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -19874,10 +19876,10 @@ private VersionRequirement( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { try { @@ -19890,18 +19892,18 @@ private VersionRequirement( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public VersionRequirement parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new VersionRequirement(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -19909,7 +19911,7 @@ public com.google.protobuf.Parser getParserForType() { * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level} */ public enum Level - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * WARNING = 0; */ @@ -19949,13 +19951,13 @@ public static Level valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { public Level findValueByNumber(int number) { return Level.valueOf(number); } @@ -19975,7 +19977,7 @@ private Level(int index, int value) { * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind} */ public enum VersionKind - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * LANGUAGE_VERSION = 0; */ @@ -20015,13 +20017,13 @@ public static VersionKind valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { public VersionKind findValueByNumber(int number) { return VersionKind.valueOf(number); } @@ -20091,7 +20093,7 @@ public int getVersionFull() { } public static final int LEVEL_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level level_; + private ProtoBuf.VersionRequirement.Level level_; /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; * @@ -20109,7 +20111,7 @@ public boolean hasLevel() { * Level of the reported diagnostic * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel() { + public ProtoBuf.VersionRequirement.Level getLevel() { return level_; } @@ -20160,7 +20162,7 @@ public int getMessage() { } public static final int VERSION_KIND_FIELD_NUMBER = 6; - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind versionKind_; + private ProtoBuf.VersionRequirement.VersionKind versionKind_; /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; * @@ -20180,17 +20182,17 @@ public boolean hasVersionKind() { * (the "-api-version" argument value when compiling the call site) to be of at least the specified value * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind() { + public ProtoBuf.VersionRequirement.VersionKind getVersionKind() { return versionKind_; } private void initFields() { version_ = 0; versionFull_ = 0; - level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + level_ = ProtoBuf.VersionRequirement.Level.ERROR; errorCode_ = 0; message_ = 0; - versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + versionKind_ = ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -20202,7 +20204,7 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -20233,27 +20235,27 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, version_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, versionFull_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(3, level_.getNumber()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(4, errorCode_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(5, message_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(6, versionKind_.getNumber()); } size += unknownFields.size(); @@ -20268,62 +20270,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.VersionRequirement parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.VersionRequirement parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.VersionRequirement parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + public static ProtoBuf.VersionRequirement parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom(java.io.InputStream input) + public static ProtoBuf.VersionRequirement parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( + public static ProtoBuf.VersionRequirement parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.VersionRequirement parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseDelimitedFrom( + public static ProtoBuf.VersionRequirement parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.VersionRequirement parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.VersionRequirement parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.VersionRequirement prototype) { + public static Builder newBuilder(ProtoBuf.VersionRequirement prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -20332,12 +20334,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.VersionR * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.VersionRequirement, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.newBuilder() + ProtoBuf.VersionRequirementOrBuilder { + // Construct using ProtoBuf.VersionRequirement.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -20354,13 +20356,13 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000001); versionFull_ = 0; bitField0_ = (bitField0_ & ~0x00000002); - level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + level_ = ProtoBuf.VersionRequirement.Level.ERROR; bitField0_ = (bitField0_ & ~0x00000004); errorCode_ = 0; bitField0_ = (bitField0_ & ~0x00000008); message_ = 0; bitField0_ = (bitField0_ & ~0x00000010); - versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + versionKind_ = ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; bitField0_ = (bitField0_ & ~0x00000020); return this; } @@ -20369,20 +20371,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.getDefaultInstance(); + public ProtoBuf.VersionRequirement getDefaultInstanceForType() { + return ProtoBuf.VersionRequirement.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement build() { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement result = buildPartial(); + public ProtoBuf.VersionRequirement build() { + ProtoBuf.VersionRequirement result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement result = new org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement(this); + public ProtoBuf.VersionRequirement buildPartial() { + ProtoBuf.VersionRequirement result = new ProtoBuf.VersionRequirement(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -20413,8 +20415,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement buildPartial() return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.VersionRequirement other) { + if (other == ProtoBuf.VersionRequirement.getDefaultInstance()) return this; if (other.hasVersion()) { setVersion(other.getVersion()); } @@ -20443,14 +20445,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement parsedMessage = null; + ProtoBuf.VersionRequirement parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.VersionRequirement) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -20569,7 +20571,7 @@ public Builder clearVersionFull() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + private ProtoBuf.VersionRequirement.Level level_ = ProtoBuf.VersionRequirement.Level.ERROR; /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; * @@ -20587,7 +20589,7 @@ public boolean hasLevel() { * Level of the reported diagnostic * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel() { + public ProtoBuf.VersionRequirement.Level getLevel() { return level_; } /** @@ -20597,7 +20599,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level getLevel( * Level of the reported diagnostic * */ - public Builder setLevel(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level value) { + public Builder setLevel(ProtoBuf.VersionRequirement.Level value) { if (value == null) { throw new NullPointerException(); } @@ -20615,7 +20617,7 @@ public Builder setLevel(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequiremen */ public Builder clearLevel() { bitField0_ = (bitField0_ & ~0x00000004); - level_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Level.ERROR; + level_ = ProtoBuf.VersionRequirement.Level.ERROR; return this; } @@ -20716,7 +20718,7 @@ public Builder clearMessage() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + private ProtoBuf.VersionRequirement.VersionKind versionKind_ = ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; /** * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; * @@ -20736,7 +20738,7 @@ public boolean hasVersionKind() { * (the "-api-version" argument value when compiling the call site) to be of at least the specified value * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind getVersionKind() { + public ProtoBuf.VersionRequirement.VersionKind getVersionKind() { return versionKind_; } /** @@ -20747,7 +20749,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind get * (the "-api-version" argument value when compiling the call site) to be of at least the specified value * */ - public Builder setVersionKind(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind value) { + public Builder setVersionKind(ProtoBuf.VersionRequirement.VersionKind value) { if (value == null) { throw new NullPointerException(); } @@ -20766,7 +20768,7 @@ public Builder setVersionKind(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequ */ public Builder clearVersionKind() { bitField0_ = (bitField0_ & ~0x00000020); - versionKind_ = org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; + versionKind_ = ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; return this; } @@ -20784,17 +20786,17 @@ public Builder clearVersionKind() { public interface VersionRequirementTableOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - java.util.List + java.util.List getRequirementList(); /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index); + ProtoBuf.VersionRequirement getRequirement(int index); /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ @@ -20804,16 +20806,16 @@ public interface VersionRequirementTableOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} */ public static final class VersionRequirementTable extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) VersionRequirementTableOrBuilder { // Use VersionRequirementTable.newBuilder() to construct. - private VersionRequirementTable(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private VersionRequirementTable(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private VersionRequirementTable(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private VersionRequirementTable(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final VersionRequirementTable defaultInstance; public static VersionRequirementTable getDefaultInstance() { @@ -20824,17 +20826,17 @@ public VersionRequirementTable getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private VersionRequirementTable( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -20853,18 +20855,18 @@ private VersionRequirementTable( } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = new java.util.ArrayList(); + requirement_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - requirement_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.PARSER, extensionRegistry)); + requirement_.add(input.readMessage(ProtoBuf.VersionRequirement.PARSER, extensionRegistry)); break; } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { @@ -20880,33 +20882,33 @@ private VersionRequirementTable( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public VersionRequirementTable parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new VersionRequirementTable(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } public static final int REQUIREMENT_FIELD_NUMBER = 1; - private java.util.List requirement_; + private java.util.List requirement_; /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public java.util.List getRequirementList() { + public java.util.List getRequirementList() { return requirement_; } /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public java.util.List + public java.util.List getRequirementOrBuilderList() { return requirement_; } @@ -20919,13 +20921,13 @@ public int getRequirementCount() { /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index) { + public ProtoBuf.VersionRequirement getRequirement(int index) { return requirement_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementOrBuilder getRequirementOrBuilder( + public ProtoBuf.VersionRequirementOrBuilder getRequirementOrBuilder( int index) { return requirement_.get(index); } @@ -20943,7 +20945,7 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < requirement_.size(); i++) { @@ -20959,7 +20961,7 @@ public int getSerializedSize() { size = 0; for (int i = 0; i < requirement_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(1, requirement_.get(i)); } size += unknownFields.size(); @@ -20974,62 +20976,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.VersionRequirementTable parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.VersionRequirementTable parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.VersionRequirementTable parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + public static ProtoBuf.VersionRequirementTable parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom(java.io.InputStream input) + public static ProtoBuf.VersionRequirementTable parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( + public static ProtoBuf.VersionRequirementTable parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.VersionRequirementTable parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseDelimitedFrom( + public static ProtoBuf.VersionRequirementTable parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.VersionRequirementTable parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.VersionRequirementTable parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.VersionRequirementTable prototype) { + public static Builder newBuilder(ProtoBuf.VersionRequirementTable prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -21038,12 +21040,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.VersionR * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.VersionRequirementTable, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTableOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.newBuilder() + ProtoBuf.VersionRequirementTableOrBuilder { + // Construct using ProtoBuf.VersionRequirementTable.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -21065,20 +21067,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance(); + public ProtoBuf.VersionRequirementTable getDefaultInstanceForType() { + return ProtoBuf.VersionRequirementTable.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable build() { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable result = buildPartial(); + public ProtoBuf.VersionRequirementTable build() { + ProtoBuf.VersionRequirementTable result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable result = new org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable(this); + public ProtoBuf.VersionRequirementTable buildPartial() { + ProtoBuf.VersionRequirementTable result = new ProtoBuf.VersionRequirementTable(this); if (((bitField0_ & 0x00000001) == 0x00000001)) { requirement_ = java.util.Collections.unmodifiableList(requirement_); bitField0_ = (bitField0_ & ~0x00000001); @@ -21087,8 +21089,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable buildParti return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.VersionRequirementTable other) { + if (other == ProtoBuf.VersionRequirementTable.getDefaultInstance()) return this; if (!other.requirement_.isEmpty()) { if (requirement_.isEmpty()) { requirement_ = other.requirement_; @@ -21109,14 +21111,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable parsedMessage = null; + ProtoBuf.VersionRequirementTable parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirementTable) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.VersionRequirementTable) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -21127,11 +21129,11 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List requirement_ = + private java.util.List requirement_ = java.util.Collections.emptyList(); private void ensureRequirementIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = new java.util.ArrayList(requirement_); + requirement_ = new java.util.ArrayList(requirement_); bitField0_ |= 0x00000001; } } @@ -21139,7 +21141,7 @@ private void ensureRequirementIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public java.util.List getRequirementList() { + public java.util.List getRequirementList() { return java.util.Collections.unmodifiableList(requirement_); } /** @@ -21151,14 +21153,14 @@ public int getRequirementCount() { /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement getRequirement(int index) { + public ProtoBuf.VersionRequirement getRequirement(int index) { return requirement_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ public Builder setRequirement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { + int index, ProtoBuf.VersionRequirement value) { if (value == null) { throw new NullPointerException(); } @@ -21171,7 +21173,7 @@ public Builder setRequirement( * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ public Builder setRequirement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + int index, ProtoBuf.VersionRequirement.Builder builderForValue) { ensureRequirementIsMutable(); requirement_.set(index, builderForValue.build()); @@ -21180,7 +21182,7 @@ public Builder setRequirement( /** * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ - public Builder addRequirement(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { + public Builder addRequirement(ProtoBuf.VersionRequirement value) { if (value == null) { throw new NullPointerException(); } @@ -21193,7 +21195,7 @@ public Builder addRequirement(org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequ * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ public Builder addRequirement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement value) { + int index, ProtoBuf.VersionRequirement value) { if (value == null) { throw new NullPointerException(); } @@ -21206,7 +21208,7 @@ public Builder addRequirement( * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ public Builder addRequirement( - org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + ProtoBuf.VersionRequirement.Builder builderForValue) { ensureRequirementIsMutable(); requirement_.add(builderForValue.build()); @@ -21216,7 +21218,7 @@ public Builder addRequirement( * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ public Builder addRequirement( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.Builder builderForValue) { + int index, ProtoBuf.VersionRequirement.Builder builderForValue) { ensureRequirementIsMutable(); requirement_.add(index, builderForValue.build()); @@ -21226,9 +21228,9 @@ public Builder addRequirement( * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; */ public Builder addAllRequirement( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureRequirementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, requirement_); return this; @@ -21265,17 +21267,17 @@ public Builder removeRequirement(int index) { public interface ContractOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Contract) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - java.util.List + java.util.List getEffectList(); /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Effect getEffect(int index); + ProtoBuf.Effect getEffect(int index); /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ @@ -21285,16 +21287,16 @@ public interface ContractOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.Contract} */ public static final class Contract extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Contract) ContractOrBuilder { // Use Contract.newBuilder() to construct. - private Contract(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Contract(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Contract(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Contract(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Contract defaultInstance; public static Contract getDefaultInstance() { @@ -21305,17 +21307,17 @@ public Contract getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Contract( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -21334,18 +21336,18 @@ private Contract( } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - effect_ = new java.util.ArrayList(); + effect_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - effect_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Effect.PARSER, extensionRegistry)); + effect_.add(input.readMessage(ProtoBuf.Effect.PARSER, extensionRegistry)); break; } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { @@ -21361,33 +21363,33 @@ private Contract( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Contract parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Contract(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } public static final int EFFECT_FIELD_NUMBER = 1; - private java.util.List effect_; + private java.util.List effect_; /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - public java.util.List getEffectList() { + public java.util.List getEffectList() { return effect_; } /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - public java.util.List + public java.util.List getEffectOrBuilderList() { return effect_; } @@ -21400,13 +21402,13 @@ public int getEffectCount() { /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect getEffect(int index) { + public ProtoBuf.Effect getEffect(int index) { return effect_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.EffectOrBuilder getEffectOrBuilder( + public ProtoBuf.EffectOrBuilder getEffectOrBuilder( int index) { return effect_.get(index); } @@ -21430,7 +21432,7 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < effect_.size(); i++) { @@ -21446,7 +21448,7 @@ public int getSerializedSize() { size = 0; for (int i = 0; i < effect_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(1, effect_.get(i)); } size += unknownFields.size(); @@ -21461,62 +21463,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Contract parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Contract parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Contract parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( + public static ProtoBuf.Contract parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom(java.io.InputStream input) + public static ProtoBuf.Contract parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( + public static ProtoBuf.Contract parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Contract parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseDelimitedFrom( + public static ProtoBuf.Contract parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Contract parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Contract parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Contract parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Contract prototype) { + public static Builder newBuilder(ProtoBuf.Contract prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -21525,12 +21527,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Contract * Protobuf type {@code org.jetbrains.kotlin.metadata.Contract} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Contract, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.Contract, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Contract) - org.jetbrains.kotlin.metadata.ProtoBuf.ContractOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Contract.newBuilder() + ProtoBuf.ContractOrBuilder { + // Construct using ProtoBuf.Contract.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -21552,20 +21554,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Contract getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance(); + public ProtoBuf.Contract getDefaultInstanceForType() { + return ProtoBuf.Contract.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Contract build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Contract result = buildPartial(); + public ProtoBuf.Contract build() { + ProtoBuf.Contract result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Contract buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Contract result = new org.jetbrains.kotlin.metadata.ProtoBuf.Contract(this); + public ProtoBuf.Contract buildPartial() { + ProtoBuf.Contract result = new ProtoBuf.Contract(this); if (((bitField0_ & 0x00000001) == 0x00000001)) { effect_ = java.util.Collections.unmodifiableList(effect_); bitField0_ = (bitField0_ & ~0x00000001); @@ -21574,8 +21576,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Contract buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Contract other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Contract.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Contract other) { + if (other == ProtoBuf.Contract.getDefaultInstance()) return this; if (!other.effect_.isEmpty()) { if (effect_.isEmpty()) { effect_ = other.effect_; @@ -21602,14 +21604,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Contract parsedMessage = null; + ProtoBuf.Contract parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Contract) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Contract) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -21620,11 +21622,11 @@ public Builder mergeFrom( } private int bitField0_; - private java.util.List effect_ = + private java.util.List effect_ = java.util.Collections.emptyList(); private void ensureEffectIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { - effect_ = new java.util.ArrayList(effect_); + effect_ = new java.util.ArrayList(effect_); bitField0_ |= 0x00000001; } } @@ -21632,7 +21634,7 @@ private void ensureEffectIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - public java.util.List getEffectList() { + public java.util.List getEffectList() { return java.util.Collections.unmodifiableList(effect_); } /** @@ -21644,14 +21646,14 @@ public int getEffectCount() { /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect getEffect(int index) { + public ProtoBuf.Effect getEffect(int index) { return effect_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ public Builder setEffect( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Effect value) { + int index, ProtoBuf.Effect value) { if (value == null) { throw new NullPointerException(); } @@ -21664,7 +21666,7 @@ public Builder setEffect( * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ public Builder setEffect( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Effect.Builder builderForValue) { + int index, ProtoBuf.Effect.Builder builderForValue) { ensureEffectIsMutable(); effect_.set(index, builderForValue.build()); @@ -21673,7 +21675,7 @@ public Builder setEffect( /** * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ - public Builder addEffect(org.jetbrains.kotlin.metadata.ProtoBuf.Effect value) { + public Builder addEffect(ProtoBuf.Effect value) { if (value == null) { throw new NullPointerException(); } @@ -21686,7 +21688,7 @@ public Builder addEffect(org.jetbrains.kotlin.metadata.ProtoBuf.Effect value) { * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ public Builder addEffect( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Effect value) { + int index, ProtoBuf.Effect value) { if (value == null) { throw new NullPointerException(); } @@ -21699,7 +21701,7 @@ public Builder addEffect( * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ public Builder addEffect( - org.jetbrains.kotlin.metadata.ProtoBuf.Effect.Builder builderForValue) { + ProtoBuf.Effect.Builder builderForValue) { ensureEffectIsMutable(); effect_.add(builderForValue.build()); @@ -21709,7 +21711,7 @@ public Builder addEffect( * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ public Builder addEffect( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Effect.Builder builderForValue) { + int index, ProtoBuf.Effect.Builder builderForValue) { ensureEffectIsMutable(); effect_.add(index, builderForValue.build()); @@ -21719,9 +21721,9 @@ public Builder addEffect( * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; */ public Builder addAllEffect( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureEffectIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, effect_); return this; @@ -21758,7 +21760,7 @@ public Builder removeEffect(int index) { public interface EffectOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Effect) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; @@ -21767,17 +21769,17 @@ public interface EffectOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType getEffectType(); + ProtoBuf.Effect.EffectType getEffectType(); /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - java.util.List + java.util.List getEffectConstructorArgumentList(); /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Expression getEffectConstructorArgument(int index); + ProtoBuf.Expression getEffectConstructorArgument(int index); /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ @@ -21800,7 +21802,7 @@ public interface EffectOrBuilder extends * is given by other fields in this message, and 'Expression' is stored in this field. * */ - org.jetbrains.kotlin.metadata.ProtoBuf.Expression getConclusionOfConditionalEffect(); + ProtoBuf.Expression getConclusionOfConditionalEffect(); /** * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; @@ -21809,22 +21811,22 @@ public interface EffectOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind getKind(); + ProtoBuf.Effect.InvocationKind getKind(); } /** * Protobuf type {@code org.jetbrains.kotlin.metadata.Effect} */ public static final class Effect extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Effect) EffectOrBuilder { // Use Effect.newBuilder() to construct. - private Effect(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Effect(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Effect(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Effect(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Effect defaultInstance; public static Effect getDefaultInstance() { @@ -21835,17 +21837,17 @@ public Effect getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Effect( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -21864,7 +21866,7 @@ private Effect( } case 8: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType value = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.valueOf(rawValue); + ProtoBuf.Effect.EffectType value = ProtoBuf.Effect.EffectType.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -21876,18 +21878,18 @@ private Effect( } case 18: { if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - effectConstructorArgument_ = new java.util.ArrayList(); + effectConstructorArgument_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000002; } - effectConstructorArgument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.PARSER, extensionRegistry)); + effectConstructorArgument_.add(input.readMessage(ProtoBuf.Expression.PARSER, extensionRegistry)); break; } case 26: { - org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder subBuilder = null; + ProtoBuf.Expression.Builder subBuilder = null; if (((bitField0_ & 0x00000002) == 0x00000002)) { subBuilder = conclusionOfConditionalEffect_.toBuilder(); } - conclusionOfConditionalEffect_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.PARSER, extensionRegistry); + conclusionOfConditionalEffect_ = input.readMessage(ProtoBuf.Expression.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(conclusionOfConditionalEffect_); conclusionOfConditionalEffect_ = subBuilder.buildPartial(); @@ -21897,7 +21899,7 @@ private Effect( } case 32: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind value = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.valueOf(rawValue); + ProtoBuf.Effect.InvocationKind value = ProtoBuf.Effect.InvocationKind.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -21909,10 +21911,10 @@ private Effect( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { @@ -21928,18 +21930,18 @@ private Effect( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Effect parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Effect(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -21955,7 +21957,7 @@ public com.google.protobuf.Parser getParserForType() { * */ public enum EffectType - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * RETURNS_CONSTANT = 0; * @@ -22021,13 +22023,13 @@ public static EffectType valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { public EffectType findValueByNumber(int number) { return EffectType.valueOf(number); } @@ -22047,7 +22049,7 @@ private EffectType(int index, int value) { * Protobuf enum {@code org.jetbrains.kotlin.metadata.Effect.InvocationKind} */ public enum InvocationKind - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * AT_MOST_ONCE = 0; */ @@ -22087,13 +22089,13 @@ public static InvocationKind valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { public InvocationKind findValueByNumber(int number) { return InvocationKind.valueOf(number); } @@ -22111,7 +22113,7 @@ private InvocationKind(int index, int value) { private int bitField0_; public static final int EFFECT_TYPE_FIELD_NUMBER = 1; - private org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType effectType_; + private ProtoBuf.Effect.EffectType effectType_; /** * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; */ @@ -22121,22 +22123,22 @@ public boolean hasEffectType() { /** * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType getEffectType() { + public ProtoBuf.Effect.EffectType getEffectType() { return effectType_; } public static final int EFFECT_CONSTRUCTOR_ARGUMENT_FIELD_NUMBER = 2; - private java.util.List effectConstructorArgument_; + private java.util.List effectConstructorArgument_; /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - public java.util.List getEffectConstructorArgumentList() { + public java.util.List getEffectConstructorArgumentList() { return effectConstructorArgument_; } /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - public java.util.List + public java.util.List getEffectConstructorArgumentOrBuilderList() { return effectConstructorArgument_; } @@ -22149,19 +22151,19 @@ public int getEffectConstructorArgumentCount() { /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getEffectConstructorArgument(int index) { + public ProtoBuf.Expression getEffectConstructorArgument(int index) { return effectConstructorArgument_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder getEffectConstructorArgumentOrBuilder( + public ProtoBuf.ExpressionOrBuilder getEffectConstructorArgumentOrBuilder( int index) { return effectConstructorArgument_.get(index); } public static final int CONCLUSION_OF_CONDITIONAL_EFFECT_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Expression conclusionOfConditionalEffect_; + private ProtoBuf.Expression conclusionOfConditionalEffect_; /** * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; * @@ -22181,12 +22183,12 @@ public boolean hasConclusionOfConditionalEffect() { * is given by other fields in this message, and 'Expression' is stored in this field. * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getConclusionOfConditionalEffect() { + public ProtoBuf.Expression getConclusionOfConditionalEffect() { return conclusionOfConditionalEffect_; } public static final int KIND_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind kind_; + private ProtoBuf.Effect.InvocationKind kind_; /** * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; */ @@ -22196,15 +22198,15 @@ public boolean hasKind() { /** * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind getKind() { + public ProtoBuf.Effect.InvocationKind getKind() { return kind_; } private void initFields() { - effectType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; + effectType_ = ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; effectConstructorArgument_ = java.util.Collections.emptyList(); - conclusionOfConditionalEffect_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); - kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; + conclusionOfConditionalEffect_ = ProtoBuf.Expression.getDefaultInstance(); + kind_ = ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -22228,7 +22230,7 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -22253,19 +22255,19 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(1, effectType_.getNumber()); } for (int i = 0; i < effectConstructorArgument_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(2, effectConstructorArgument_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(3, conclusionOfConditionalEffect_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(4, kind_.getNumber()); } size += unknownFields.size(); @@ -22280,62 +22282,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Effect parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Effect parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Effect parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( + public static ProtoBuf.Effect parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom(java.io.InputStream input) + public static ProtoBuf.Effect parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( + public static ProtoBuf.Effect parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Effect parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseDelimitedFrom( + public static ProtoBuf.Effect parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Effect parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Effect parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Effect parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Effect prototype) { + public static Builder newBuilder(ProtoBuf.Effect prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -22344,12 +22346,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Effect p * Protobuf type {@code org.jetbrains.kotlin.metadata.Effect} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Effect, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.Effect, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Effect) - org.jetbrains.kotlin.metadata.ProtoBuf.EffectOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Effect.newBuilder() + ProtoBuf.EffectOrBuilder { + // Construct using ProtoBuf.Effect.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -22362,13 +22364,13 @@ private static Builder create() { public Builder clear() { super.clear(); - effectType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; + effectType_ = ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; bitField0_ = (bitField0_ & ~0x00000001); effectConstructorArgument_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); - conclusionOfConditionalEffect_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + conclusionOfConditionalEffect_ = ProtoBuf.Expression.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000004); - kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; + kind_ = ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -22377,20 +22379,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Effect.getDefaultInstance(); + public ProtoBuf.Effect getDefaultInstanceForType() { + return ProtoBuf.Effect.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Effect result = buildPartial(); + public ProtoBuf.Effect build() { + ProtoBuf.Effect result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Effect result = new org.jetbrains.kotlin.metadata.ProtoBuf.Effect(this); + public ProtoBuf.Effect buildPartial() { + ProtoBuf.Effect result = new ProtoBuf.Effect(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -22414,8 +22416,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Effect buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Effect other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Effect.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Effect other) { + if (other == ProtoBuf.Effect.getDefaultInstance()) return this; if (other.hasEffectType()) { setEffectType(other.getEffectType()); } @@ -22457,14 +22459,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Effect parsedMessage = null; + ProtoBuf.Effect parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Effect) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Effect) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -22475,7 +22477,7 @@ public Builder mergeFrom( } private int bitField0_; - private org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType effectType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; + private ProtoBuf.Effect.EffectType effectType_ = ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; /** * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; */ @@ -22485,13 +22487,13 @@ public boolean hasEffectType() { /** * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType getEffectType() { + public ProtoBuf.Effect.EffectType getEffectType() { return effectType_; } /** * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; */ - public Builder setEffectType(org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType value) { + public Builder setEffectType(ProtoBuf.Effect.EffectType value) { if (value == null) { throw new NullPointerException(); } @@ -22505,16 +22507,16 @@ public Builder setEffectType(org.jetbrains.kotlin.metadata.ProtoBuf.Effect.Effec */ public Builder clearEffectType() { bitField0_ = (bitField0_ & ~0x00000001); - effectType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; + effectType_ = ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; return this; } - private java.util.List effectConstructorArgument_ = + private java.util.List effectConstructorArgument_ = java.util.Collections.emptyList(); private void ensureEffectConstructorArgumentIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { - effectConstructorArgument_ = new java.util.ArrayList(effectConstructorArgument_); + effectConstructorArgument_ = new java.util.ArrayList(effectConstructorArgument_); bitField0_ |= 0x00000002; } } @@ -22522,7 +22524,7 @@ private void ensureEffectConstructorArgumentIsMutable() { /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - public java.util.List getEffectConstructorArgumentList() { + public java.util.List getEffectConstructorArgumentList() { return java.util.Collections.unmodifiableList(effectConstructorArgument_); } /** @@ -22534,14 +22536,14 @@ public int getEffectConstructorArgumentCount() { /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getEffectConstructorArgument(int index) { + public ProtoBuf.Expression getEffectConstructorArgument(int index) { return effectConstructorArgument_.get(index); } /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ public Builder setEffectConstructorArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + int index, ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -22554,7 +22556,7 @@ public Builder setEffectConstructorArgument( * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ public Builder setEffectConstructorArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + int index, ProtoBuf.Expression.Builder builderForValue) { ensureEffectConstructorArgumentIsMutable(); effectConstructorArgument_.set(index, builderForValue.build()); @@ -22563,7 +22565,7 @@ public Builder setEffectConstructorArgument( /** * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ - public Builder addEffectConstructorArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + public Builder addEffectConstructorArgument(ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -22576,7 +22578,7 @@ public Builder addEffectConstructorArgument(org.jetbrains.kotlin.metadata.ProtoB * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ public Builder addEffectConstructorArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + int index, ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -22589,7 +22591,7 @@ public Builder addEffectConstructorArgument( * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ public Builder addEffectConstructorArgument( - org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ProtoBuf.Expression.Builder builderForValue) { ensureEffectConstructorArgumentIsMutable(); effectConstructorArgument_.add(builderForValue.build()); @@ -22599,7 +22601,7 @@ public Builder addEffectConstructorArgument( * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ public Builder addEffectConstructorArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + int index, ProtoBuf.Expression.Builder builderForValue) { ensureEffectConstructorArgumentIsMutable(); effectConstructorArgument_.add(index, builderForValue.build()); @@ -22609,9 +22611,9 @@ public Builder addEffectConstructorArgument( * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; */ public Builder addAllEffectConstructorArgument( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureEffectConstructorArgumentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, effectConstructorArgument_); return this; @@ -22635,7 +22637,7 @@ public Builder removeEffectConstructorArgument(int index) { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Expression conclusionOfConditionalEffect_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + private ProtoBuf.Expression conclusionOfConditionalEffect_ = ProtoBuf.Expression.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; * @@ -22655,7 +22657,7 @@ public boolean hasConclusionOfConditionalEffect() { * is given by other fields in this message, and 'Expression' is stored in this field. * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getConclusionOfConditionalEffect() { + public ProtoBuf.Expression getConclusionOfConditionalEffect() { return conclusionOfConditionalEffect_; } /** @@ -22666,7 +22668,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getConclusionOfConditio * is given by other fields in this message, and 'Expression' is stored in this field. * */ - public Builder setConclusionOfConditionalEffect(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + public Builder setConclusionOfConditionalEffect(ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -22684,7 +22686,7 @@ public Builder setConclusionOfConditionalEffect(org.jetbrains.kotlin.metadata.Pr * */ public Builder setConclusionOfConditionalEffect( - org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ProtoBuf.Expression.Builder builderForValue) { conclusionOfConditionalEffect_ = builderForValue.build(); bitField0_ |= 0x00000004; @@ -22698,11 +22700,11 @@ public Builder setConclusionOfConditionalEffect( * is given by other fields in this message, and 'Expression' is stored in this field. * */ - public Builder mergeConclusionOfConditionalEffect(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + public Builder mergeConclusionOfConditionalEffect(ProtoBuf.Expression value) { if (((bitField0_ & 0x00000004) == 0x00000004) && - conclusionOfConditionalEffect_ != org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance()) { + conclusionOfConditionalEffect_ != ProtoBuf.Expression.getDefaultInstance()) { conclusionOfConditionalEffect_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Expression.newBuilder(conclusionOfConditionalEffect_).mergeFrom(value).buildPartial(); + ProtoBuf.Expression.newBuilder(conclusionOfConditionalEffect_).mergeFrom(value).buildPartial(); } else { conclusionOfConditionalEffect_ = value; } @@ -22719,13 +22721,13 @@ public Builder mergeConclusionOfConditionalEffect(org.jetbrains.kotlin.metadata. * */ public Builder clearConclusionOfConditionalEffect() { - conclusionOfConditionalEffect_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + conclusionOfConditionalEffect_ = ProtoBuf.Expression.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000004); return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; + private ProtoBuf.Effect.InvocationKind kind_ = ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; /** * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; */ @@ -22735,13 +22737,13 @@ public boolean hasKind() { /** * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind getKind() { + public ProtoBuf.Effect.InvocationKind getKind() { return kind_; } /** * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; */ - public Builder setKind(org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind value) { + public Builder setKind(ProtoBuf.Effect.InvocationKind value) { if (value == null) { throw new NullPointerException(); } @@ -22755,7 +22757,7 @@ public Builder setKind(org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationK */ public Builder clearKind() { bitField0_ = (bitField0_ & ~0x00000008); - kind_ = org.jetbrains.kotlin.metadata.ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; + kind_ = ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; return this; } @@ -22773,7 +22775,7 @@ public Builder clearKind() { public interface ExpressionOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Expression) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * optional int32 flags = 1 [default = 0]; @@ -22820,7 +22822,7 @@ public interface ExpressionOrBuilder extends /** * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; */ - org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue getConstantValue(); + ProtoBuf.Expression.ConstantValue getConstantValue(); /** * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; @@ -22839,7 +22841,7 @@ public interface ExpressionOrBuilder extends * and with type encoded in either one of next two fields as RHS. * */ - org.jetbrains.kotlin.metadata.ProtoBuf.Type getIsInstanceType(); + ProtoBuf.Type getIsInstanceType(); /** * optional int32 is_instance_type_id = 5; @@ -22859,7 +22861,7 @@ public interface ExpressionOrBuilder extends * it is optimized and embedded straight into this message * */ - java.util.List + java.util.List getAndArgumentList(); /** * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; @@ -22870,7 +22872,7 @@ public interface ExpressionOrBuilder extends * it is optimized and embedded straight into this message * */ - org.jetbrains.kotlin.metadata.ProtoBuf.Expression getAndArgument(int index); + ProtoBuf.Expression getAndArgument(int index); /** * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; * @@ -22891,7 +22893,7 @@ public interface ExpressionOrBuilder extends * it is optimized and embedded straight into this message. * */ - java.util.List + java.util.List getOrArgumentList(); /** * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; @@ -22902,7 +22904,7 @@ public interface ExpressionOrBuilder extends * it is optimized and embedded straight into this message. * */ - org.jetbrains.kotlin.metadata.ProtoBuf.Expression getOrArgument(int index); + ProtoBuf.Expression getOrArgument(int index); /** * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; * @@ -22923,16 +22925,16 @@ public interface ExpressionOrBuilder extends * */ public static final class Expression extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Expression) ExpressionOrBuilder { // Use Expression.newBuilder() to construct. - private Expression(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Expression(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Expression(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Expression(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Expression defaultInstance; public static Expression getDefaultInstance() { @@ -22943,17 +22945,17 @@ public Expression getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Expression( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -22982,7 +22984,7 @@ private Expression( } case 24: { int rawValue = input.readEnum(); - org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue value = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.valueOf(rawValue); + ProtoBuf.Expression.ConstantValue value = ProtoBuf.Expression.ConstantValue.valueOf(rawValue); if (value == null) { unknownFieldsCodedOutput.writeRawVarint32(tag); unknownFieldsCodedOutput.writeRawVarint32(rawValue); @@ -22993,11 +22995,11 @@ private Expression( break; } case 34: { - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder subBuilder = null; + ProtoBuf.Type.Builder subBuilder = null; if (((bitField0_ & 0x00000008) == 0x00000008)) { subBuilder = isInstanceType_.toBuilder(); } - isInstanceType_ = input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Type.PARSER, extensionRegistry); + isInstanceType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(isInstanceType_); isInstanceType_ = subBuilder.buildPartial(); @@ -23012,26 +23014,26 @@ private Expression( } case 50: { if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - andArgument_ = new java.util.ArrayList(); + andArgument_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000020; } - andArgument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.PARSER, extensionRegistry)); + andArgument_.add(input.readMessage(ProtoBuf.Expression.PARSER, extensionRegistry)); break; } case 58: { if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - orArgument_ = new java.util.ArrayList(); + orArgument_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000040; } - orArgument_.add(input.readMessage(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.PARSER, extensionRegistry)); + orArgument_.add(input.readMessage(ProtoBuf.Expression.PARSER, extensionRegistry)); break; } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { @@ -23050,18 +23052,18 @@ private Expression( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { public Expression parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Expression(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -23069,7 +23071,7 @@ public com.google.protobuf.Parser getParserForType() { * Protobuf enum {@code org.jetbrains.kotlin.metadata.Expression.ConstantValue} */ public enum ConstantValue - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * TRUE = 0; */ @@ -23109,13 +23111,13 @@ public static ConstantValue valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { public ConstantValue findValueByNumber(int number) { return ConstantValue.valueOf(number); } @@ -23183,7 +23185,7 @@ public int getValueParameterReference() { } public static final int CONSTANT_VALUE_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue constantValue_; + private ProtoBuf.Expression.ConstantValue constantValue_; /** * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; */ @@ -23193,12 +23195,12 @@ public boolean hasConstantValue() { /** * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue getConstantValue() { + public ProtoBuf.Expression.ConstantValue getConstantValue() { return constantValue_; } public static final int IS_INSTANCE_TYPE_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.metadata.ProtoBuf.Type isInstanceType_; + private ProtoBuf.Type isInstanceType_; /** * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; * @@ -23218,7 +23220,7 @@ public boolean hasIsInstanceType() { * and with type encoded in either one of next two fields as RHS. * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getIsInstanceType() { + public ProtoBuf.Type getIsInstanceType() { return isInstanceType_; } @@ -23238,7 +23240,7 @@ public int getIsInstanceTypeId() { } public static final int AND_ARGUMENT_FIELD_NUMBER = 6; - private java.util.List andArgument_; + private java.util.List andArgument_; /** * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; * @@ -23248,7 +23250,7 @@ public int getIsInstanceTypeId() { * it is optimized and embedded straight into this message * */ - public java.util.List getAndArgumentList() { + public java.util.List getAndArgumentList() { return andArgument_; } /** @@ -23260,7 +23262,7 @@ public java.util.List getAndA * it is optimized and embedded straight into this message * */ - public java.util.List + public java.util.List getAndArgumentOrBuilderList() { return andArgument_; } @@ -23285,7 +23287,7 @@ public int getAndArgumentCount() { * it is optimized and embedded straight into this message * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getAndArgument(int index) { + public ProtoBuf.Expression getAndArgument(int index) { return andArgument_.get(index); } /** @@ -23297,13 +23299,13 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getAndArgument(int inde * it is optimized and embedded straight into this message * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder getAndArgumentOrBuilder( + public ProtoBuf.ExpressionOrBuilder getAndArgumentOrBuilder( int index) { return andArgument_.get(index); } public static final int OR_ARGUMENT_FIELD_NUMBER = 7; - private java.util.List orArgument_; + private java.util.List orArgument_; /** * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; * @@ -23313,7 +23315,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder getAndArgument * it is optimized and embedded straight into this message. * */ - public java.util.List getOrArgumentList() { + public java.util.List getOrArgumentList() { return orArgument_; } /** @@ -23325,7 +23327,7 @@ public java.util.List getOrAr * it is optimized and embedded straight into this message. * */ - public java.util.List + public java.util.List getOrArgumentOrBuilderList() { return orArgument_; } @@ -23350,7 +23352,7 @@ public int getOrArgumentCount() { * it is optimized and embedded straight into this message. * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getOrArgument(int index) { + public ProtoBuf.Expression getOrArgument(int index) { return orArgument_.get(index); } /** @@ -23362,7 +23364,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getOrArgument(int index * it is optimized and embedded straight into this message. * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder getOrArgumentOrBuilder( + public ProtoBuf.ExpressionOrBuilder getOrArgumentOrBuilder( int index) { return orArgument_.get(index); } @@ -23370,8 +23372,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder getOrArgumentO private void initFields() { flags_ = 0; valueParameterReference_ = 0; - constantValue_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.TRUE; - isInstanceType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + constantValue_ = ProtoBuf.Expression.ConstantValue.TRUE; + isInstanceType_ = ProtoBuf.Type.getDefaultInstance(); isInstanceTypeId_ = 0; andArgument_ = java.util.Collections.emptyList(); orArgument_ = java.util.Collections.emptyList(); @@ -23404,7 +23406,7 @@ public final boolean isInitialized() { return true; } - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -23438,31 +23440,31 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, flags_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, valueParameterReference_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(3, constantValue_.getNumber()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(4, isInstanceType_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(5, isInstanceTypeId_); } for (int i = 0; i < andArgument_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(6, andArgument_.get(i)); } for (int i = 0; i < orArgument_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(7, orArgument_.get(i)); } size += unknownFields.size(); @@ -23477,62 +23479,62 @@ protected java.lang.Object writeReplace() return super.writeReplace(); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Expression parseFrom( + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Expression parseFrom( + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static ProtoBuf.Expression parseFrom(byte[] data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( + public static ProtoBuf.Expression parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom(java.io.InputStream input) + public static ProtoBuf.Expression parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( + public static ProtoBuf.Expression parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseDelimitedFrom(java.io.InputStream input) + public static ProtoBuf.Expression parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseDelimitedFrom( + public static ProtoBuf.Expression parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( - com.google.protobuf.CodedInputStream input) + public static ProtoBuf.Expression parseFrom( + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.jetbrains.kotlin.metadata.ProtoBuf.Expression parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + public static ProtoBuf.Expression parseFrom( + CodedInputStream input, + 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.metadata.ProtoBuf.Expression prototype) { + public static Builder newBuilder(ProtoBuf.Expression prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -23546,12 +23548,12 @@ public static Builder newBuilder(org.jetbrains.kotlin.metadata.ProtoBuf.Expressi * */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.metadata.ProtoBuf.Expression, Builder> + GeneratedMessageLite.Builder< + ProtoBuf.Expression, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Expression) - org.jetbrains.kotlin.metadata.ProtoBuf.ExpressionOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.ProtoBuf.Expression.newBuilder() + ProtoBuf.ExpressionOrBuilder { + // Construct using ProtoBuf.Expression.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -23568,9 +23570,9 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000001); valueParameterReference_ = 0; bitField0_ = (bitField0_ & ~0x00000002); - constantValue_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.TRUE; + constantValue_ = ProtoBuf.Expression.ConstantValue.TRUE; bitField0_ = (bitField0_ & ~0x00000004); - isInstanceType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + isInstanceType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); isInstanceTypeId_ = 0; bitField0_ = (bitField0_ & ~0x00000010); @@ -23585,20 +23587,20 @@ public Builder clone() { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getDefaultInstanceForType() { - return org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance(); + public ProtoBuf.Expression getDefaultInstanceForType() { + return ProtoBuf.Expression.getDefaultInstance(); } - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression build() { - org.jetbrains.kotlin.metadata.ProtoBuf.Expression result = buildPartial(); + public ProtoBuf.Expression build() { + ProtoBuf.Expression result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression buildPartial() { - org.jetbrains.kotlin.metadata.ProtoBuf.Expression result = new org.jetbrains.kotlin.metadata.ProtoBuf.Expression(this); + public ProtoBuf.Expression buildPartial() { + ProtoBuf.Expression result = new ProtoBuf.Expression(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -23635,8 +23637,8 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Expression buildPartial() { return result; } - public Builder mergeFrom(org.jetbrains.kotlin.metadata.ProtoBuf.Expression other) { - if (other == org.jetbrains.kotlin.metadata.ProtoBuf.Expression.getDefaultInstance()) return this; + public Builder mergeFrom(ProtoBuf.Expression other) { + if (other == ProtoBuf.Expression.getDefaultInstance()) return this; if (other.hasFlags()) { setFlags(other.getFlags()); } @@ -23700,14 +23702,14 @@ public final boolean isInitialized() { } public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.metadata.ProtoBuf.Expression parsedMessage = null; + ProtoBuf.Expression parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.metadata.ProtoBuf.Expression) e.getUnfinishedMessage(); + } catch (InvalidProtocolBufferException e) { + parsedMessage = (ProtoBuf.Expression) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -23822,7 +23824,7 @@ public Builder clearValueParameterReference() { return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue constantValue_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.TRUE; + private ProtoBuf.Expression.ConstantValue constantValue_ = ProtoBuf.Expression.ConstantValue.TRUE; /** * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; */ @@ -23832,13 +23834,13 @@ public boolean hasConstantValue() { /** * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue getConstantValue() { + public ProtoBuf.Expression.ConstantValue getConstantValue() { return constantValue_; } /** * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; */ - public Builder setConstantValue(org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue value) { + public Builder setConstantValue(ProtoBuf.Expression.ConstantValue value) { if (value == null) { throw new NullPointerException(); } @@ -23852,12 +23854,12 @@ public Builder setConstantValue(org.jetbrains.kotlin.metadata.ProtoBuf.Expressio */ public Builder clearConstantValue() { bitField0_ = (bitField0_ & ~0x00000004); - constantValue_ = org.jetbrains.kotlin.metadata.ProtoBuf.Expression.ConstantValue.TRUE; + constantValue_ = ProtoBuf.Expression.ConstantValue.TRUE; return this; } - private org.jetbrains.kotlin.metadata.ProtoBuf.Type isInstanceType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + private ProtoBuf.Type isInstanceType_ = ProtoBuf.Type.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; * @@ -23877,7 +23879,7 @@ public boolean hasIsInstanceType() { * and with type encoded in either one of next two fields as RHS. * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Type getIsInstanceType() { + public ProtoBuf.Type getIsInstanceType() { return isInstanceType_; } /** @@ -23888,7 +23890,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Type getIsInstanceType() { * and with type encoded in either one of next two fields as RHS. * */ - public Builder setIsInstanceType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder setIsInstanceType(ProtoBuf.Type value) { if (value == null) { throw new NullPointerException(); } @@ -23906,7 +23908,7 @@ public Builder setIsInstanceType(org.jetbrains.kotlin.metadata.ProtoBuf.Type val * */ public Builder setIsInstanceType( - org.jetbrains.kotlin.metadata.ProtoBuf.Type.Builder builderForValue) { + ProtoBuf.Type.Builder builderForValue) { isInstanceType_ = builderForValue.build(); bitField0_ |= 0x00000008; @@ -23920,11 +23922,11 @@ public Builder setIsInstanceType( * and with type encoded in either one of next two fields as RHS. * */ - public Builder mergeIsInstanceType(org.jetbrains.kotlin.metadata.ProtoBuf.Type value) { + public Builder mergeIsInstanceType(ProtoBuf.Type value) { if (((bitField0_ & 0x00000008) == 0x00000008) && - isInstanceType_ != org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance()) { + isInstanceType_ != ProtoBuf.Type.getDefaultInstance()) { isInstanceType_ = - org.jetbrains.kotlin.metadata.ProtoBuf.Type.newBuilder(isInstanceType_).mergeFrom(value).buildPartial(); + ProtoBuf.Type.newBuilder(isInstanceType_).mergeFrom(value).buildPartial(); } else { isInstanceType_ = value; } @@ -23941,7 +23943,7 @@ public Builder mergeIsInstanceType(org.jetbrains.kotlin.metadata.ProtoBuf.Type v * */ public Builder clearIsInstanceType() { - isInstanceType_ = org.jetbrains.kotlin.metadata.ProtoBuf.Type.getDefaultInstance(); + isInstanceType_ = ProtoBuf.Type.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000008); return this; @@ -23979,11 +23981,11 @@ public Builder clearIsInstanceTypeId() { return this; } - private java.util.List andArgument_ = + private java.util.List andArgument_ = java.util.Collections.emptyList(); private void ensureAndArgumentIsMutable() { if (!((bitField0_ & 0x00000020) == 0x00000020)) { - andArgument_ = new java.util.ArrayList(andArgument_); + andArgument_ = new java.util.ArrayList(andArgument_); bitField0_ |= 0x00000020; } } @@ -23997,7 +23999,7 @@ private void ensureAndArgumentIsMutable() { * it is optimized and embedded straight into this message * */ - public java.util.List getAndArgumentList() { + public java.util.List getAndArgumentList() { return java.util.Collections.unmodifiableList(andArgument_); } /** @@ -24021,7 +24023,7 @@ public int getAndArgumentCount() { * it is optimized and embedded straight into this message * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getAndArgument(int index) { + public ProtoBuf.Expression getAndArgument(int index) { return andArgument_.get(index); } /** @@ -24034,7 +24036,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getAndArgument(int inde * */ public Builder setAndArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + int index, ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -24053,7 +24055,7 @@ public Builder setAndArgument( * */ public Builder setAndArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + int index, ProtoBuf.Expression.Builder builderForValue) { ensureAndArgumentIsMutable(); andArgument_.set(index, builderForValue.build()); @@ -24068,7 +24070,7 @@ public Builder setAndArgument( * it is optimized and embedded straight into this message * */ - public Builder addAndArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + public Builder addAndArgument(ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -24087,7 +24089,7 @@ public Builder addAndArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Expression * */ public Builder addAndArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + int index, ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -24106,7 +24108,7 @@ public Builder addAndArgument( * */ public Builder addAndArgument( - org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ProtoBuf.Expression.Builder builderForValue) { ensureAndArgumentIsMutable(); andArgument_.add(builderForValue.build()); @@ -24122,7 +24124,7 @@ public Builder addAndArgument( * */ public Builder addAndArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + int index, ProtoBuf.Expression.Builder builderForValue) { ensureAndArgumentIsMutable(); andArgument_.add(index, builderForValue.build()); @@ -24138,9 +24140,9 @@ public Builder addAndArgument( * */ public Builder addAllAndArgument( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureAndArgumentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, andArgument_); return this; @@ -24176,11 +24178,11 @@ public Builder removeAndArgument(int index) { return this; } - private java.util.List orArgument_ = + private java.util.List orArgument_ = java.util.Collections.emptyList(); private void ensureOrArgumentIsMutable() { if (!((bitField0_ & 0x00000040) == 0x00000040)) { - orArgument_ = new java.util.ArrayList(orArgument_); + orArgument_ = new java.util.ArrayList(orArgument_); bitField0_ |= 0x00000040; } } @@ -24194,7 +24196,7 @@ private void ensureOrArgumentIsMutable() { * it is optimized and embedded straight into this message. * */ - public java.util.List getOrArgumentList() { + public java.util.List getOrArgumentList() { return java.util.Collections.unmodifiableList(orArgument_); } /** @@ -24218,7 +24220,7 @@ public int getOrArgumentCount() { * it is optimized and embedded straight into this message. * */ - public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getOrArgument(int index) { + public ProtoBuf.Expression getOrArgument(int index) { return orArgument_.get(index); } /** @@ -24231,7 +24233,7 @@ public org.jetbrains.kotlin.metadata.ProtoBuf.Expression getOrArgument(int index * */ public Builder setOrArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + int index, ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -24250,7 +24252,7 @@ public Builder setOrArgument( * */ public Builder setOrArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + int index, ProtoBuf.Expression.Builder builderForValue) { ensureOrArgumentIsMutable(); orArgument_.set(index, builderForValue.build()); @@ -24265,7 +24267,7 @@ public Builder setOrArgument( * it is optimized and embedded straight into this message. * */ - public Builder addOrArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + public Builder addOrArgument(ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -24284,7 +24286,7 @@ public Builder addOrArgument(org.jetbrains.kotlin.metadata.ProtoBuf.Expression v * */ public Builder addOrArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression value) { + int index, ProtoBuf.Expression value) { if (value == null) { throw new NullPointerException(); } @@ -24303,7 +24305,7 @@ public Builder addOrArgument( * */ public Builder addOrArgument( - org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + ProtoBuf.Expression.Builder builderForValue) { ensureOrArgumentIsMutable(); orArgument_.add(builderForValue.build()); @@ -24319,7 +24321,7 @@ public Builder addOrArgument( * */ public Builder addOrArgument( - int index, org.jetbrains.kotlin.metadata.ProtoBuf.Expression.Builder builderForValue) { + int index, ProtoBuf.Expression.Builder builderForValue) { ensureOrArgumentIsMutable(); orArgument_.add(index, builderForValue.build()); @@ -24335,9 +24337,9 @@ public Builder addOrArgument( * */ public Builder addAllOrArgument( - java.lang.Iterable values) { + java.lang.Iterable values) { ensureOrArgumentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, orArgument_); return this; diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt similarity index 97% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt index d69b769aa0..59b8367797 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.deserialization +package retrofit2.kotlin.metadata.deserialization /** * Subclasses of this class are used to identify different versions of the binary output of the compiler and their compatibility guarantees. diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Flags.java similarity index 85% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Flags.java index 1639bc7dd1..38a34a926e 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/Flags.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Flags.java @@ -3,12 +3,9 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.deserialization; +package retrofit2.kotlin.metadata.deserialization; -import com.google.protobuf.Internal; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.kotlin.metadata.ProtoBuf; public class Flags { protected Flags() {} diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/NameResolver.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/NameResolver.kt similarity index 89% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/NameResolver.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/NameResolver.kt index 403bd8064e..77c78a759d 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/NameResolver.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/NameResolver.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.deserialization +package retrofit2.kotlin.metadata.deserialization interface NameResolver { fun getString(index: Int): String diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtoBufUtil.kt similarity index 81% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtoBufUtil.kt index c9b2aceabf..7a78243a69 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/ProtoBufUtil.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtoBufUtil.kt @@ -3,9 +3,9 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.deserialization +package retrofit2.kotlin.metadata.deserialization -import com.google.protobuf.GeneratedMessageLite +import retrofit2.kotlin.protobuf.GeneratedMessageLite fun , T> GeneratedMessageLite.ExtendableMessage.getExtensionOrNull( extension: GeneratedMessageLite.GeneratedExtension diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/TypeTable.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/TypeTable.kt similarity index 91% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/TypeTable.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/TypeTable.kt index 27406f036a..47965db40b 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/TypeTable.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/TypeTable.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.jetbrains.kotlin.metadata.deserialization +package retrofit2.kotlin.metadata.deserialization -import org.jetbrains.kotlin.metadata.ProtoBuf +import retrofit2.kotlin.metadata.ProtoBuf class TypeTable(typeTable: ProtoBuf.TypeTable) { val types: List = run { diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/VersionRequirement.kt similarity index 87% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/VersionRequirement.kt index b685014ce6..6dfa40f9a4 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/VersionRequirement.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/VersionRequirement.kt @@ -3,9 +3,9 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.deserialization +package retrofit2.kotlin.metadata.deserialization -import org.jetbrains.kotlin.metadata.ProtoBuf +import retrofit2.kotlin.metadata.ProtoBuf class VersionRequirementTable private constructor(private val infos: List) { operator fun get(id: Int): ProtoBuf.VersionRequirement? = infos.getOrNull(id) diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/protoTypeTableUtil.kt similarity index 92% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/protoTypeTableUtil.kt index a8ff98ec13..be46dea253 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/deserialization/protoTypeTableUtil.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/protoTypeTableUtil.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.jetbrains.kotlin.metadata.deserialization +package retrofit2.kotlin.metadata.deserialization -import org.jetbrains.kotlin.metadata.ProtoBuf +import retrofit2.kotlin.metadata.ProtoBuf fun ProtoBuf.Function.returnType(typeTable: TypeTable): ProtoBuf.Type = when { hasReturnType() -> returnType diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/JvmProtoBuf.java similarity index 87% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java rename to retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/JvmProtoBuf.java index 05b4e5a6ae..6c184efe8f 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/JvmProtoBuf.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/JvmProtoBuf.java @@ -1,16 +1,19 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: core/metadata.jvm/src/jvm_metadata.proto -package org.jetbrains.kotlin.metadata.jvm; +package retrofit2.kotlin.metadata.jvm; + +import retrofit2.kotlin.metadata.ProtoBuf; +import retrofit2.kotlin.protobuf.*; public final class JvmProtoBuf { private JvmProtoBuf() {} - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + public static void registerAllExtensions(ExtensionRegistryLite registry) { registry.add(JvmProtoBuf.methodSignature); } public interface StringTableTypesOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; @@ -31,17 +34,17 @@ public interface StringTableTypesOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes} */ public static final class StringTableTypes extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) StringTableTypesOrBuilder { // Use StringTableTypes.newBuilder() to construct. - private StringTableTypes(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private StringTableTypes(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") private StringTableTypes(boolean noInit) { - this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + this.unknownFields = ByteString.EMPTY;} private static final StringTableTypes defaultInstance; public static StringTableTypes getDefaultInstance() { @@ -53,17 +56,17 @@ public StringTableTypes getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private StringTableTypes( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -111,10 +114,10 @@ private StringTableTypes( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { @@ -134,26 +137,26 @@ private StringTableTypes( } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public StringTableTypes parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new StringTableTypes(input, extensionRegistry); } }; @Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } public interface RecordOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * optional int32 range = 1 [default = 1]; @@ -212,7 +215,7 @@ public interface RecordOrBuilder extends * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored * */ - com.google.protobuf.ByteString + ByteString getStringBytes(); /** @@ -295,16 +298,16 @@ public interface RecordOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record} */ public static final class Record extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) RecordOrBuilder { // Use Record.newBuilder() to construct. - private Record(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Record(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") - private Record(boolean noInit) { this.unknownFields = com.google.protobuf.ByteString.EMPTY;} + private Record(boolean noInit) { this.unknownFields = ByteString.EMPTY;} private static final Record defaultInstance; public static Record getDefaultInstance() { @@ -316,17 +319,17 @@ public Record getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private Record( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -408,17 +411,17 @@ private Record( break; } case 50: { - com.google.protobuf.ByteString bs = input.readBytes(); + ByteString bs = input.readBytes(); bitField0_ |= 0x00000004; string_ = bs; break; } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { @@ -437,20 +440,20 @@ private Record( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public Record parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new Record(input, extensionRegistry); } }; @Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -458,7 +461,7 @@ public com.google.protobuf.Parser getParserForType() { * Protobuf enum {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation} */ public enum Operation - implements com.google.protobuf.Internal.EnumLite { + implements Internal.EnumLite { /** * NONE = 0; */ @@ -518,13 +521,13 @@ public static Operation valueOf(int value) { } } - public static com.google.protobuf.Internal.EnumLiteMap + public static Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { + new Internal.EnumLiteMap() { @Override public Operation findValueByNumber(int number) { @@ -619,8 +622,8 @@ public String getString() { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; + ByteString bs = + (ByteString) ref; String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { string_ = s; @@ -636,17 +639,17 @@ public String getString() { * */ @Override - public com.google.protobuf.ByteString + public ByteString getStringBytes() { Object ref = string_; if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( + ByteString b = + ByteString.copyFromUtf8( (String) ref); string_ = b; return b; } else { - return (com.google.protobuf.ByteString) ref; + return (ByteString) ref; } } @@ -781,7 +784,7 @@ public final boolean isInitialized() { } @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -822,27 +825,27 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, range_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, predefinedIndex_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeEnumSize(3, operation_.getNumber()); } { int dataSize = 0; for (int i = 0; i < substringIndex_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(substringIndex_.get(i)); } size += dataSize; if (!getSubstringIndexList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32SizeNoTag(dataSize); } substringIndexMemoizedSerializedSize = dataSize; @@ -850,19 +853,19 @@ public int getSerializedSize() { { int dataSize = 0; for (int i = 0; i < replaceChar_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(replaceChar_.get(i)); } size += dataSize; if (!getReplaceCharList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32SizeNoTag(dataSize); } replaceCharMemoizedSerializedSize = dataSize; } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeBytesSize(6, getStringBytes()); } size += unknownFields.size(); @@ -878,24 +881,24 @@ protected Object writeReplace() } public static Record parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static Record parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static Record parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static Record parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static Record parseFrom(java.io.InputStream input) @@ -904,7 +907,7 @@ public static Record parseFrom(java.io.InputStream input) } public static Record parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } @@ -914,18 +917,18 @@ public static Record parseDelimitedFrom(java.io.InputStream input) } public static Record parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static Record parseFrom( - com.google.protobuf.CodedInputStream input) + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static Record parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } @@ -945,12 +948,12 @@ public static Builder newBuilder(Record prototype) { * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< + GeneratedMessageLite.Builder< Record, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) RecordOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record.newBuilder() + // Construct using JvmProtoBuf.StringTableTypes.Record.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -1082,13 +1085,13 @@ public final boolean isInitialized() { @Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { Record parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { parsedMessage = (Record) e.getUnfinishedMessage(); throw e; } finally { @@ -1223,8 +1226,8 @@ public boolean hasString() { public String getString() { Object ref = string_; if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; + ByteString bs = + (ByteString) ref; String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { string_ = s; @@ -1242,17 +1245,17 @@ public String getString() { * */ @Override - public com.google.protobuf.ByteString + public ByteString getStringBytes() { Object ref = string_; if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( + ByteString b = + ByteString.copyFromUtf8( (String) ref); string_ = b; return b; } else { - return (com.google.protobuf.ByteString) ref; + return (ByteString) ref; } } /** @@ -1293,7 +1296,7 @@ public Builder clearString() { * */ public Builder setStringBytes( - com.google.protobuf.ByteString value) { + ByteString value) { if (value == null) { throw new NullPointerException(); } @@ -1446,7 +1449,7 @@ public Builder addSubstringIndex(int value) { public Builder addAllSubstringIndex( Iterable values) { ensureSubstringIndexIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, substringIndex_); return this; @@ -1551,7 +1554,7 @@ public Builder addReplaceChar(int value) { public Builder addAllReplaceChar( Iterable values) { ensureReplaceCharIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( + AbstractMessageLite.Builder.addAll( values, replaceChar_); return this; @@ -1639,7 +1642,7 @@ public final boolean isInitialized() { } @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < record_.size(); i++) { @@ -1664,19 +1667,19 @@ public int getSerializedSize() { size = 0; for (int i = 0; i < record_.size(); i++) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeMessageSize(1, record_.get(i)); } { int dataSize = 0; for (int i = 0; i < localName_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream + dataSize += CodedOutputStream .computeInt32SizeNoTag(localName_.get(i)); } size += dataSize; if (!getLocalNameList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32SizeNoTag(dataSize); } localNameMemoizedSerializedSize = dataSize; @@ -1694,24 +1697,24 @@ protected Object writeReplace() } public static StringTableTypes parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static StringTableTypes parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static StringTableTypes parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static StringTableTypes parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static StringTableTypes parseFrom(java.io.InputStream input) @@ -1720,7 +1723,7 @@ public static StringTableTypes parseFrom(java.io.InputStream input) } public static StringTableTypes parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } @@ -1730,18 +1733,18 @@ public static StringTableTypes parseDelimitedFrom(java.io.InputStream input) } public static StringTableTypes parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static StringTableTypes parseFrom( - com.google.protobuf.CodedInputStream input) + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static StringTableTypes parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } @@ -1759,12 +1762,12 @@ public static Builder newBuilder(StringTableTypes prototype) { * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< + GeneratedMessageLite.Builder< StringTableTypes, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) StringTableTypesOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.newBuilder() + // Construct using JvmProtoBuf.StringTableTypes.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -1855,13 +1858,13 @@ public final boolean isInitialized() { @Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { StringTableTypes parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { parsedMessage = (StringTableTypes) e.getUnfinishedMessage(); throw e; } finally { @@ -1923,7 +1926,7 @@ private void ensureLocalNameIsMutable() { public interface JvmMethodSignatureOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) - com.google.protobuf.MessageLiteOrBuilder { + MessageLiteOrBuilder { /** * optional int32 name = 1; @@ -1955,18 +1958,18 @@ public interface JvmMethodSignatureOrBuilder extends * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature} */ public static final class JvmMethodSignature extends - com.google.protobuf.GeneratedMessageLite implements + GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) JvmMethodSignatureOrBuilder { // Use JvmMethodSignature.newBuilder() to construct. - private JvmMethodSignature(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private JvmMethodSignature(GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @SuppressWarnings("UnusedVariable") private JvmMethodSignature(boolean noInit) { - this.unknownFields = com.google.protobuf.ByteString.EMPTY; + this.unknownFields = ByteString.EMPTY; } private static final JvmMethodSignature defaultInstance; @@ -1979,16 +1982,16 @@ public JvmMethodSignature getDefaultInstanceForType() { return defaultInstance; } - private final com.google.protobuf.ByteString unknownFields; + private final ByteString unknownFields; private JvmMethodSignature( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { initFields(); - com.google.protobuf.ByteString.Output unknownFieldsOutput = - com.google.protobuf.ByteString.newOutput(); - com.google.protobuf.CodedOutputStream unknownFieldsCodedOutput = - com.google.protobuf.CodedOutputStream.newInstance( + ByteString.Output unknownFieldsOutput = + ByteString.newOutput(); + CodedOutputStream unknownFieldsCodedOutput = + CodedOutputStream.newInstance( unknownFieldsOutput, 1); try { boolean done = false; @@ -2017,10 +2020,10 @@ private JvmMethodSignature( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( + throw new InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { try { @@ -2033,19 +2036,19 @@ private JvmMethodSignature( makeExtensionsImmutable(); } } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + public static Parser PARSER = + new AbstractParser() { @Override public JvmMethodSignature parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return new JvmMethodSignature(input, extensionRegistry); } }; @Override - public com.google.protobuf.Parser getParserForType() { + public Parser getParserForType() { return PARSER; } @@ -2109,7 +2112,7 @@ public final boolean isInitialized() { } @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) + public void writeTo(CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -2130,11 +2133,11 @@ public int getSerializedSize() { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(1, name_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream + size += CodedOutputStream .computeInt32Size(2, desc_); } size += unknownFields.size(); @@ -2150,24 +2153,24 @@ protected Object writeReplace() } public static JvmMethodSignature parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + ByteString data) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static JvmMethodSignature parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ByteString data, + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static JvmMethodSignature parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + throws InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static JvmMethodSignature parseFrom( byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + ExtensionRegistryLite extensionRegistry) + throws InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static JvmMethodSignature parseFrom(java.io.InputStream input) @@ -2176,7 +2179,7 @@ public static JvmMethodSignature parseFrom(java.io.InputStream input) } public static JvmMethodSignature parseFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } @@ -2186,18 +2189,18 @@ public static JvmMethodSignature parseDelimitedFrom(java.io.InputStream input) } public static JvmMethodSignature parseDelimitedFrom( java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static JvmMethodSignature parseFrom( - com.google.protobuf.CodedInputStream input) + CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static JvmMethodSignature parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } @@ -2216,12 +2219,12 @@ public static Builder newBuilder(JvmMethodSignature prototype) { * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< + GeneratedMessageLite.Builder< JvmMethodSignature, Builder> implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) JvmMethodSignatureOrBuilder { - // Construct using org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.JvmMethodSignature.newBuilder() + // Construct using JvmProtoBuf.JvmMethodSignature.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -2297,13 +2300,13 @@ public final boolean isInitialized() { @Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) + CodedInputStream input, + ExtensionRegistryLite extensionRegistry) throws java.io.IOException { JvmMethodSignature parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + } catch (InvalidProtocolBufferException e) { parsedMessage = (JvmMethodSignature) e.getUnfinishedMessage(); throw e; } finally { @@ -2415,16 +2418,16 @@ public Builder clearDesc() { * extend .org.jetbrains.kotlin.metadata.Function { ... } */ public static final - com.google.protobuf.GeneratedMessageLite.GeneratedExtension< - org.jetbrains.kotlin.metadata.ProtoBuf.Function, - JvmMethodSignature> methodSignature = com.google.protobuf.GeneratedMessageLite + GeneratedMessageLite.GeneratedExtension< + ProtoBuf.Function, + JvmMethodSignature> methodSignature = GeneratedMessageLite .newSingularGeneratedExtension( - org.jetbrains.kotlin.metadata.ProtoBuf.Function.getDefaultInstance(), + ProtoBuf.Function.getDefaultInstance(), JvmMethodSignature.getDefaultInstance(), JvmMethodSignature.getDefaultInstance(), null, 100, - com.google.protobuf.WireFormat.FieldType.MESSAGE, + WireFormat.FieldType.MESSAGE, JvmMethodSignature.class); // @@protoc_insertion_point(outer_class_scope) diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/BitEncoding.java similarity index 95% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java rename to retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/BitEncoding.java index 20d7042b94..1bd00e4b5e 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/BitEncoding.java @@ -3,14 +3,11 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.jvm.deserialization; +package retrofit2.kotlin.metadata.jvm.deserialization; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.List; - -import static org.jetbrains.kotlin.metadata.jvm.deserialization.UtfEncodingKt.MAX_UTF8_INFO_LENGTH; +import static retrofit2.kotlin.metadata.jvm.deserialization.UtfEncodingKt.MAX_UTF8_INFO_LENGTH; public class BitEncoding { diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt similarity index 98% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt index db5dba08a8..2b4f218eda 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.jvm.deserialization +package retrofit2.kotlin.metadata.jvm.deserialization // The purpose of this class is to map Kotlin classes to JVM bytecode desc strings, as KotlinTypeMapper does in the backend. // It's used as an optimization during serialization/deserialization: if there's no JVM signature for a method/property/constructor, diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt similarity index 94% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt index 3d986ac8ed..2d41a6103c 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.jvm.deserialization +package retrofit2.kotlin.metadata.jvm.deserialization /** * A signature of JVM method or field diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt similarity index 91% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt index 00861f4eac..0f28d118b8 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt @@ -3,9 +3,9 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.jvm.deserialization +package retrofit2.kotlin.metadata.jvm.deserialization -import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion +import retrofit2.kotlin.metadata.deserialization.BinaryVersion /** * The version of the metadata serialized by the compiler and deserialized by the compiler and reflection. diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt similarity index 92% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt index 2ff5324918..fe3458c2b4 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt @@ -3,12 +3,12 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.jvm.deserialization +package retrofit2.kotlin.metadata.jvm.deserialization -import org.jetbrains.kotlin.metadata.deserialization.NameResolver -import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf -import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record -import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.* +import retrofit2.kotlin.metadata.deserialization.NameResolver +import retrofit2.kotlin.metadata.jvm.JvmProtoBuf +import retrofit2.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record +import retrofit2.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.* class JvmNameResolver( val types: JvmProtoBuf.StringTableTypes, diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt similarity index 90% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt index 380da878d5..a3f8e5ba6a 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt @@ -3,12 +3,12 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.metadata.jvm.deserialization +package retrofit2.kotlin.metadata.jvm.deserialization -import com.google.protobuf.ExtensionRegistryLite -import org.jetbrains.kotlin.metadata.ProtoBuf -import org.jetbrains.kotlin.metadata.deserialization.* -import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf +import retrofit2.kotlin.protobuf.ExtensionRegistryLite +import retrofit2.kotlin.metadata.ProtoBuf +import retrofit2.kotlin.metadata.deserialization.* +import retrofit2.kotlin.metadata.jvm.JvmProtoBuf import java.io.ByteArrayInputStream import java.io.InputStream diff --git a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/utfEncoding.kt similarity index 95% rename from retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/utfEncoding.kt index afb257c6d7..dc65a388e2 100644 --- a/retrofit/src/main/java/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/utfEncoding.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.metadata.jvm.deserialization +package retrofit2.kotlin.metadata.jvm.deserialization import java.util.* diff --git a/retrofit/src/main/java/com/google/protobuf/AbstractMessageLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractMessageLite.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/AbstractMessageLite.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractMessageLite.java index d2df96a04f..9f8babadad 100644 --- a/retrofit/src/main/java/com/google/protobuf/AbstractMessageLite.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractMessageLite.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.FilterInputStream; import java.io.InputStream; diff --git a/retrofit/src/main/java/com/google/protobuf/AbstractParser.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractParser.java similarity index 98% rename from retrofit/src/main/java/com/google/protobuf/AbstractParser.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractParser.java index 2ff95c740a..957b5df04f 100644 --- a/retrofit/src/main/java/com/google/protobuf/AbstractParser.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractParser.java @@ -28,9 +28,9 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; -import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; +import retrofit2.kotlin.protobuf.AbstractMessageLite.Builder.LimitedInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/retrofit/src/main/java/com/google/protobuf/BoundedByteString.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/BoundedByteString.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/BoundedByteString.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/BoundedByteString.java index 2828e9c74b..114d1672dc 100644 --- a/retrofit/src/main/java/com/google/protobuf/BoundedByteString.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/BoundedByteString.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.NoSuchElementException; diff --git a/retrofit/src/main/java/com/google/protobuf/ByteString.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ByteString.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/ByteString.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/ByteString.java index 7da56127d7..570aa04fd7 100644 --- a/retrofit/src/main/java/com/google/protobuf/ByteString.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ByteString.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/retrofit/src/main/java/com/google/protobuf/CodedInputStream.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedInputStream.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/CodedInputStream.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedInputStream.java index a00ae86f04..32b608daa1 100644 --- a/retrofit/src/main/java/com/google/protobuf/CodedInputStream.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedInputStream.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/retrofit/src/main/java/com/google/protobuf/CodedOutputStream.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedOutputStream.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/CodedOutputStream.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedOutputStream.java index fafe035689..2721b007c7 100644 --- a/retrofit/src/main/java/com/google/protobuf/CodedOutputStream.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedOutputStream.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.IOException; import java.io.OutputStream; diff --git a/retrofit/src/main/java/com/google/protobuf/ExtensionRegistryLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ExtensionRegistryLite.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/ExtensionRegistryLite.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/ExtensionRegistryLite.java index a941fc4bb5..5d1e3cdc6e 100644 --- a/retrofit/src/main/java/com/google/protobuf/ExtensionRegistryLite.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ExtensionRegistryLite.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.Collections; import java.util.HashMap; diff --git a/retrofit/src/main/java/com/google/protobuf/FieldSet.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/FieldSet.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/FieldSet.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/FieldSet.java index 392f4efc20..5c34dfb660 100644 --- a/retrofit/src/main/java/com/google/protobuf/FieldSet.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/FieldSet.java @@ -28,9 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; - -import com.google.protobuf.LazyField.LazyIterator; +package retrofit2.kotlin.protobuf; import java.io.IOException; import java.util.ArrayList; @@ -195,7 +193,7 @@ private void cloneFieldEntry(Map map, */ public Iterator> iterator() { if (hasLazyField) { - return new LazyIterator( + return new LazyField.LazyIterator( fields.entrySet().iterator()); } return fields.entrySet().iterator(); diff --git a/retrofit/src/main/java/com/google/protobuf/GeneratedMessageLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/GeneratedMessageLite.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/GeneratedMessageLite.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/GeneratedMessageLite.java index e64b2f7ee1..5463bb9992 100644 --- a/retrofit/src/main/java/com/google/protobuf/GeneratedMessageLite.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/GeneratedMessageLite.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.IOException; import java.io.ObjectStreamException; @@ -912,7 +912,7 @@ static final class SerializedForm implements Serializable { private byte[] asBytes; /** - * Creates the serialized form by calling {@link com.google.protobuf.MessageLite#toByteArray}. + * Creates the serialized form by calling {@link MessageLite#toByteArray}. * @param regularForm the message to serialize */ SerializedForm(MessageLite regularForm) { diff --git a/retrofit/src/main/java/com/google/protobuf/Internal.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Internal.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/Internal.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/Internal.java index 48d29e69f3..a332a2c5d3 100644 --- a/retrofit/src/main/java/com/google/protobuf/Internal.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Internal.java @@ -28,9 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; -import java.io.IOException; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.util.Arrays; diff --git a/retrofit/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/InvalidProtocolBufferException.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/InvalidProtocolBufferException.java index 367fa23ba3..b73b5afc7e 100644 --- a/retrofit/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/InvalidProtocolBufferException.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.IOException; diff --git a/retrofit/src/main/java/com/google/protobuf/LazyField.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyField.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/LazyField.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyField.java index 3da8b900e4..22a7a427b4 100644 --- a/retrofit/src/main/java/com/google/protobuf/LazyField.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyField.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.Iterator; import java.util.Map.Entry; diff --git a/retrofit/src/main/java/com/google/protobuf/LazyFieldLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyFieldLite.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/LazyFieldLite.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyFieldLite.java index 1fc80e8759..b6a00cf0d0 100644 --- a/retrofit/src/main/java/com/google/protobuf/LazyFieldLite.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyFieldLite.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.IOException; diff --git a/retrofit/src/main/java/com/google/protobuf/LazyStringArrayList.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringArrayList.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/LazyStringArrayList.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringArrayList.java index 61c7e1ea5f..704145824a 100644 --- a/retrofit/src/main/java/com/google/protobuf/LazyStringArrayList.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringArrayList.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.Arrays; import java.util.List; diff --git a/retrofit/src/main/java/com/google/protobuf/LazyStringList.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringList.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/LazyStringList.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringList.java index 235126b685..5561587812 100644 --- a/retrofit/src/main/java/com/google/protobuf/LazyStringList.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringList.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.Collection; import java.util.List; diff --git a/retrofit/src/main/java/com/google/protobuf/LiteralByteString.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LiteralByteString.java similarity index 98% rename from retrofit/src/main/java/com/google/protobuf/LiteralByteString.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/LiteralByteString.java index 83e71e9333..d2fb11246e 100644 --- a/retrofit/src/main/java/com/google/protobuf/LiteralByteString.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LiteralByteString.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -41,7 +41,7 @@ import java.util.NoSuchElementException; /** - * This class implements a {@link com.google.protobuf.ByteString} backed by a + * This class implements a {@link ByteString} backed by a * single array of bytes, contiguous in memory. It supports substring by * pointing to only a sub-range of the underlying byte array, meaning that a * substring will reference the full byte-array of the string it's made from, diff --git a/retrofit/src/main/java/com/google/protobuf/MessageLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLite.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/MessageLite.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLite.java index 798b79439c..908d38319c 100644 --- a/retrofit/src/main/java/com/google/protobuf/MessageLite.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLite.java @@ -31,7 +31,7 @@ // TODO(kenton): Use generics? E.g. Builder, then // mergeFrom*() could return BuilderType for better type-safety. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.IOException; import java.io.InputStream; diff --git a/retrofit/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLiteOrBuilder.java similarity index 98% rename from retrofit/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLiteOrBuilder.java index 818386ce58..c3fa05221c 100644 --- a/retrofit/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLiteOrBuilder.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; /** * Base interface for methods common to {@link MessageLite} diff --git a/retrofit/src/main/java/com/google/protobuf/Parser.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Parser.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/Parser.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/Parser.java index d852a5bb5f..beb2dde7c2 100644 --- a/retrofit/src/main/java/com/google/protobuf/Parser.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Parser.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.InputStream; diff --git a/retrofit/src/main/java/com/google/protobuf/ProtocolStringList.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ProtocolStringList.java similarity index 98% rename from retrofit/src/main/java/com/google/protobuf/ProtocolStringList.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/ProtocolStringList.java index d553b41e52..dcc2eaa5c0 100644 --- a/retrofit/src/main/java/com/google/protobuf/ProtocolStringList.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ProtocolStringList.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.List; diff --git a/retrofit/src/main/java/com/google/protobuf/RopeByteString.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/RopeByteString.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/RopeByteString.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/RopeByteString.java index d1655b80a9..735a36edd4 100644 --- a/retrofit/src/main/java/com/google/protobuf/RopeByteString.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/RopeByteString.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.io.IOException; import java.io.InputStream; @@ -158,7 +158,7 @@ static ByteString concatenate(ByteString left, ByteString right) { result = right; } else { int newLength = left.size() + right.size(); - if (newLength < ByteString.CONCATENATE_BY_COPY_SIZE) { + if (newLength < CONCATENATE_BY_COPY_SIZE) { // Optimization from BAP95: For short (leaves in paper, but just short // here) total length, do a copy of data to a new leaf. result = concatenateBytes(left, right); @@ -325,7 +325,7 @@ public ByteString substring(int beginIndex, int endIndex) { ByteString result; if (substringLength == 0) { // Empty substring - result = ByteString.EMPTY; + result = EMPTY; } else if (substringLength == totalLength) { // The whole string result = this; diff --git a/retrofit/src/main/java/com/google/protobuf/SmallSortedMap.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/SmallSortedMap.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/SmallSortedMap.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/SmallSortedMap.java index 0674d2e28e..12159fba86 100644 --- a/retrofit/src/main/java/com/google/protobuf/SmallSortedMap.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/SmallSortedMap.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.AbstractMap; import java.util.AbstractSet; diff --git a/retrofit/src/main/java/com/google/protobuf/UninitializedMessageException.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/UninitializedMessageException.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/UninitializedMessageException.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/UninitializedMessageException.java index 5714c063a9..f317d2930e 100644 --- a/retrofit/src/main/java/com/google/protobuf/UninitializedMessageException.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/UninitializedMessageException.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.Collections; import java.util.List; diff --git a/retrofit/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/UnmodifiableLazyStringList.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/UnmodifiableLazyStringList.java index 5cc005df88..d6ac17c751 100644 --- a/retrofit/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/UnmodifiableLazyStringList.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; import java.util.AbstractList; import java.util.Collection; diff --git a/retrofit/src/main/java/com/google/protobuf/Utf8.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Utf8.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/Utf8.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/Utf8.java index 4d0ef53ba9..66cefab42b 100644 --- a/retrofit/src/main/java/com/google/protobuf/Utf8.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Utf8.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; /** * A set of low-level, high-performance static utility methods related diff --git a/retrofit/src/main/java/com/google/protobuf/WireFormat.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/WireFormat.java similarity index 99% rename from retrofit/src/main/java/com/google/protobuf/WireFormat.java rename to retrofit/src/main/java/retrofit2/kotlin/protobuf/WireFormat.java index eba2528ec8..85d989ef3e 100644 --- a/retrofit/src/main/java/com/google/protobuf/WireFormat.java +++ b/retrofit/src/main/java/retrofit2/kotlin/protobuf/WireFormat.java @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.protobuf; +package retrofit2.kotlin.protobuf; /** * This class is used internally by the Protocol Buffer library and generated diff --git a/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readUtils.kt similarity index 72% rename from retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readUtils.kt index 847b3b0c93..9120c3f9de 100644 --- a/retrofit/src/main/java/kotlinx/metadata.impl/readUtils.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readUtils.kt @@ -3,10 +3,10 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.impl +package retrofit2.kotlinx.metadata.impl -import kotlinx.metadata.ClassName -import org.jetbrains.kotlin.metadata.deserialization.NameResolver +import retrofit2.kotlinx.metadata.ClassName +import retrofit2.kotlin.metadata.deserialization.NameResolver internal fun NameResolver.getClassName(index: Int): ClassName { val name = getQualifiedClassName(index) diff --git a/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readers.kt similarity index 80% rename from retrofit/src/main/java/kotlinx/metadata.impl/readers.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readers.kt index ed8987426a..02e0ad1682 100644 --- a/retrofit/src/main/java/kotlinx/metadata.impl/readers.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readers.kt @@ -3,14 +3,14 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.impl - -import kotlinx.metadata.* -import kotlinx.metadata.Flags // Don't remove this import. See KT-45553 -import kotlinx.metadata.impl.extensions.MetadataExtensions -import org.jetbrains.kotlin.metadata.ProtoBuf -import org.jetbrains.kotlin.metadata.deserialization.* -import org.jetbrains.kotlin.metadata.deserialization.Flags as F +package retrofit2.kotlinx.metadata.impl + +import retrofit2.kotlinx.metadata.impl.extensions.MetadataExtensions +import retrofit2.kotlin.metadata.ProtoBuf +import retrofit2.kotlin.metadata.deserialization.NameResolver +import retrofit2.kotlin.metadata.deserialization.TypeTable +import retrofit2.kotlin.metadata.deserialization.returnType +import retrofit2.kotlinx.metadata.* class ReadContext( val strings: NameResolver, diff --git a/retrofit/src/main/java/kotlinx/metadata/ClassName.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/ClassName.kt similarity index 96% rename from retrofit/src/main/java/kotlinx/metadata/ClassName.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/ClassName.kt index 6cab65d134..faa8086bc9 100644 --- a/retrofit/src/main/java/kotlinx/metadata/ClassName.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/ClassName.kt @@ -5,7 +5,7 @@ @file:JvmName("ClassNameKt") -package kotlinx.metadata +package retrofit2.kotlinx.metadata /** * A fully qualified name of a classifier from the Kotlin's point of view. May differ from the JVM name of the class diff --git a/retrofit/src/main/java/kotlinx/metadata/Flag.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flag.kt similarity index 92% rename from retrofit/src/main/java/kotlinx/metadata/Flag.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/Flag.kt index 0c9e803094..ff16df6be3 100644 --- a/retrofit/src/main/java/kotlinx/metadata/Flag.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flag.kt @@ -3,11 +3,10 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata +package retrofit2.kotlinx.metadata -import org.jetbrains.kotlin.metadata.ProtoBuf.* -import org.jetbrains.kotlin.metadata.deserialization.Flags as F -import org.jetbrains.kotlin.metadata.ProtoBuf.Class.Kind as ClassKind +import retrofit2.kotlin.metadata.ProtoBuf.* +import retrofit2.kotlin.metadata.deserialization.Flags as F /** * Represents a boolean flag that is either present or not in a Kotlin declaration. A "flag" is a boolean trait that is either present diff --git a/retrofit/src/main/java/kotlinx/metadata/Flags.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flags.kt similarity index 95% rename from retrofit/src/main/java/kotlinx/metadata/Flags.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/Flags.kt index 72bc003539..28390d96e0 100644 --- a/retrofit/src/main/java/kotlinx/metadata/Flags.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flags.kt @@ -5,7 +5,7 @@ @file:JvmName("FlagsKt") -package kotlinx.metadata +package retrofit2.kotlinx.metadata /** * Declaration flags are represented as bitmasks of this type. diff --git a/retrofit/src/main/java/kotlinx/metadata/InconsistentKotlinMetadataException.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/InconsistentKotlinMetadataException.kt similarity index 90% rename from retrofit/src/main/java/kotlinx/metadata/InconsistentKotlinMetadataException.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/InconsistentKotlinMetadataException.kt index 69c84d20f5..41c906710b 100644 --- a/retrofit/src/main/java/kotlinx/metadata/InconsistentKotlinMetadataException.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/InconsistentKotlinMetadataException.kt @@ -3,6 +3,6 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata +package retrofit2.kotlinx.metadata class InconsistentKotlinMetadataException(message: String, cause: Throwable? = null) : RuntimeException(message, cause) diff --git a/retrofit/src/main/java/kotlinx/metadata/extensions.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/extensions.kt similarity index 98% rename from retrofit/src/main/java/kotlinx/metadata/extensions.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/extensions.kt index 2f7f8214ea..3d578f67e8 100644 --- a/retrofit/src/main/java/kotlinx/metadata/extensions.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/extensions.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata +package retrofit2.kotlinx.metadata import kotlin.reflect.KClass diff --git a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/MetadataExtensions.kt similarity index 67% rename from retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/MetadataExtensions.kt index 168f058813..94282dcac4 100644 --- a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/MetadataExtensions.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/MetadataExtensions.kt @@ -3,13 +3,12 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.impl.extensions +package retrofit2.kotlinx.metadata.impl.extensions -import kotlinx.metadata.* -import kotlinx.metadata.impl.ReadContext -import kotlinx.metadata.jvm.impl.JvmMetadataExtensions -import org.jetbrains.kotlin.metadata.ProtoBuf -import java.util.* +import retrofit2.kotlinx.metadata.impl.ReadContext +import retrofit2.kotlinx.metadata.jvm.impl.JvmMetadataExtensions +import retrofit2.kotlin.metadata.ProtoBuf +import retrofit2.kotlinx.metadata.KmFunctionVisitor interface MetadataExtensions { diff --git a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionNodes.kt similarity index 71% rename from retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionNodes.kt index ab5db69d3f..aab0d756ea 100644 --- a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionNodes.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionNodes.kt @@ -3,9 +3,10 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.impl.extensions +package retrofit2.kotlinx.metadata.impl.extensions -import kotlinx.metadata.* +import retrofit2.kotlinx.metadata.KmExtensionVisitor +import retrofit2.kotlinx.metadata.KmFunctionExtensionVisitor interface KmExtension : KmExtensionVisitor { fun accept(visitor: V) diff --git a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionUtils.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionUtils.kt similarity index 84% rename from retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionUtils.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionUtils.kt index 6b7229ee31..b33793aeac 100644 --- a/retrofit/src/main/java/kotlinx/metadata/impl/extensions/extensionUtils.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionUtils.kt @@ -3,10 +3,9 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.impl.extensions +package retrofit2.kotlinx.metadata.impl.extensions -import kotlinx.metadata.KmExtensionType -import kotlinx.metadata.KmExtensionVisitor +import retrofit2.kotlinx.metadata.KmExtensionType internal fun > Collection.singleOfType(type: KmExtensionType): N { var result: N? = null diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/JvmMemberSignature.kt similarity index 90% rename from retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/JvmMemberSignature.kt index 61aada5654..0d7fdae955 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/JvmMemberSignature.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/JvmMemberSignature.kt @@ -3,9 +3,9 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.jvm +package retrofit2.kotlinx.metadata.jvm -import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMemberSignature as JvmMemberSignatureImpl +import retrofit2.kotlin.metadata.jvm.deserialization.JvmMemberSignature as JvmMemberSignatureImpl /** * A signature of a JVM method or field. diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassHeader.kt similarity index 97% rename from retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassHeader.kt index 67c6f08f9f..bc3f6b253c 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassHeader.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassHeader.kt @@ -5,9 +5,9 @@ @file:Suppress("MemberVisibilityCanBePrivate") -package kotlinx.metadata.jvm +package retrofit2.kotlinx.metadata.jvm -import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion +import retrofit2.kotlin.metadata.jvm.deserialization.JvmMetadataVersion /** * A mirror to the [Metadata] annotation on a JVM class file, containing the metadata of Kotlin declarations declared in the class file. diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassMetadata.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassMetadata.kt similarity index 88% rename from retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassMetadata.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassMetadata.kt index bd34b514d1..a86805bed2 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/KotlinClassMetadata.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassMetadata.kt @@ -3,12 +3,15 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.jvm +package retrofit2.kotlinx.metadata.jvm -import kotlinx.metadata.* -import kotlinx.metadata.impl.accept -import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion -import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil +import retrofit2.kotlinx.* +import retrofit2.kotlinx.metadata.impl.accept +import retrofit2.kotlin.metadata.jvm.deserialization.JvmMetadataVersion +import retrofit2.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil +import retrofit2.kotlinx.metadata.InconsistentKotlinMetadataException +import retrofit2.kotlinx.metadata.KmClass +import retrofit2.kotlinx.metadata.KmClassVisitor import kotlin.LazyThreadSafetyMode.PUBLICATION /** diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt similarity index 58% rename from retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt index 2f235755f8..6893d05d9f 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt @@ -3,16 +3,16 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.jvm.impl +package retrofit2.kotlinx.metadata.jvm.impl -import kotlinx.metadata.* -import kotlinx.metadata.impl.* -import kotlinx.metadata.impl.extensions.* -import kotlinx.metadata.jvm.* -import org.jetbrains.kotlin.metadata.ProtoBuf -import org.jetbrains.kotlin.metadata.deserialization.getExtensionOrNull -import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf -import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil +import retrofit2.kotlin.metadata.ProtoBuf +import retrofit2.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil +import retrofit2.kotlinx.metadata.KmFunctionVisitor +import retrofit2.kotlinx.metadata.impl.ReadContext +import retrofit2.kotlinx.metadata.impl.extensions.KmFunctionExtension +import retrofit2.kotlinx.metadata.impl.extensions.MetadataExtensions +import retrofit2.kotlinx.metadata.jvm.JvmFunctionExtensionVisitor +import retrofit2.kotlinx.metadata.jvm.wrapAsPublic internal class JvmMetadataExtensions : MetadataExtensions { diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt similarity index 69% rename from retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt index 00df1ce54c..b3a1987c15 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt @@ -3,11 +3,13 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.jvm.impl +package retrofit2.kotlinx.metadata.jvm.impl -import kotlinx.metadata.* -import kotlinx.metadata.impl.extensions.* -import kotlinx.metadata.jvm.* +import retrofit2.kotlinx.metadata.KmFunction +import retrofit2.kotlinx.metadata.KmFunctionExtensionVisitor +import retrofit2.kotlinx.metadata.impl.extensions.KmFunctionExtension +import retrofit2.kotlinx.metadata.jvm.JvmFunctionExtensionVisitor +import retrofit2.kotlinx.metadata.jvm.JvmMethodSignature internal val KmFunction.jvm: JvmFunctionExtension get() = visitExtensions(JvmFunctionExtensionVisitor.TYPE) as JvmFunctionExtension diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensionVisitors.kt similarity index 89% rename from retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensionVisitors.kt index 2c0789d247..cbf6100476 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensionVisitors.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensionVisitors.kt @@ -3,9 +3,10 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata.jvm +package retrofit2.kotlinx.metadata.jvm -import kotlinx.metadata.* +import retrofit2.kotlinx.metadata.KmExtensionType +import retrofit2.kotlinx.metadata.KmFunctionExtensionVisitor /** * A visitor to visit JVM extensions for a function. diff --git a/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensions.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensions.kt similarity index 80% rename from retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensions.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensions.kt index f2d4468717..4438fb5a81 100644 --- a/retrofit/src/main/java/kotlinx/metadata/jvm/jvmExtensions.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensions.kt @@ -5,10 +5,10 @@ @file:Suppress("unused") -package kotlinx.metadata.jvm +package retrofit2.kotlinx.metadata.jvm -import kotlinx.metadata.* -import kotlinx.metadata.jvm.impl.jvm +import retrofit2.kotlinx.metadata.jvm.impl.jvm +import retrofit2.kotlinx.metadata.KmFunction /** * JVM signature of the function, or null if the JVM signature of this function is unknown. diff --git a/retrofit/src/main/java/kotlinx/metadata/nodes.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/nodes.kt similarity index 92% rename from retrofit/src/main/java/kotlinx/metadata/nodes.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/nodes.kt index 137f074b9c..90466295cb 100644 --- a/retrofit/src/main/java/kotlinx/metadata/nodes.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/nodes.kt @@ -5,9 +5,12 @@ @file:Suppress("MemberVisibilityCanBePrivate") -package kotlinx.metadata +package retrofit2.kotlinx.metadata -import kotlinx.metadata.impl.extensions.* +import retrofit2.kotlinx.metadata.impl.extensions.* +import retrofit2.kotlinx.metadata.impl.extensions.KmFunctionExtension +import retrofit2.kotlinx.metadata.impl.extensions.MetadataExtensions +import retrofit2.kotlinx.metadata.impl.extensions.singleOfType import java.lang.IllegalStateException /** diff --git a/retrofit/src/main/java/kotlinx/metadata/visitors.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/visitors.kt similarity index 98% rename from retrofit/src/main/java/kotlinx/metadata/visitors.kt rename to retrofit/src/main/java/retrofit2/kotlinx/metadata/visitors.kt index b07c810d5b..dd03d99697 100644 --- a/retrofit/src/main/java/kotlinx/metadata/visitors.kt +++ b/retrofit/src/main/java/retrofit2/kotlinx/metadata/visitors.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package kotlinx.metadata +package retrofit2.kotlinx.metadata /** * A visitor to visit Kotlin classes, including interfaces, objects, enum classes and annotation classes. From b43c8a63d36d91d4cfce298527d1431df09c1d96 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Tue, 20 Apr 2021 11:11:59 +0200 Subject: [PATCH 04/15] Move metadata parsing to separate object --- .../java/retrofit2/HttpServiceMethod.java | 3 +- .../main/java/retrofit2/KotlinExtensions.kt | 64 ------------- .../src/main/java/retrofit2/KotlinMetadata.kt | 93 +++++++++++++++++++ 3 files changed, 94 insertions(+), 66 deletions(-) create mode 100644 retrofit/src/main/java/retrofit2/KotlinMetadata.kt diff --git a/retrofit/src/main/java/retrofit2/HttpServiceMethod.java b/retrofit/src/main/java/retrofit2/HttpServiceMethod.java index b64bb315e9..a046634f99 100644 --- a/retrofit/src/main/java/retrofit2/HttpServiceMethod.java +++ b/retrofit/src/main/java/retrofit2/HttpServiceMethod.java @@ -15,7 +15,6 @@ */ package retrofit2; -import static retrofit2.KotlinExtensions.isReturnTypeNullable; import static retrofit2.Utils.getRawType; import static retrofit2.Utils.methodError; @@ -52,7 +51,7 @@ static HttpServiceMethod parseAnnotatio responseType = Utils.getParameterUpperBound(0, (ParameterizedType) responseType); continuationWantsResponse = true; } else { - continuationBodyNullable = isReturnTypeNullable(method); + continuationBodyNullable = KotlinMetadata.isReturnTypeNullable(method); } adapterType = new Utils.ParameterizedTypeImpl(null, Call.class, responseType); diff --git a/retrofit/src/main/java/retrofit2/KotlinExtensions.kt b/retrofit/src/main/java/retrofit2/KotlinExtensions.kt index f3ce9173e5..6202abef76 100644 --- a/retrofit/src/main/java/retrofit2/KotlinExtensions.kt +++ b/retrofit/src/main/java/retrofit2/KotlinExtensions.kt @@ -20,12 +20,6 @@ package retrofit2 import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.suspendCancellableCoroutine -import retrofit2.kotlinx.metadata.Flag -import retrofit2.kotlinx.metadata.KmClassifier -import retrofit2.kotlinx.metadata.jvm.KotlinClassHeader -import retrofit2.kotlinx.metadata.jvm.KotlinClassMetadata -import retrofit2.kotlinx.metadata.jvm.signature -import java.lang.reflect.Method import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED import kotlin.coroutines.intrinsics.intercepted import kotlin.coroutines.intrinsics.suspendCoroutineUninterceptedOrReturn @@ -123,61 +117,3 @@ internal suspend fun Exception.suspendAndThrow(): Nothing { COROUTINE_SUSPENDED } } - -internal fun isReturnTypeNullable(method: Method): Boolean { - val declaringClass = method.declaringClass - val metadataAnnotation = declaringClass.getAnnotation(Metadata::class.java) - - val header = KotlinClassHeader( - kind = metadataAnnotation.kind, - metadataVersion = metadataAnnotation.metadataVersion, - data1 = metadataAnnotation.data1, - data2 = metadataAnnotation.data2, - extraString = metadataAnnotation.extraString, - extraInt = metadataAnnotation.extraInt, - packageName = metadataAnnotation.packageName - ) - - val classMetadata = KotlinClassMetadata.read(header) - val kmClass = (classMetadata as KotlinClassMetadata.Class).toKmClass() - - val javaMethodSignature = method.createSignature() - val candidates = kmClass.functions.filter { it.signature?.asString() == javaMethodSignature } - - require(candidates.isNotEmpty()) { "No match found in metadata for '${method}'" } - require(candidates.size == 1) { "Multiple function matches found in metadata for '${method}'" } - val match = candidates.first() - - return Flag.Type.IS_NULLABLE(match.returnType.flags) || match.returnType.classifier == KmClassifier.Class("kotlin/Unit") -} - -private fun Method.createSignature() = buildString { - append(name) - append('(') - - parameterTypes.forEach { - append(it.typeToSignature()) - } - - append(')') - - append(returnType.typeToSignature()) -} - -private fun Class<*>.typeToSignature() = when { - isPrimitive -> javaTypesMap[name] - isArray -> name.replace('.', '/') - else -> "L${name.replace('.', '/')};" -} - -private val javaTypesMap = mapOf( - "int" to "I", - "long" to "J", - "boolean" to "Z", - "byte" to "B", - "char" to "C", - "float" to "F", - "double" to "D", - "short" to "S", - "void" to "V" -) diff --git a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt new file mode 100644 index 0000000000..1ccfd1e2c4 --- /dev/null +++ b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt @@ -0,0 +1,93 @@ +package retrofit2 + +import retrofit2.kotlinx.metadata.Flag +import retrofit2.kotlinx.metadata.KmClassifier +import retrofit2.kotlinx.metadata.KmFunction +import retrofit2.kotlinx.metadata.jvm.KotlinClassHeader +import retrofit2.kotlinx.metadata.jvm.KotlinClassMetadata +import retrofit2.kotlinx.metadata.jvm.signature +import java.lang.reflect.Method +import java.util.concurrent.ConcurrentHashMap + +object KotlinMetadata { + + private val kotlinFunctionsMap = ConcurrentHashMap, List>() + + @JvmStatic fun isReturnTypeNullable(method: Method): Boolean { + val javaMethodSignature = method.createSignature() + val kotlinFunctions = loadKotlinFunctions(method.declaringClass) + val candidates = kotlinFunctions.filter { it.signature?.asString() == javaMethodSignature } + + require(candidates.isNotEmpty()) { "No match found in metadata for '${method}'" } + require(candidates.size == 1) { "Multiple function matches found in metadata for '${method}'" } + val match = candidates.first() + + val isNullable = Flag.Type.IS_NULLABLE(match.returnType.flags) + val isUnit = match.returnType.classifier == KmClassifier.Class("kotlin/Unit") + return isNullable || isUnit + } + + private fun Method.createSignature() = buildString { + append(name) + append('(') + + parameterTypes.forEach { + append(it.typeToSignature()) + } + + append(')') + + append(returnType.typeToSignature()) + } + + private fun loadKotlinFunctions(clazz: Class<*>): List { + var result = kotlinFunctionsMap[clazz] + if (result != null) return result + + synchronized(kotlinFunctionsMap) { + result = kotlinFunctionsMap[clazz] + if (result == null) { + result = readFunctionsFromMetadata(clazz) + } + } + + return result!! + } + + private fun readFunctionsFromMetadata(clazz: Class<*>): List { + val metadataAnnotation = clazz.getAnnotation(Metadata::class.java) + + val header = KotlinClassHeader( + kind = metadataAnnotation.kind, + metadataVersion = metadataAnnotation.metadataVersion, + data1 = metadataAnnotation.data1, + data2 = metadataAnnotation.data2, + extraString = metadataAnnotation.extraString, + extraInt = metadataAnnotation.extraInt, + packageName = metadataAnnotation.packageName + ) + + val classMetadata = KotlinClassMetadata.read(header) + val kmClass = (classMetadata as KotlinClassMetadata.Class).toKmClass() + + return kmClass.functions + } + + private fun Class<*>.typeToSignature() = when { + isPrimitive -> javaTypesMap[name] + isArray -> name.replace('.', '/') + else -> "L${name.replace('.', '/')};" + } + + private val javaTypesMap = mapOf( + "int" to "I", + "long" to "J", + "boolean" to "Z", + "byte" to "B", + "char" to "C", + "float" to "F", + "double" to "D", + "short" to "S", + "void" to "V" + ) +} \ No newline at end of file From 839b189974547dfb84af20733e3e338310272492 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Wed, 21 Apr 2021 01:35:10 +0200 Subject: [PATCH 05/15] Use custom metadata parsing --- .../src/main/java/retrofit2/KotlinMetadata.kt | 47 +- .../retrofit2/kotlin/metadata/ProtoBuf.java | 24394 ---------------- .../deserialization/BitEncoding.java | 5 +- .../metadata/deserialization/Flags.java | 42 - .../deserialization/JvmMetadataVersion.kt | 2 +- .../deserialization/MetadataParser.kt | 193 + .../metadata/deserialization/NameResolver.kt | 17 - .../metadata/deserialization/ProtoBufUtil.kt | 12 - .../metadata/deserialization/ProtobufUtils.kt | 95 + .../metadata/deserialization/TypeTable.kt | 35 - .../deserialization/VersionRequirement.kt | 21 - .../deserialization/protoTypeTableUtil.kt | 37 - .../{jvm => }/deserialization/utfEncoding.kt | 2 +- .../kotlin/metadata/jvm/JvmProtoBuf.java | 2434 -- .../jvm/deserialization/ClassMapperLite.kt | 82 - .../jvm/deserialization/JvmMemberSignature.kt | 29 - .../jvm/deserialization/JvmNameResolver.kt | 116 - .../jvm/deserialization/JvmProtoBufUtil.kt | 56 - .../kotlin/protobuf/AbstractMessageLite.java | 356 - .../kotlin/protobuf/AbstractParser.java | 243 - .../kotlin/protobuf/BoundedByteString.java | 163 - .../retrofit2/kotlin/protobuf/ByteString.java | 1022 - .../kotlin/protobuf/CodedInputStream.java | 1311 - .../kotlin/protobuf/CodedOutputStream.java | 1297 - .../protobuf/ExtensionRegistryLite.java | 186 - .../retrofit2/kotlin/protobuf/FieldSet.java | 905 - .../kotlin/protobuf/GeneratedMessageLite.java | 960 - .../retrofit2/kotlin/protobuf/Internal.java | 390 - .../InvalidProtocolBufferException.java | 122 - .../retrofit2/kotlin/protobuf/LazyField.java | 154 - .../kotlin/protobuf/LazyFieldLite.java | 176 - .../kotlin/protobuf/LazyStringArrayList.java | 367 - .../kotlin/protobuf/LazyStringList.java | 163 - .../kotlin/protobuf/LiteralByteString.java | 362 - .../kotlin/protobuf/MessageLite.java | 320 - .../kotlin/protobuf/MessageLiteOrBuilder.java | 60 - .../retrofit2/kotlin/protobuf/Parser.java | 197 - .../kotlin/protobuf/ProtocolStringList.java | 48 - .../kotlin/protobuf/RopeByteString.java | 957 - .../kotlin/protobuf/SmallSortedMap.java | 618 - .../UninitializedMessageException.java | 99 - .../protobuf/UnmodifiableLazyStringList.java | 205 - .../java/retrofit2/kotlin/protobuf/Utf8.java | 349 - .../retrofit2/kotlin/protobuf/WireFormat.java | 163 - .../kotlinx/metadata.impl/readUtils.kt | 14 - .../kotlinx/metadata.impl/readers.kt | 63 - .../retrofit2/kotlinx/metadata/ClassName.kt | 20 - .../java/retrofit2/kotlinx/metadata/Flag.kt | 63 - .../java/retrofit2/kotlinx/metadata/Flags.kt | 25 - .../InconsistentKotlinMetadataException.kt | 8 - .../retrofit2/kotlinx/metadata/extensions.kt | 105 - .../impl/extensions/MetadataExtensions.kt | 24 - .../impl/extensions/extensionNodes.kt | 15 - .../impl/extensions/extensionUtils.kt | 23 - .../metadata/jvm/JvmMemberSignature.kt | 44 - .../kotlinx/metadata/jvm/KotlinClassHeader.kt | 138 - .../metadata/jvm/KotlinClassMetadata.kt | 81 - .../jvm/impl/JvmMetadataExtensions.kt | 27 - .../metadata/jvm/impl/jvmExtensionNodes.kt | 31 - .../metadata/jvm/jvmExtensionVisitors.kt | 47 - .../kotlinx/metadata/jvm/jvmExtensions.kt | 22 - .../java/retrofit2/kotlinx/metadata/nodes.kt | 129 - .../retrofit2/kotlinx/metadata/visitors.kt | 71 - .../test/java/retrofit2/KotlinSuspendTest.kt | 48 +- 64 files changed, 360 insertions(+), 39450 deletions(-) delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/ProtoBuf.java rename retrofit/src/main/java/retrofit2/kotlin/metadata/{jvm => }/deserialization/BitEncoding.java (96%) delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Flags.java rename retrofit/src/main/java/retrofit2/kotlin/metadata/{jvm => }/deserialization/JvmMetadataVersion.kt (96%) create mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/NameResolver.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtoBufUtil.kt create mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/TypeTable.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/VersionRequirement.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/protoTypeTableUtil.kt rename retrofit/src/main/java/retrofit2/kotlin/metadata/{jvm => }/deserialization/utfEncoding.kt (95%) delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/JvmProtoBuf.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractMessageLite.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractParser.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/BoundedByteString.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/ByteString.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedInputStream.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedOutputStream.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/ExtensionRegistryLite.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/FieldSet.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/GeneratedMessageLite.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/Internal.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/InvalidProtocolBufferException.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyField.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyFieldLite.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringArrayList.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringList.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/LiteralByteString.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLite.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLiteOrBuilder.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/Parser.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/ProtocolStringList.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/RopeByteString.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/SmallSortedMap.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/UninitializedMessageException.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/UnmodifiableLazyStringList.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/Utf8.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlin/protobuf/WireFormat.java delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readUtils.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readers.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/ClassName.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/Flag.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/Flags.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/InconsistentKotlinMetadataException.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/extensions.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/MetadataExtensions.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionNodes.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionUtils.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/JvmMemberSignature.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassHeader.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassMetadata.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensionVisitors.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensions.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/nodes.kt delete mode 100644 retrofit/src/main/java/retrofit2/kotlinx/metadata/visitors.kt diff --git a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt index 1ccfd1e2c4..fd2d493dc6 100644 --- a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt +++ b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt @@ -1,30 +1,27 @@ package retrofit2 -import retrofit2.kotlinx.metadata.Flag -import retrofit2.kotlinx.metadata.KmClassifier -import retrofit2.kotlinx.metadata.KmFunction -import retrofit2.kotlinx.metadata.jvm.KotlinClassHeader -import retrofit2.kotlinx.metadata.jvm.KotlinClassMetadata -import retrofit2.kotlinx.metadata.jvm.signature +import retrofit2.kotlin.metadata.deserialization.* +import java.io.ByteArrayInputStream import java.lang.reflect.Method import java.util.concurrent.ConcurrentHashMap object KotlinMetadata { - private val kotlinFunctionsMap = ConcurrentHashMap, List>() + data class Function(val signature: String, val returnType: ReturnType) + data class ReturnType(val isNullable: Boolean, val isUnit: Boolean) + + private val kotlinFunctionsMap = ConcurrentHashMap, List>() @JvmStatic fun isReturnTypeNullable(method: Method): Boolean { val javaMethodSignature = method.createSignature() val kotlinFunctions = loadKotlinFunctions(method.declaringClass) - val candidates = kotlinFunctions.filter { it.signature?.asString() == javaMethodSignature } + val candidates = kotlinFunctions.filter { it.signature == javaMethodSignature } require(candidates.isNotEmpty()) { "No match found in metadata for '${method}'" } require(candidates.size == 1) { "Multiple function matches found in metadata for '${method}'" } val match = candidates.first() - val isNullable = Flag.Type.IS_NULLABLE(match.returnType.flags) - val isUnit = match.returnType.classifier == KmClassifier.Class("kotlin/Unit") - return isNullable || isUnit + return match.returnType.isNullable || match.returnType.isUnit } private fun Method.createSignature() = buildString { @@ -40,7 +37,7 @@ object KotlinMetadata { append(returnType.typeToSignature()) } - private fun loadKotlinFunctions(clazz: Class<*>): List { + private fun loadKotlinFunctions(clazz: Class<*>): List { var result = kotlinFunctionsMap[clazz] if (result != null) return result @@ -54,23 +51,21 @@ object KotlinMetadata { return result!! } - private fun readFunctionsFromMetadata(clazz: Class<*>): List { + private fun readFunctionsFromMetadata(clazz: Class<*>): List { val metadataAnnotation = clazz.getAnnotation(Metadata::class.java) - val header = KotlinClassHeader( - kind = metadataAnnotation.kind, - metadataVersion = metadataAnnotation.metadataVersion, - data1 = metadataAnnotation.data1, - data2 = metadataAnnotation.data2, - extraString = metadataAnnotation.extraString, - extraInt = metadataAnnotation.extraInt, - packageName = metadataAnnotation.packageName - ) + val isStrictSemantics = (metadataAnnotation.extraInt and (1 shl 3)) != 0 + val isCompatible = JvmMetadataVersion(metadataAnnotation.metadataVersion, isStrictSemantics).isCompatible() + + require(isCompatible) { "Metadata version not compatible" } + require(metadataAnnotation.kind == 1) { "Metadata of wrong kind: ${metadataAnnotation.kind}" } + require(metadataAnnotation.data1.isNotEmpty()) { "data1 must not be empty" } - val classMetadata = KotlinClassMetadata.read(header) - val kmClass = (classMetadata as KotlinClassMetadata.Class).toKmClass() + val bytes = BitEncoding.decodeBytes(metadataAnnotation.data1) + val stream = ByteArrayInputStream(bytes) + val parser = MetadataParser(metadataAnnotation.data2, stream) - return kmClass.functions + return parser.parseClass() } private fun Class<*>.typeToSignature() = when { @@ -90,4 +85,4 @@ object KotlinMetadata { "short" to "S", "void" to "V" ) -} \ No newline at end of file +} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/ProtoBuf.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/ProtoBuf.java deleted file mode 100644 index b0ef82fc75..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/ProtoBuf.java +++ /dev/null @@ -1,24394 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: core/metadata/src/metadata.proto - -package retrofit2.kotlin.metadata; - -import retrofit2.kotlin.protobuf.*; - -public final class ProtoBuf { - private ProtoBuf() {} - - public interface StringTableOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.StringTable) - MessageLiteOrBuilder { - - /** - * repeated string string = 1; - */ - ProtocolStringList - getStringList(); - /** - * repeated string string = 1; - */ - int getStringCount(); - /** - * repeated string string = 1; - */ - java.lang.String getString(int index); - /** - * repeated string string = 1; - */ - ByteString - getStringBytes(int index); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.StringTable} - */ - public static final class StringTable extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.StringTable) - StringTableOrBuilder { - // Use StringTable.newBuilder() to construct. - private StringTable(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private StringTable(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final StringTable defaultInstance; - public static StringTable getDefaultInstance() { - return defaultInstance; - } - - @Override public StringTable getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private StringTable( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - ByteString bs = input.readBytes(); - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - string_ = new LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - string_.add(bs); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - string_ = string_.getUnmodifiableView(); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - @Override public StringTable parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new StringTable(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - public static final int STRING_FIELD_NUMBER = 1; - private LazyStringList string_; - /** - * repeated string string = 1; - */ - @Override public ProtocolStringList - getStringList() { - return string_; - } - /** - * repeated string string = 1; - */ - @Override public int getStringCount() { - return string_.size(); - } - /** - * repeated string string = 1; - */ - @Override public java.lang.String getString(int index) { - return string_.get(index); - } - /** - * repeated string string = 1; - */ - @Override public ByteString - getStringBytes(int index) { - return string_.getByteString(index); - } - - private void initFields() { - string_ = LazyStringArrayList.EMPTY; - } - private byte memoizedIsInitialized = -1; - @Override public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < string_.size(); i++) { - output.writeBytes(1, string_.getByteString(i)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < string_.size(); i++) { - dataSize += CodedOutputStream - .computeBytesSizeNoTag(string_.getByteString(i)); - } - size += dataSize; - size += 1 * getStringList().size(); - } - size += unknownFields.size(); - 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 ProtoBuf.StringTable parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.StringTable parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.StringTable parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.StringTable parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.StringTable parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.StringTable parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.StringTable parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.StringTable parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.StringTable parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.StringTable parseFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(ProtoBuf.StringTable prototype) { - return newBuilder().mergeFrom(prototype); - } - @Override public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.StringTable} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.StringTable, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.StringTable) - ProtoBuf.StringTableOrBuilder { - // Construct using ProtoBuf.StringTable.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override public Builder clear() { - super.clear(); - string_ = LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @Override public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override public ProtoBuf.StringTable getDefaultInstanceForType() { - return ProtoBuf.StringTable.getDefaultInstance(); - } - - @Override public ProtoBuf.StringTable build() { - ProtoBuf.StringTable result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override public ProtoBuf.StringTable buildPartial() { - ProtoBuf.StringTable result = new ProtoBuf.StringTable(this); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - string_ = string_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.string_ = string_; - return result; - } - - @Override public Builder mergeFrom(ProtoBuf.StringTable other) { - if (other == ProtoBuf.StringTable.getDefaultInstance()) return this; - if (!other.string_.isEmpty()) { - if (string_.isEmpty()) { - string_ = other.string_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureStringIsMutable(); - string_.addAll(other.string_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override public final boolean isInitialized() { - return true; - } - - @Override public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.StringTable parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.StringTable) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private LazyStringList string_ = LazyStringArrayList.EMPTY; - private void ensureStringIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - string_ = new LazyStringArrayList(string_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string string = 1; - */ - @Override public ProtocolStringList - getStringList() { - return string_.getUnmodifiableView(); - } - /** - * repeated string string = 1; - */ - @Override public int getStringCount() { - return string_.size(); - } - /** - * repeated string string = 1; - */ - @Override public java.lang.String getString(int index) { - return string_.get(index); - } - /** - * repeated string string = 1; - */ - @Override public ByteString - getStringBytes(int index) { - return string_.getByteString(index); - } - /** - * repeated string string = 1; - */ - public Builder setString( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStringIsMutable(); - string_.set(index, value); - - return this; - } - /** - * repeated string string = 1; - */ - public Builder addString( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStringIsMutable(); - string_.add(value); - - return this; - } - /** - * repeated string string = 1; - */ - public Builder addAllString( - java.lang.Iterable values) { - ensureStringIsMutable(); - AbstractMessageLite.Builder.addAll( - values, string_); - - return this; - } - /** - * repeated string string = 1; - */ - public Builder clearString() { - string_ = LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated string string = 1; - */ - public Builder addStringBytes( - ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStringIsMutable(); - string_.add(value); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.StringTable) - } - - static { - defaultInstance = new StringTable(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.StringTable) - } - - public interface QualifiedNameTableOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.QualifiedNameTable) - MessageLiteOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - java.util.List - getQualifiedNameList(); - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - int getQualifiedNameCount(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable} - */ - public static final class QualifiedNameTable extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable) - QualifiedNameTableOrBuilder { - // Use QualifiedNameTable.newBuilder() to construct. - private QualifiedNameTable(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private QualifiedNameTable(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final QualifiedNameTable defaultInstance; - public static QualifiedNameTable getDefaultInstance() { - return defaultInstance; - } - - @Override public QualifiedNameTable getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private QualifiedNameTable( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - qualifiedName_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - qualifiedName_.add(input.readMessage(ProtoBuf.QualifiedNameTable.QualifiedName.PARSER, extensionRegistry)); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - qualifiedName_ = java.util.Collections.unmodifiableList(qualifiedName_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - @Override public QualifiedNameTable parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new QualifiedNameTable(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - public interface QualifiedNameOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) - MessageLiteOrBuilder { - - /** - * optional int32 parent_qualified_name = 1 [default = -1]; - */ - boolean hasParentQualifiedName(); - /** - * optional int32 parent_qualified_name = 1 [default = -1]; - */ - int getParentQualifiedName(); - - /** - * required int32 short_name = 2; - * - *
-       * id in the StringTable
-       * 
- */ - boolean hasShortName(); - /** - * required int32 short_name = 2; - * - *
-       * id in the StringTable
-       * 
- */ - int getShortName(); - - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; - */ - boolean hasKind(); - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; - */ - ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName} - */ - public static final class QualifiedName extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) - QualifiedNameOrBuilder { - // Use QualifiedName.newBuilder() to construct. - private QualifiedName(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private QualifiedName(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final QualifiedName defaultInstance; - public static QualifiedName getDefaultInstance() { - return defaultInstance; - } - - @Override public QualifiedName getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private QualifiedName( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - parentQualifiedName_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - shortName_ = input.readInt32(); - break; - } - case 24: { - int rawValue = input.readEnum(); - ProtoBuf.QualifiedNameTable.QualifiedName.Kind value = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000004; - kind_ = value; - } - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - @Override public QualifiedName parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new QualifiedName(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind} - */ - public enum Kind - implements Internal.EnumLite { - /** - * CLASS = 0; - */ - CLASS(0, 0), - /** - * PACKAGE = 1; - */ - PACKAGE(1, 1), - /** - * LOCAL = 2; - */ - LOCAL(2, 2), - ; - - /** - * CLASS = 0; - */ - public static final int CLASS_VALUE = 0; - /** - * PACKAGE = 1; - */ - public static final int PACKAGE_VALUE = 1; - /** - * LOCAL = 2; - */ - public static final int LOCAL_VALUE = 2; - - - @Override public final int getNumber() { return value; } - - public static Kind valueOf(int value) { - switch (value) { - case 0: return CLASS; - case 1: return PACKAGE; - case 2: return LOCAL; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - @Override public Kind findValueByNumber(int number) { - return Kind.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Kind(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind) - } - - private int bitField0_; - public static final int PARENT_QUALIFIED_NAME_FIELD_NUMBER = 1; - private int parentQualifiedName_; - /** - * optional int32 parent_qualified_name = 1 [default = -1]; - */ - @Override public boolean hasParentQualifiedName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 parent_qualified_name = 1 [default = -1]; - */ - @Override public int getParentQualifiedName() { - return parentQualifiedName_; - } - - public static final int SHORT_NAME_FIELD_NUMBER = 2; - private int shortName_; - /** - * required int32 short_name = 2; - * - *
-       * id in the StringTable
-       * 
- */ - @Override public boolean hasShortName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 short_name = 2; - * - *
-       * id in the StringTable
-       * 
- */ - @Override public int getShortName() { - return shortName_; - } - - public static final int KIND_FIELD_NUMBER = 3; - private ProtoBuf.QualifiedNameTable.QualifiedName.Kind kind_; - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; - */ - @Override public boolean hasKind() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; - */ - @Override public ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind() { - return kind_; - } - - private void initFields() { - parentQualifiedName_ = -1; - shortName_ = 0; - kind_ = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; - } - private byte memoizedIsInitialized = -1; - @Override public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasShortName()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - @Override public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, parentQualifiedName_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, shortName_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeEnum(3, kind_.getNumber()); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, parentQualifiedName_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(2, shortName_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeEnumSize(3, kind_.getNumber()); - } - size += unknownFields.size(); - 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 ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.QualifiedNameTable.QualifiedName parseFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(ProtoBuf.QualifiedNameTable.QualifiedName prototype) { - return newBuilder().mergeFrom(prototype); - } - @Override public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.QualifiedNameTable.QualifiedName, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) - ProtoBuf.QualifiedNameTable.QualifiedNameOrBuilder { - // Construct using ProtoBuf.QualifiedNameTable.QualifiedName.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override public Builder clear() { - super.clear(); - parentQualifiedName_ = -1; - bitField0_ = (bitField0_ & ~0x00000001); - shortName_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - kind_ = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - @Override public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override public ProtoBuf.QualifiedNameTable.QualifiedName getDefaultInstanceForType() { - return ProtoBuf.QualifiedNameTable.QualifiedName.getDefaultInstance(); - } - - @Override public ProtoBuf.QualifiedNameTable.QualifiedName build() { - ProtoBuf.QualifiedNameTable.QualifiedName result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override public ProtoBuf.QualifiedNameTable.QualifiedName buildPartial() { - ProtoBuf.QualifiedNameTable.QualifiedName result = new ProtoBuf.QualifiedNameTable.QualifiedName(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.parentQualifiedName_ = parentQualifiedName_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.shortName_ = shortName_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.kind_ = kind_; - result.bitField0_ = to_bitField0_; - return result; - } - - @Override public Builder mergeFrom(ProtoBuf.QualifiedNameTable.QualifiedName other) { - if (other == ProtoBuf.QualifiedNameTable.QualifiedName.getDefaultInstance()) return this; - if (other.hasParentQualifiedName()) { - setParentQualifiedName(other.getParentQualifiedName()); - } - if (other.hasShortName()) { - setShortName(other.getShortName()); - } - if (other.hasKind()) { - setKind(other.getKind()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override public final boolean isInitialized() { - if (!hasShortName()) { - - return false; - } - return true; - } - - @Override public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.QualifiedNameTable.QualifiedName parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.QualifiedNameTable.QualifiedName) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int parentQualifiedName_ = -1; - /** - * optional int32 parent_qualified_name = 1 [default = -1]; - */ - @Override public boolean hasParentQualifiedName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 parent_qualified_name = 1 [default = -1]; - */ - @Override public int getParentQualifiedName() { - return parentQualifiedName_; - } - /** - * optional int32 parent_qualified_name = 1 [default = -1]; - */ - public Builder setParentQualifiedName(int value) { - bitField0_ |= 0x00000001; - parentQualifiedName_ = value; - - return this; - } - /** - * optional int32 parent_qualified_name = 1 [default = -1]; - */ - public Builder clearParentQualifiedName() { - bitField0_ = (bitField0_ & ~0x00000001); - parentQualifiedName_ = -1; - - return this; - } - - private int shortName_ ; - /** - * required int32 short_name = 2; - * - *
-         * id in the StringTable
-         * 
- */ - @Override public boolean hasShortName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 short_name = 2; - * - *
-         * id in the StringTable
-         * 
- */ - @Override public int getShortName() { - return shortName_; - } - /** - * required int32 short_name = 2; - * - *
-         * id in the StringTable
-         * 
- */ - public Builder setShortName(int value) { - bitField0_ |= 0x00000002; - shortName_ = value; - - return this; - } - /** - * required int32 short_name = 2; - * - *
-         * id in the StringTable
-         * 
- */ - public Builder clearShortName() { - bitField0_ = (bitField0_ & ~0x00000002); - shortName_ = 0; - - return this; - } - - private ProtoBuf.QualifiedNameTable.QualifiedName.Kind kind_ = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; - */ - @Override public boolean hasKind() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; - */ - @Override public ProtoBuf.QualifiedNameTable.QualifiedName.Kind getKind() { - return kind_; - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; - */ - public Builder setKind(ProtoBuf.QualifiedNameTable.QualifiedName.Kind value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - kind_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName.Kind kind = 3 [default = PACKAGE]; - */ - public Builder clearKind() { - bitField0_ = (bitField0_ & ~0x00000004); - kind_ = ProtoBuf.QualifiedNameTable.QualifiedName.Kind.PACKAGE; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) - } - - static { - defaultInstance = new QualifiedName(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName) - } - - public static final int QUALIFIED_NAME_FIELD_NUMBER = 1; - private java.util.List qualifiedName_; - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - @Override public java.util.List getQualifiedNameList() { - return qualifiedName_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public java.util.List - getQualifiedNameOrBuilderList() { - return qualifiedName_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - @Override public int getQualifiedNameCount() { - return qualifiedName_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - @Override public ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index) { - return qualifiedName_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public ProtoBuf.QualifiedNameTable.QualifiedNameOrBuilder getQualifiedNameOrBuilder( - int index) { - return qualifiedName_.get(index); - } - - private void initFields() { - qualifiedName_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - @Override public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getQualifiedNameCount(); i++) { - if (!getQualifiedName(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - @Override public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < qualifiedName_.size(); i++) { - output.writeMessage(1, qualifiedName_.get(i)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < qualifiedName_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(1, qualifiedName_.get(i)); - } - size += unknownFields.size(); - 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 ProtoBuf.QualifiedNameTable parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.QualifiedNameTable parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.QualifiedNameTable parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.QualifiedNameTable parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.QualifiedNameTable parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.QualifiedNameTable parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.QualifiedNameTable parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.QualifiedNameTable parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.QualifiedNameTable parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.QualifiedNameTable parseFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(ProtoBuf.QualifiedNameTable prototype) { - return newBuilder().mergeFrom(prototype); - } - @Override public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.QualifiedNameTable} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.QualifiedNameTable, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.QualifiedNameTable) - ProtoBuf.QualifiedNameTableOrBuilder { - // Construct using ProtoBuf.QualifiedNameTable.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override public Builder clear() { - super.clear(); - qualifiedName_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @Override public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override public ProtoBuf.QualifiedNameTable getDefaultInstanceForType() { - return ProtoBuf.QualifiedNameTable.getDefaultInstance(); - } - - @Override public ProtoBuf.QualifiedNameTable build() { - ProtoBuf.QualifiedNameTable result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override public ProtoBuf.QualifiedNameTable buildPartial() { - ProtoBuf.QualifiedNameTable result = new ProtoBuf.QualifiedNameTable(this); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - qualifiedName_ = java.util.Collections.unmodifiableList(qualifiedName_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.qualifiedName_ = qualifiedName_; - return result; - } - - @Override public Builder mergeFrom(ProtoBuf.QualifiedNameTable other) { - if (other == ProtoBuf.QualifiedNameTable.getDefaultInstance()) return this; - if (!other.qualifiedName_.isEmpty()) { - if (qualifiedName_.isEmpty()) { - qualifiedName_ = other.qualifiedName_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureQualifiedNameIsMutable(); - qualifiedName_.addAll(other.qualifiedName_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override public final boolean isInitialized() { - for (int i = 0; i < getQualifiedNameCount(); i++) { - if (!getQualifiedName(i).isInitialized()) { - - return false; - } - } - return true; - } - - @Override public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.QualifiedNameTable parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.QualifiedNameTable) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List qualifiedName_ = - java.util.Collections.emptyList(); - private void ensureQualifiedNameIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - qualifiedName_ = new java.util.ArrayList(qualifiedName_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - @Override public java.util.List getQualifiedNameList() { - return java.util.Collections.unmodifiableList(qualifiedName_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - @Override public int getQualifiedNameCount() { - return qualifiedName_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - @Override public ProtoBuf.QualifiedNameTable.QualifiedName getQualifiedName(int index) { - return qualifiedName_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder setQualifiedName( - int index, ProtoBuf.QualifiedNameTable.QualifiedName value) { - if (value == null) { - throw new NullPointerException(); - } - ensureQualifiedNameIsMutable(); - qualifiedName_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder setQualifiedName( - int index, ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { - ensureQualifiedNameIsMutable(); - qualifiedName_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder addQualifiedName(ProtoBuf.QualifiedNameTable.QualifiedName value) { - if (value == null) { - throw new NullPointerException(); - } - ensureQualifiedNameIsMutable(); - qualifiedName_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder addQualifiedName( - int index, ProtoBuf.QualifiedNameTable.QualifiedName value) { - if (value == null) { - throw new NullPointerException(); - } - ensureQualifiedNameIsMutable(); - qualifiedName_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder addQualifiedName( - ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { - ensureQualifiedNameIsMutable(); - qualifiedName_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder addQualifiedName( - int index, ProtoBuf.QualifiedNameTable.QualifiedName.Builder builderForValue) { - ensureQualifiedNameIsMutable(); - qualifiedName_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder addAllQualifiedName( - java.lang.Iterable values) { - ensureQualifiedNameIsMutable(); - AbstractMessageLite.Builder.addAll( - values, qualifiedName_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder clearQualifiedName() { - qualifiedName_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.QualifiedNameTable.QualifiedName qualified_name = 1; - */ - public Builder removeQualifiedName(int index) { - ensureQualifiedNameIsMutable(); - qualifiedName_.remove(index); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable) - } - - static { - defaultInstance = new QualifiedNameTable(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.QualifiedNameTable) - } - - public interface AnnotationOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation) - MessageLiteOrBuilder { - - /** - * required int32 id = 1; - */ - boolean hasId(); - /** - * required int32 id = 1; - */ - int getId(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - java.util.List - getArgumentList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - ProtoBuf.Annotation.Argument getArgument(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - int getArgumentCount(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation} - */ - public static final class Annotation extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation) - AnnotationOrBuilder { - // Use Annotation.newBuilder() to construct. - private Annotation(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Annotation(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Annotation defaultInstance; - public static Annotation getDefaultInstance() { - return defaultInstance; - } - - @Override public Annotation getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Annotation( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - id_ = input.readInt32(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - argument_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - argument_.add(input.readMessage(ProtoBuf.Annotation.Argument.PARSER, extensionRegistry)); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - argument_ = java.util.Collections.unmodifiableList(argument_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - @Override public Annotation parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Annotation(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - public interface ArgumentOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation.Argument) - MessageLiteOrBuilder { - - /** - * required int32 name_id = 1; - */ - boolean hasNameId(); - /** - * required int32 name_id = 1; - */ - int getNameId(); - - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - boolean hasValue(); - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - ProtoBuf.Annotation.Argument.Value getValue(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument} - */ - public static final class Argument extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation.Argument) - ArgumentOrBuilder { - // Use Argument.newBuilder() to construct. - private Argument(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Argument(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Argument defaultInstance; - public static Argument getDefaultInstance() { - return defaultInstance; - } - - @Override public Argument getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Argument( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - nameId_ = input.readInt32(); - break; - } - case 18: { - ProtoBuf.Annotation.Argument.Value.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = value_.toBuilder(); - } - value_ = input.readMessage(ProtoBuf.Annotation.Argument.Value.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(value_); - value_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - @Override public Argument parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Argument(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - public interface ValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) - MessageLiteOrBuilder { - - /** - * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; - * - *
-         * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
-         * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
-         * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
-         * 
- */ - boolean hasType(); - /** - * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; - * - *
-         * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
-         * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
-         * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
-         * 
- */ - ProtoBuf.Annotation.Argument.Value.Type getType(); - - /** - * optional sint64 int_value = 2; - */ - boolean hasIntValue(); - /** - * optional sint64 int_value = 2; - */ - long getIntValue(); - - /** - * optional float float_value = 3; - */ - boolean hasFloatValue(); - /** - * optional float float_value = 3; - */ - float getFloatValue(); - - /** - * optional double double_value = 4; - */ - boolean hasDoubleValue(); - /** - * optional double double_value = 4; - */ - double getDoubleValue(); - - /** - * optional int32 string_value = 5; - */ - boolean hasStringValue(); - /** - * optional int32 string_value = 5; - */ - int getStringValue(); - - /** - * optional int32 class_id = 6; - * - *
-         * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
-         * 
- */ - boolean hasClassId(); - /** - * optional int32 class_id = 6; - * - *
-         * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
-         * 
- */ - int getClassId(); - - /** - * optional int32 enum_value_id = 7; - */ - boolean hasEnumValueId(); - /** - * optional int32 enum_value_id = 7; - */ - int getEnumValueId(); - - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - boolean hasAnnotation(); - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - ProtoBuf.Annotation getAnnotation(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - java.util.List - getArrayElementList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - ProtoBuf.Annotation.Argument.Value getArrayElement(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - int getArrayElementCount(); - - /** - * optional int32 array_dimension_count = 11 [default = 0]; - * - *
-         * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
-         * E.g. if class_id = kotlin/String, this annotation argument value denotes:
-         * - String::class, if array_dimension_count = 0
-         * - Array<String>::class, if array_dimension_count = 1
-         * - Array<Array<String>>::class, if array_dimension_count = 2
-         * - etc.
-         * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
-         * in class literals on JVM, we don't bother to do represent this in our format as well.
-         * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
-         * 
- */ - boolean hasArrayDimensionCount(); - /** - * optional int32 array_dimension_count = 11 [default = 0]; - * - *
-         * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
-         * E.g. if class_id = kotlin/String, this annotation argument value denotes:
-         * - String::class, if array_dimension_count = 0
-         * - Array<String>::class, if array_dimension_count = 1
-         * - Array<Array<String>>::class, if array_dimension_count = 2
-         * - etc.
-         * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
-         * in class literals on JVM, we don't bother to do represent this in our format as well.
-         * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
-         * 
- */ - int getArrayDimensionCount(); - - /** - * optional int32 flags = 10 [default = 0]; - * - *
-         *isUnsigned
-         * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 10 [default = 0]; - * - *
-         *isUnsigned
-         * 
- */ - int getFlags(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value} - */ - public static final class Value extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) - ValueOrBuilder { - // Use Value.newBuilder() to construct. - private Value(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Value(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Value defaultInstance; - public static Value getDefaultInstance() { - return defaultInstance; - } - - @Override public Value getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Value( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - ProtoBuf.Annotation.Argument.Value.Type value = ProtoBuf.Annotation.Argument.Value.Type.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000001; - type_ = value; - } - break; - } - case 16: { - bitField0_ |= 0x00000002; - intValue_ = input.readSInt64(); - break; - } - case 29: { - bitField0_ |= 0x00000004; - floatValue_ = input.readFloat(); - break; - } - case 33: { - bitField0_ |= 0x00000008; - doubleValue_ = input.readDouble(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - stringValue_ = input.readInt32(); - break; - } - case 48: { - bitField0_ |= 0x00000020; - classId_ = input.readInt32(); - break; - } - case 56: { - bitField0_ |= 0x00000040; - enumValueId_ = input.readInt32(); - break; - } - case 66: { - ProtoBuf.Annotation.Builder subBuilder = null; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - subBuilder = annotation_.toBuilder(); - } - annotation_ = input.readMessage(ProtoBuf.Annotation.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(annotation_); - annotation_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000080; - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - arrayElement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - arrayElement_.add(input.readMessage(ProtoBuf.Annotation.Argument.Value.PARSER, extensionRegistry)); - break; - } - case 80: { - bitField0_ |= 0x00000200; - flags_ = input.readInt32(); - break; - } - case 88: { - bitField0_ |= 0x00000100; - arrayDimensionCount_ = input.readInt32(); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - arrayElement_ = java.util.Collections.unmodifiableList(arrayElement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - @Override public Value parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Value(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type} - */ - public enum Type - implements Internal.EnumLite { - /** - * BYTE = 0; - */ - BYTE(0, 0), - /** - * CHAR = 1; - */ - CHAR(1, 1), - /** - * SHORT = 2; - */ - SHORT(2, 2), - /** - * INT = 3; - */ - INT(3, 3), - /** - * LONG = 4; - */ - LONG(4, 4), - /** - * FLOAT = 5; - */ - FLOAT(5, 5), - /** - * DOUBLE = 6; - */ - DOUBLE(6, 6), - /** - * BOOLEAN = 7; - */ - BOOLEAN(7, 7), - /** - * STRING = 8; - */ - STRING(8, 8), - /** - * CLASS = 9; - */ - CLASS(9, 9), - /** - * ENUM = 10; - */ - ENUM(10, 10), - /** - * ANNOTATION = 11; - */ - ANNOTATION(11, 11), - /** - * ARRAY = 12; - */ - ARRAY(12, 12), - ; - - /** - * BYTE = 0; - */ - public static final int BYTE_VALUE = 0; - /** - * CHAR = 1; - */ - public static final int CHAR_VALUE = 1; - /** - * SHORT = 2; - */ - public static final int SHORT_VALUE = 2; - /** - * INT = 3; - */ - public static final int INT_VALUE = 3; - /** - * LONG = 4; - */ - public static final int LONG_VALUE = 4; - /** - * FLOAT = 5; - */ - public static final int FLOAT_VALUE = 5; - /** - * DOUBLE = 6; - */ - public static final int DOUBLE_VALUE = 6; - /** - * BOOLEAN = 7; - */ - public static final int BOOLEAN_VALUE = 7; - /** - * STRING = 8; - */ - public static final int STRING_VALUE = 8; - /** - * CLASS = 9; - */ - public static final int CLASS_VALUE = 9; - /** - * ENUM = 10; - */ - public static final int ENUM_VALUE = 10; - /** - * ANNOTATION = 11; - */ - public static final int ANNOTATION_VALUE = 11; - /** - * ARRAY = 12; - */ - public static final int ARRAY_VALUE = 12; - - - @Override public final int getNumber() { return value; } - - public static Type valueOf(int value) { - switch (value) { - case 0: return BYTE; - case 1: return CHAR; - case 2: return SHORT; - case 3: return INT; - case 4: return LONG; - case 5: return FLOAT; - case 6: return DOUBLE; - case 7: return BOOLEAN; - case 8: return STRING; - case 9: return CLASS; - case 10: return ENUM; - case 11: return ANNOTATION; - case 12: return ARRAY; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - @Override public Type findValueByNumber(int number) { - return Type.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Type(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type) - } - - private int bitField0_; - public static final int TYPE_FIELD_NUMBER = 1; - private ProtoBuf.Annotation.Argument.Value.Type type_; - /** - * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; - * - *
-         * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
-         * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
-         * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
-         * 
- */ - @Override public boolean hasType() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; - * - *
-         * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
-         * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
-         * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
-         * 
- */ - @Override public ProtoBuf.Annotation.Argument.Value.Type getType() { - return type_; - } - - public static final int INT_VALUE_FIELD_NUMBER = 2; - private long intValue_; - /** - * optional sint64 int_value = 2; - */ - @Override public boolean hasIntValue() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional sint64 int_value = 2; - */ - @Override public long getIntValue() { - return intValue_; - } - - public static final int FLOAT_VALUE_FIELD_NUMBER = 3; - private float floatValue_; - /** - * optional float float_value = 3; - */ - @Override public boolean hasFloatValue() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional float float_value = 3; - */ - @Override public float getFloatValue() { - return floatValue_; - } - - public static final int DOUBLE_VALUE_FIELD_NUMBER = 4; - private double doubleValue_; - /** - * optional double double_value = 4; - */ - @Override public boolean hasDoubleValue() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional double double_value = 4; - */ - @Override public double getDoubleValue() { - return doubleValue_; - } - - public static final int STRING_VALUE_FIELD_NUMBER = 5; - private int stringValue_; - /** - * optional int32 string_value = 5; - */ - @Override public boolean hasStringValue() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 string_value = 5; - */ - @Override public int getStringValue() { - return stringValue_; - } - - public static final int CLASS_ID_FIELD_NUMBER = 6; - private int classId_; - /** - * optional int32 class_id = 6; - * - *
-         * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
-         * 
- */ - @Override public boolean hasClassId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int32 class_id = 6; - * - *
-         * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
-         * 
- */ - @Override public int getClassId() { - return classId_; - } - - public static final int ENUM_VALUE_ID_FIELD_NUMBER = 7; - private int enumValueId_; - /** - * optional int32 enum_value_id = 7; - */ - @Override public boolean hasEnumValueId() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 enum_value_id = 7; - */ - @Override public int getEnumValueId() { - return enumValueId_; - } - - public static final int ANNOTATION_FIELD_NUMBER = 8; - private ProtoBuf.Annotation annotation_; - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - @Override public boolean hasAnnotation() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - @Override public ProtoBuf.Annotation getAnnotation() { - return annotation_; - } - - public static final int ARRAY_ELEMENT_FIELD_NUMBER = 9; - private java.util.List arrayElement_; - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - @Override public java.util.List getArrayElementList() { - return arrayElement_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public java.util.List - getArrayElementOrBuilderList() { - return arrayElement_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - @Override public int getArrayElementCount() { - return arrayElement_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - @Override public ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { - return arrayElement_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public ProtoBuf.Annotation.Argument.ValueOrBuilder getArrayElementOrBuilder( - int index) { - return arrayElement_.get(index); - } - - public static final int ARRAY_DIMENSION_COUNT_FIELD_NUMBER = 11; - private int arrayDimensionCount_; - /** - * optional int32 array_dimension_count = 11 [default = 0]; - * - *
-         * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
-         * E.g. if class_id = kotlin/String, this annotation argument value denotes:
-         * - String::class, if array_dimension_count = 0
-         * - Array<String>::class, if array_dimension_count = 1
-         * - Array<Array<String>>::class, if array_dimension_count = 2
-         * - etc.
-         * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
-         * in class literals on JVM, we don't bother to do represent this in our format as well.
-         * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
-         * 
- */ - @Override public boolean hasArrayDimensionCount() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional int32 array_dimension_count = 11 [default = 0]; - * - *
-         * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
-         * E.g. if class_id = kotlin/String, this annotation argument value denotes:
-         * - String::class, if array_dimension_count = 0
-         * - Array<String>::class, if array_dimension_count = 1
-         * - Array<Array<String>>::class, if array_dimension_count = 2
-         * - etc.
-         * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
-         * in class literals on JVM, we don't bother to do represent this in our format as well.
-         * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
-         * 
- */ - @Override public int getArrayDimensionCount() { - return arrayDimensionCount_; - } - - public static final int FLAGS_FIELD_NUMBER = 10; - private int flags_; - /** - * optional int32 flags = 10 [default = 0]; - * - *
-         *isUnsigned
-         * 
- */ - @Override public boolean hasFlags() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional int32 flags = 10 [default = 0]; - * - *
-         *isUnsigned
-         * 
- */ - @Override public int getFlags() { - return flags_; - } - - private void initFields() { - type_ = ProtoBuf.Annotation.Argument.Value.Type.BYTE; - intValue_ = 0L; - floatValue_ = 0F; - doubleValue_ = 0D; - stringValue_ = 0; - classId_ = 0; - enumValueId_ = 0; - annotation_ = ProtoBuf.Annotation.getDefaultInstance(); - arrayElement_ = java.util.Collections.emptyList(); - arrayDimensionCount_ = 0; - flags_ = 0; - } - private byte memoizedIsInitialized = -1; - @Override public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (hasAnnotation()) { - if (!getAnnotation().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getArrayElementCount(); i++) { - if (!getArrayElement(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - @Override public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeEnum(1, type_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeSInt64(2, intValue_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeFloat(3, floatValue_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeDouble(4, doubleValue_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(5, stringValue_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt32(6, classId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeInt32(7, enumValueId_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeMessage(8, annotation_); - } - for (int i = 0; i < arrayElement_.size(); i++) { - output.writeMessage(9, arrayElement_.get(i)); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeInt32(10, flags_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeInt32(11, arrayDimensionCount_); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeEnumSize(1, type_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeSInt64Size(2, intValue_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeFloatSize(3, floatValue_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeDoubleSize(4, doubleValue_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeInt32Size(5, stringValue_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += CodedOutputStream - .computeInt32Size(6, classId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += CodedOutputStream - .computeInt32Size(7, enumValueId_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += CodedOutputStream - .computeMessageSize(8, annotation_); - } - for (int i = 0; i < arrayElement_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(9, arrayElement_.get(i)); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += CodedOutputStream - .computeInt32Size(10, flags_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += CodedOutputStream - .computeInt32Size(11, arrayDimensionCount_); - } - size += unknownFields.size(); - 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 ProtoBuf.Annotation.Argument.Value parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Annotation.Argument.Value parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Annotation.Argument.Value parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Annotation.Argument.Value parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Annotation.Argument.Value parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Annotation.Argument.Value parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Annotation.Argument.Value parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Annotation.Argument.Value parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Annotation.Argument.Value parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Annotation.Argument.Value parseFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - @Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(ProtoBuf.Annotation.Argument.Value prototype) { - return newBuilder().mergeFrom(prototype); - } - @Override public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument.Value} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.Annotation.Argument.Value, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) - ProtoBuf.Annotation.Argument.ValueOrBuilder { - // Construct using ProtoBuf.Annotation.Argument.Value.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override public Builder clear() { - super.clear(); - type_ = ProtoBuf.Annotation.Argument.Value.Type.BYTE; - bitField0_ = (bitField0_ & ~0x00000001); - intValue_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - floatValue_ = 0F; - bitField0_ = (bitField0_ & ~0x00000004); - doubleValue_ = 0D; - bitField0_ = (bitField0_ & ~0x00000008); - stringValue_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - classId_ = 0; - bitField0_ = (bitField0_ & ~0x00000020); - enumValueId_ = 0; - bitField0_ = (bitField0_ & ~0x00000040); - annotation_ = ProtoBuf.Annotation.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000080); - arrayElement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - arrayDimensionCount_ = 0; - bitField0_ = (bitField0_ & ~0x00000200); - flags_ = 0; - bitField0_ = (bitField0_ & ~0x00000400); - return this; - } - - @Override public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override public ProtoBuf.Annotation.Argument.Value getDefaultInstanceForType() { - return ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); - } - - @Override public ProtoBuf.Annotation.Argument.Value build() { - ProtoBuf.Annotation.Argument.Value result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override public ProtoBuf.Annotation.Argument.Value buildPartial() { - ProtoBuf.Annotation.Argument.Value result = new ProtoBuf.Annotation.Argument.Value(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.intValue_ = intValue_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.floatValue_ = floatValue_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.doubleValue_ = doubleValue_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.stringValue_ = stringValue_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.classId_ = classId_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - result.enumValueId_ = enumValueId_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; - } - result.annotation_ = annotation_; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - arrayElement_ = java.util.Collections.unmodifiableList(arrayElement_); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.arrayElement_ = arrayElement_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000100; - } - result.arrayDimensionCount_ = arrayDimensionCount_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000200; - } - result.flags_ = flags_; - result.bitField0_ = to_bitField0_; - return result; - } - - @Override public Builder mergeFrom(ProtoBuf.Annotation.Argument.Value other) { - if (other == ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) return this; - if (other.hasType()) { - setType(other.getType()); - } - if (other.hasIntValue()) { - setIntValue(other.getIntValue()); - } - if (other.hasFloatValue()) { - setFloatValue(other.getFloatValue()); - } - if (other.hasDoubleValue()) { - setDoubleValue(other.getDoubleValue()); - } - if (other.hasStringValue()) { - setStringValue(other.getStringValue()); - } - if (other.hasClassId()) { - setClassId(other.getClassId()); - } - if (other.hasEnumValueId()) { - setEnumValueId(other.getEnumValueId()); - } - if (other.hasAnnotation()) { - mergeAnnotation(other.getAnnotation()); - } - if (!other.arrayElement_.isEmpty()) { - if (arrayElement_.isEmpty()) { - arrayElement_ = other.arrayElement_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureArrayElementIsMutable(); - arrayElement_.addAll(other.arrayElement_); - } - - } - if (other.hasArrayDimensionCount()) { - setArrayDimensionCount(other.getArrayDimensionCount()); - } - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override public final boolean isInitialized() { - if (hasAnnotation()) { - if (!getAnnotation().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getArrayElementCount(); i++) { - if (!getArrayElement(i).isInitialized()) { - - return false; - } - } - return true; - } - - @Override public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Annotation.Argument.Value parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Annotation.Argument.Value) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private ProtoBuf.Annotation.Argument.Value.Type type_ = ProtoBuf.Annotation.Argument.Value.Type.BYTE; - /** - * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; - * - *
-           * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
-           * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
-           * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
-           * 
- */ - @Override public boolean hasType() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; - * - *
-           * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
-           * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
-           * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
-           * 
- */ - @Override public ProtoBuf.Annotation.Argument.Value.Type getType() { - return type_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; - * - *
-           * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
-           * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
-           * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
-           * 
- */ - public Builder setType(ProtoBuf.Annotation.Argument.Value.Type value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - type_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation.Argument.Value.Type type = 1; - * - *
-           * Note: a *Value* has a Type, not an Argument! This is done for future language features which may involve using arrays
-           * of elements of different types. Such entries are allowed in the constant pool of JVM class files.
-           * However, to save space, this field is optional: in case of homogeneous arrays, only the type of the first element is required
-           * 
- */ - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000001); - type_ = ProtoBuf.Annotation.Argument.Value.Type.BYTE; - - return this; - } - - private long intValue_ ; - /** - * optional sint64 int_value = 2; - */ - @Override public boolean hasIntValue() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional sint64 int_value = 2; - */ - @Override public long getIntValue() { - return intValue_; - } - /** - * optional sint64 int_value = 2; - */ - public Builder setIntValue(long value) { - bitField0_ |= 0x00000002; - intValue_ = value; - - return this; - } - /** - * optional sint64 int_value = 2; - */ - public Builder clearIntValue() { - bitField0_ = (bitField0_ & ~0x00000002); - intValue_ = 0L; - - return this; - } - - private float floatValue_ ; - /** - * optional float float_value = 3; - */ - @Override public boolean hasFloatValue() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional float float_value = 3; - */ - @Override public float getFloatValue() { - return floatValue_; - } - /** - * optional float float_value = 3; - */ - public Builder setFloatValue(float value) { - bitField0_ |= 0x00000004; - floatValue_ = value; - - return this; - } - /** - * optional float float_value = 3; - */ - public Builder clearFloatValue() { - bitField0_ = (bitField0_ & ~0x00000004); - floatValue_ = 0F; - - return this; - } - - private double doubleValue_ ; - /** - * optional double double_value = 4; - */ - @Override public boolean hasDoubleValue() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional double double_value = 4; - */ - @Override public double getDoubleValue() { - return doubleValue_; - } - /** - * optional double double_value = 4; - */ - public Builder setDoubleValue(double value) { - bitField0_ |= 0x00000008; - doubleValue_ = value; - - return this; - } - /** - * optional double double_value = 4; - */ - public Builder clearDoubleValue() { - bitField0_ = (bitField0_ & ~0x00000008); - doubleValue_ = 0D; - - return this; - } - - private int stringValue_ ; - /** - * optional int32 string_value = 5; - */ - @Override public boolean hasStringValue() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 string_value = 5; - */ - @Override public int getStringValue() { - return stringValue_; - } - /** - * optional int32 string_value = 5; - */ - public Builder setStringValue(int value) { - bitField0_ |= 0x00000010; - stringValue_ = value; - - return this; - } - /** - * optional int32 string_value = 5; - */ - public Builder clearStringValue() { - bitField0_ = (bitField0_ & ~0x00000010); - stringValue_ = 0; - - return this; - } - - private int classId_ ; - /** - * optional int32 class_id = 6; - * - *
-           * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
-           * 
- */ - @Override public boolean hasClassId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int32 class_id = 6; - * - *
-           * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
-           * 
- */ - @Override public int getClassId() { - return classId_; - } - /** - * optional int32 class_id = 6; - * - *
-           * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
-           * 
- */ - public Builder setClassId(int value) { - bitField0_ |= 0x00000020; - classId_ = value; - - return this; - } - /** - * optional int32 class_id = 6; - * - *
-           * If type = CLASS, FQ name of the referenced class; if type = ENUM, FQ name of the enum class
-           * 
- */ - public Builder clearClassId() { - bitField0_ = (bitField0_ & ~0x00000020); - classId_ = 0; - - return this; - } - - private int enumValueId_ ; - /** - * optional int32 enum_value_id = 7; - */ - @Override public boolean hasEnumValueId() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 enum_value_id = 7; - */ - @Override public int getEnumValueId() { - return enumValueId_; - } - /** - * optional int32 enum_value_id = 7; - */ - public Builder setEnumValueId(int value) { - bitField0_ |= 0x00000040; - enumValueId_ = value; - - return this; - } - /** - * optional int32 enum_value_id = 7; - */ - public Builder clearEnumValueId() { - bitField0_ = (bitField0_ & ~0x00000040); - enumValueId_ = 0; - - return this; - } - - private ProtoBuf.Annotation annotation_ = ProtoBuf.Annotation.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - @Override public boolean hasAnnotation() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - @Override public ProtoBuf.Annotation getAnnotation() { - return annotation_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder setAnnotation(ProtoBuf.Annotation value) { - if (value == null) { - throw new NullPointerException(); - } - annotation_ = value; - - bitField0_ |= 0x00000080; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder setAnnotation( - ProtoBuf.Annotation.Builder builderForValue) { - annotation_ = builderForValue.build(); - - bitField0_ |= 0x00000080; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder mergeAnnotation(ProtoBuf.Annotation value) { - if (((bitField0_ & 0x00000080) == 0x00000080) && - annotation_ != ProtoBuf.Annotation.getDefaultInstance()) { - annotation_ = - ProtoBuf.Annotation.newBuilder(annotation_).mergeFrom(value).buildPartial(); - } else { - annotation_ = value; - } - - bitField0_ |= 0x00000080; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder clearAnnotation() { - annotation_ = ProtoBuf.Annotation.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000080); - return this; - } - - private java.util.List arrayElement_ = - java.util.Collections.emptyList(); - private void ensureArrayElementIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - arrayElement_ = new java.util.ArrayList(arrayElement_); - bitField0_ |= 0x00000100; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - @Override public java.util.List getArrayElementList() { - return java.util.Collections.unmodifiableList(arrayElement_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - @Override public int getArrayElementCount() { - return arrayElement_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - @Override public ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { - return arrayElement_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder setArrayElement( - int index, ProtoBuf.Annotation.Argument.Value value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArrayElementIsMutable(); - arrayElement_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder setArrayElement( - int index, ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { - ensureArrayElementIsMutable(); - arrayElement_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder addArrayElement(ProtoBuf.Annotation.Argument.Value value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArrayElementIsMutable(); - arrayElement_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder addArrayElement( - int index, ProtoBuf.Annotation.Argument.Value value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArrayElementIsMutable(); - arrayElement_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder addArrayElement( - ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { - ensureArrayElementIsMutable(); - arrayElement_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder addArrayElement( - int index, ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { - ensureArrayElementIsMutable(); - arrayElement_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder addAllArrayElement( - java.lang.Iterable values) { - ensureArrayElementIsMutable(); - AbstractMessageLite.Builder.addAll( - values, arrayElement_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder clearArrayElement() { - arrayElement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument.Value array_element = 9; - */ - public Builder removeArrayElement(int index) { - ensureArrayElementIsMutable(); - arrayElement_.remove(index); - - return this; - } - - private int arrayDimensionCount_ ; - /** - * optional int32 array_dimension_count = 11 [default = 0]; - * - *
-           * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
-           * E.g. if class_id = kotlin/String, this annotation argument value denotes:
-           * - String::class, if array_dimension_count = 0
-           * - Array<String>::class, if array_dimension_count = 1
-           * - Array<Array<String>>::class, if array_dimension_count = 2
-           * - etc.
-           * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
-           * in class literals on JVM, we don't bother to do represent this in our format as well.
-           * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
-           * 
- */ - @Override public boolean hasArrayDimensionCount() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional int32 array_dimension_count = 11 [default = 0]; - * - *
-           * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
-           * E.g. if class_id = kotlin/String, this annotation argument value denotes:
-           * - String::class, if array_dimension_count = 0
-           * - Array<String>::class, if array_dimension_count = 1
-           * - Array<Array<String>>::class, if array_dimension_count = 2
-           * - etc.
-           * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
-           * in class literals on JVM, we don't bother to do represent this in our format as well.
-           * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
-           * 
- */ - @Override public int getArrayDimensionCount() { - return arrayDimensionCount_; - } - /** - * optional int32 array_dimension_count = 11 [default = 0]; - * - *
-           * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
-           * E.g. if class_id = kotlin/String, this annotation argument value denotes:
-           * - String::class, if array_dimension_count = 0
-           * - Array<String>::class, if array_dimension_count = 1
-           * - Array<Array<String>>::class, if array_dimension_count = 2
-           * - etc.
-           * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
-           * in class literals on JVM, we don't bother to do represent this in our format as well.
-           * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
-           * 
- */ - public Builder setArrayDimensionCount(int value) { - bitField0_ |= 0x00000200; - arrayDimensionCount_ = value; - - return this; - } - /** - * optional int32 array_dimension_count = 11 [default = 0]; - * - *
-           * If type = CLASS, the number of dimensions of the array of the class specified in class_id.
-           * E.g. if class_id = kotlin/String, this annotation argument value denotes:
-           * - String::class, if array_dimension_count = 0
-           * - Array<String>::class, if array_dimension_count = 1
-           * - Array<Array<String>>::class, if array_dimension_count = 2
-           * - etc.
-           * Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
-           * in class literals on JVM, we don't bother to do represent this in our format as well.
-           * So, for example, values `Array<Array<in B?>>::class` and `Array<out Array<B>>?>::class` will be represented exactly the same here.
-           * 
- */ - public Builder clearArrayDimensionCount() { - bitField0_ = (bitField0_ & ~0x00000200); - arrayDimensionCount_ = 0; - - return this; - } - - private int flags_ ; - /** - * optional int32 flags = 10 [default = 0]; - * - *
-           *isUnsigned
-           * 
- */ - @Override public boolean hasFlags() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - /** - * optional int32 flags = 10 [default = 0]; - * - *
-           *isUnsigned
-           * 
- */ - @Override public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 10 [default = 0]; - * - *
-           *isUnsigned
-           * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000400; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 10 [default = 0]; - * - *
-           *isUnsigned
-           * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000400); - flags_ = 0; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) - } - - static { - defaultInstance = new Value(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Annotation.Argument.Value) - } - - private int bitField0_; - public static final int NAME_ID_FIELD_NUMBER = 1; - private int nameId_; - /** - * required int32 name_id = 1; - */ - @Override public boolean hasNameId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 name_id = 1; - */ - @Override public int getNameId() { - return nameId_; - } - - public static final int VALUE_FIELD_NUMBER = 2; - private ProtoBuf.Annotation.Argument.Value value_; - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - @Override public boolean hasValue() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - @Override public ProtoBuf.Annotation.Argument.Value getValue() { - return value_; - } - - private void initFields() { - nameId_ = 0; - value_ = ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); - } - private byte memoizedIsInitialized = -1; - @Override public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasNameId()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasValue()) { - memoizedIsInitialized = 0; - return false; - } - if (!getValue().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - @Override public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, nameId_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, value_); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, nameId_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeMessageSize(2, value_); - } - size += unknownFields.size(); - 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 ProtoBuf.Annotation.Argument parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Annotation.Argument parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Annotation.Argument parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Annotation.Argument parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Annotation.Argument parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Annotation.Argument parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Annotation.Argument parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Annotation.Argument parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Annotation.Argument parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Annotation.Argument parseFrom( - CodedInputStream input, - 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(ProtoBuf.Annotation.Argument prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation.Argument} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.Annotation.Argument, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation.Argument) - ProtoBuf.Annotation.ArgumentOrBuilder { - // Construct using ProtoBuf.Annotation.Argument.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - nameId_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - value_ = ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Annotation.Argument getDefaultInstanceForType() { - return ProtoBuf.Annotation.Argument.getDefaultInstance(); - } - - public ProtoBuf.Annotation.Argument build() { - ProtoBuf.Annotation.Argument result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Annotation.Argument buildPartial() { - ProtoBuf.Annotation.Argument result = new ProtoBuf.Annotation.Argument(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.nameId_ = nameId_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.value_ = value_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Annotation.Argument other) { - if (other == ProtoBuf.Annotation.Argument.getDefaultInstance()) return this; - if (other.hasNameId()) { - setNameId(other.getNameId()); - } - if (other.hasValue()) { - mergeValue(other.getValue()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasNameId()) { - - return false; - } - if (!hasValue()) { - - return false; - } - if (!getValue().isInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Annotation.Argument parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Annotation.Argument) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int nameId_ ; - /** - * required int32 name_id = 1; - */ - public boolean hasNameId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 name_id = 1; - */ - public int getNameId() { - return nameId_; - } - /** - * required int32 name_id = 1; - */ - public Builder setNameId(int value) { - bitField0_ |= 0x00000001; - nameId_ = value; - - return this; - } - /** - * required int32 name_id = 1; - */ - public Builder clearNameId() { - bitField0_ = (bitField0_ & ~0x00000001); - nameId_ = 0; - - return this; - } - - private ProtoBuf.Annotation.Argument.Value value_ = ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - public ProtoBuf.Annotation.Argument.Value getValue() { - return value_; - } - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - public Builder setValue(ProtoBuf.Annotation.Argument.Value value) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - - bitField0_ |= 0x00000002; - return this; - } - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - public Builder setValue( - ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { - value_ = builderForValue.build(); - - bitField0_ |= 0x00000002; - return this; - } - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - public Builder mergeValue(ProtoBuf.Annotation.Argument.Value value) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - value_ != ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) { - value_ = - ProtoBuf.Annotation.Argument.Value.newBuilder(value_).mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - - bitField0_ |= 0x00000002; - return this; - } - /** - * required .org.jetbrains.kotlin.metadata.Annotation.Argument.Value value = 2; - */ - public Builder clearValue() { - value_ = ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Annotation.Argument) - } - - static { - defaultInstance = new Argument(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Annotation.Argument) - } - - private int bitField0_; - public static final int ID_FIELD_NUMBER = 1; - private int id_; - /** - * required int32 id = 1; - */ - public boolean hasId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 id = 1; - */ - public int getId() { - return id_; - } - - public static final int ARGUMENT_FIELD_NUMBER = 2; - private java.util.List argument_; - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public java.util.List getArgumentList() { - return argument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public java.util.List - getArgumentOrBuilderList() { - return argument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public int getArgumentCount() { - return argument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public ProtoBuf.Annotation.Argument getArgument(int index) { - return argument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public ProtoBuf.Annotation.ArgumentOrBuilder getArgumentOrBuilder( - int index) { - return argument_.get(index); - } - - private void initFields() { - id_ = 0; - argument_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasId()) { - memoizedIsInitialized = 0; - return false; - } - for (int i = 0; i < getArgumentCount(); i++) { - if (!getArgument(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, id_); - } - for (int i = 0; i < argument_.size(); i++) { - output.writeMessage(2, argument_.get(i)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, id_); - } - for (int i = 0; i < argument_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(2, argument_.get(i)); - } - size += unknownFields.size(); - 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 ProtoBuf.Annotation parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Annotation parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Annotation parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Annotation parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Annotation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Annotation parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Annotation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Annotation parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Annotation parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Annotation parseFrom( - CodedInputStream input, - 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(ProtoBuf.Annotation prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Annotation} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.Annotation, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Annotation) - ProtoBuf.AnnotationOrBuilder { - // Construct using ProtoBuf.Annotation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - id_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - argument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Annotation getDefaultInstanceForType() { - return ProtoBuf.Annotation.getDefaultInstance(); - } - - public ProtoBuf.Annotation build() { - ProtoBuf.Annotation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Annotation buildPartial() { - ProtoBuf.Annotation result = new ProtoBuf.Annotation(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.id_ = id_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - argument_ = java.util.Collections.unmodifiableList(argument_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.argument_ = argument_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Annotation other) { - if (other == ProtoBuf.Annotation.getDefaultInstance()) return this; - if (other.hasId()) { - setId(other.getId()); - } - if (!other.argument_.isEmpty()) { - if (argument_.isEmpty()) { - argument_ = other.argument_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureArgumentIsMutable(); - argument_.addAll(other.argument_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasId()) { - - return false; - } - for (int i = 0; i < getArgumentCount(); i++) { - if (!getArgument(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Annotation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Annotation) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int id_ ; - /** - * required int32 id = 1; - */ - public boolean hasId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 id = 1; - */ - public int getId() { - return id_; - } - /** - * required int32 id = 1; - */ - public Builder setId(int value) { - bitField0_ |= 0x00000001; - id_ = value; - - return this; - } - /** - * required int32 id = 1; - */ - public Builder clearId() { - bitField0_ = (bitField0_ & ~0x00000001); - id_ = 0; - - return this; - } - - private java.util.List argument_ = - java.util.Collections.emptyList(); - private void ensureArgumentIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - argument_ = new java.util.ArrayList(argument_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public java.util.List getArgumentList() { - return java.util.Collections.unmodifiableList(argument_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public int getArgumentCount() { - return argument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public ProtoBuf.Annotation.Argument getArgument(int index) { - return argument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder setArgument( - int index, ProtoBuf.Annotation.Argument value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentIsMutable(); - argument_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder setArgument( - int index, ProtoBuf.Annotation.Argument.Builder builderForValue) { - ensureArgumentIsMutable(); - argument_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder addArgument(ProtoBuf.Annotation.Argument value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentIsMutable(); - argument_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder addArgument( - int index, ProtoBuf.Annotation.Argument value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentIsMutable(); - argument_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder addArgument( - ProtoBuf.Annotation.Argument.Builder builderForValue) { - ensureArgumentIsMutable(); - argument_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder addArgument( - int index, ProtoBuf.Annotation.Argument.Builder builderForValue) { - ensureArgumentIsMutable(); - argument_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder addAllArgument( - java.lang.Iterable values) { - ensureArgumentIsMutable(); - AbstractMessageLite.Builder.addAll( - values, argument_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder clearArgument() { - argument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation.Argument argument = 2; - */ - public Builder removeArgument(int index) { - ensureArgumentIsMutable(); - argument_.remove(index); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Annotation) - } - - static { - defaultInstance = new Annotation(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Annotation) - } - - public interface TypeOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Type) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - java.util.List - getArgumentList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - ProtoBuf.Type.Argument getArgument(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - int getArgumentCount(); - - /** - * optional bool nullable = 3 [default = false]; - */ - boolean hasNullable(); - /** - * optional bool nullable = 3 [default = false]; - */ - boolean getNullable(); - - /** - * optional int32 flexible_type_capabilities_id = 4; - * - *
-     * If this field is set, the type is flexible.
-     * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
-     * 
- */ - boolean hasFlexibleTypeCapabilitiesId(); - /** - * optional int32 flexible_type_capabilities_id = 4; - * - *
-     * If this field is set, the type is flexible.
-     * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
-     * 
- */ - int getFlexibleTypeCapabilitiesId(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - boolean hasFlexibleUpperBound(); - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - ProtoBuf.Type getFlexibleUpperBound(); - - /** - * optional int32 flexible_upper_bound_id = 8; - */ - boolean hasFlexibleUpperBoundId(); - /** - * optional int32 flexible_upper_bound_id = 8; - */ - int getFlexibleUpperBoundId(); - - /** - * optional int32 class_name = 6; - */ - boolean hasClassName(); - /** - * optional int32 class_name = 6; - */ - int getClassName(); - - /** - * optional int32 type_parameter = 7; - * - *
-     * id of the type parameter
-     * 
- */ - boolean hasTypeParameter(); - /** - * optional int32 type_parameter = 7; - * - *
-     * id of the type parameter
-     * 
- */ - int getTypeParameter(); - - /** - * optional int32 type_parameter_name = 9; - * - *
-     * Name of the type parameter in the immediate owner
-     * 
- */ - boolean hasTypeParameterName(); - /** - * optional int32 type_parameter_name = 9; - * - *
-     * Name of the type parameter in the immediate owner
-     * 
- */ - int getTypeParameterName(); - - /** - * optional int32 type_alias_name = 12; - * - *
-     * Note that this may be present only for abbreviated_type
-     * Top level types are always fully expanded
-     * 
- */ - boolean hasTypeAliasName(); - /** - * optional int32 type_alias_name = 12; - * - *
-     * Note that this may be present only for abbreviated_type
-     * Top level types are always fully expanded
-     * 
- */ - int getTypeAliasName(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-     * Outer type may be present only if class_name or type_alias_name is present
-     * 
- */ - boolean hasOuterType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-     * Outer type may be present only if class_name or type_alias_name is present
-     * 
- */ - ProtoBuf.Type getOuterType(); - - /** - * optional int32 outer_type_id = 11; - */ - boolean hasOuterTypeId(); - /** - * optional int32 outer_type_id = 11; - */ - int getOuterTypeId(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - boolean hasAbbreviatedType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - ProtoBuf.Type getAbbreviatedType(); - - /** - * optional int32 abbreviated_type_id = 14; - */ - boolean hasAbbreviatedTypeId(); - /** - * optional int32 abbreviated_type_id = 14; - */ - int getAbbreviatedTypeId(); - - /** - * optional int32 flags = 1; - * - *
-     *suspend
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 1; - * - *
-     *suspend
-     * 
- */ - int getFlags(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Type} - */ - public static final class Type extends - GeneratedMessageLite.ExtendableMessage< - Type> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Type) - TypeOrBuilder { - // Use Type.newBuilder() to construct. - private Type(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Type(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Type defaultInstance; - public static Type getDefaultInstance() { - return defaultInstance; - } - - public Type getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Type( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00001000; - flags_ = input.readInt32(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - argument_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - argument_.add(input.readMessage(ProtoBuf.Type.Argument.PARSER, extensionRegistry)); - break; - } - case 24: { - bitField0_ |= 0x00000001; - nullable_ = input.readBool(); - break; - } - case 32: { - bitField0_ |= 0x00000002; - flexibleTypeCapabilitiesId_ = input.readInt32(); - break; - } - case 42: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = flexibleUpperBound_.toBuilder(); - } - flexibleUpperBound_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(flexibleUpperBound_); - flexibleUpperBound_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 48: { - bitField0_ |= 0x00000010; - className_ = input.readInt32(); - break; - } - case 56: { - bitField0_ |= 0x00000020; - typeParameter_ = input.readInt32(); - break; - } - case 64: { - bitField0_ |= 0x00000008; - flexibleUpperBoundId_ = input.readInt32(); - break; - } - case 72: { - bitField0_ |= 0x00000040; - typeParameterName_ = input.readInt32(); - break; - } - case 82: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - subBuilder = outerType_.toBuilder(); - } - outerType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outerType_); - outerType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000100; - break; - } - case 88: { - bitField0_ |= 0x00000200; - outerTypeId_ = input.readInt32(); - break; - } - case 96: { - bitField0_ |= 0x00000080; - typeAliasName_ = input.readInt32(); - break; - } - case 106: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000400) == 0x00000400)) { - subBuilder = abbreviatedType_.toBuilder(); - } - abbreviatedType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(abbreviatedType_); - abbreviatedType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000400; - break; - } - case 112: { - bitField0_ |= 0x00000800; - abbreviatedTypeId_ = input.readInt32(); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - argument_ = java.util.Collections.unmodifiableList(argument_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Type parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Type(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - public interface ArgumentOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Type.Argument) - MessageLiteOrBuilder { - - /** - * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; - */ - boolean hasProjection(); - /** - * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; - */ - ProtoBuf.Type.Argument.Projection getProjection(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-       * When projection is STAR, no type is written, otherwise type must be specified
-       * 
- */ - boolean hasType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-       * When projection is STAR, no type is written, otherwise type must be specified
-       * 
- */ - ProtoBuf.Type getType(); - - /** - * optional int32 type_id = 3; - */ - boolean hasTypeId(); - /** - * optional int32 type_id = 3; - */ - int getTypeId(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Type.Argument} - */ - public static final class Argument extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Type.Argument) - ArgumentOrBuilder { - // Use Argument.newBuilder() to construct. - private Argument(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Argument(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Argument defaultInstance; - public static Argument getDefaultInstance() { - return defaultInstance; - } - - public Argument getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Argument( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - ProtoBuf.Type.Argument.Projection value = ProtoBuf.Type.Argument.Projection.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000001; - projection_ = value; - } - break; - } - case 18: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = type_.toBuilder(); - } - type_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(type_); - type_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 24: { - bitField0_ |= 0x00000004; - typeId_ = input.readInt32(); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Argument parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Argument(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.Type.Argument.Projection} - */ - public enum Projection - implements Internal.EnumLite { - /** - * IN = 0; - */ - IN(0, 0), - /** - * OUT = 1; - */ - OUT(1, 1), - /** - * INV = 2; - */ - INV(2, 2), - /** - * STAR = 3; - */ - STAR(3, 3), - ; - - /** - * IN = 0; - */ - public static final int IN_VALUE = 0; - /** - * OUT = 1; - */ - public static final int OUT_VALUE = 1; - /** - * INV = 2; - */ - public static final int INV_VALUE = 2; - /** - * STAR = 3; - */ - public static final int STAR_VALUE = 3; - - - public final int getNumber() { return value; } - - public static Projection valueOf(int value) { - switch (value) { - case 0: return IN; - case 1: return OUT; - case 2: return INV; - case 3: return STAR; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - public Projection findValueByNumber(int number) { - return Projection.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Projection(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Type.Argument.Projection) - } - - private int bitField0_; - public static final int PROJECTION_FIELD_NUMBER = 1; - private ProtoBuf.Type.Argument.Projection projection_; - /** - * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; - */ - public boolean hasProjection() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; - */ - public ProtoBuf.Type.Argument.Projection getProjection() { - return projection_; - } - - public static final int TYPE_FIELD_NUMBER = 2; - private ProtoBuf.Type type_; - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-       * When projection is STAR, no type is written, otherwise type must be specified
-       * 
- */ - public boolean hasType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-       * When projection is STAR, no type is written, otherwise type must be specified
-       * 
- */ - public ProtoBuf.Type getType() { - return type_; - } - - public static final int TYPE_ID_FIELD_NUMBER = 3; - private int typeId_; - /** - * optional int32 type_id = 3; - */ - public boolean hasTypeId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 type_id = 3; - */ - public int getTypeId() { - return typeId_; - } - - private void initFields() { - projection_ = ProtoBuf.Type.Argument.Projection.INV; - type_ = ProtoBuf.Type.getDefaultInstance(); - typeId_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (hasType()) { - if (!getType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeEnum(1, projection_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, type_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, typeId_); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeEnumSize(1, projection_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeMessageSize(2, type_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeInt32Size(3, typeId_); - } - size += unknownFields.size(); - 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 ProtoBuf.Type.Argument parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Type.Argument parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Type.Argument parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Type.Argument parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Type.Argument parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Type.Argument parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Type.Argument parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Type.Argument parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Type.Argument parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Type.Argument parseFrom( - CodedInputStream input, - 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(ProtoBuf.Type.Argument prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Type.Argument} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.Type.Argument, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Type.Argument) - ProtoBuf.Type.ArgumentOrBuilder { - // Construct using ProtoBuf.Type.Argument.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - projection_ = ProtoBuf.Type.Argument.Projection.INV; - bitField0_ = (bitField0_ & ~0x00000001); - type_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000002); - typeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Type.Argument getDefaultInstanceForType() { - return ProtoBuf.Type.Argument.getDefaultInstance(); - } - - public ProtoBuf.Type.Argument build() { - ProtoBuf.Type.Argument result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Type.Argument buildPartial() { - ProtoBuf.Type.Argument result = new ProtoBuf.Type.Argument(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.projection_ = projection_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.typeId_ = typeId_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Type.Argument other) { - if (other == ProtoBuf.Type.Argument.getDefaultInstance()) return this; - if (other.hasProjection()) { - setProjection(other.getProjection()); - } - if (other.hasType()) { - mergeType(other.getType()); - } - if (other.hasTypeId()) { - setTypeId(other.getTypeId()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (hasType()) { - if (!getType().isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Type.Argument parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Type.Argument) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private ProtoBuf.Type.Argument.Projection projection_ = ProtoBuf.Type.Argument.Projection.INV; - /** - * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; - */ - public boolean hasProjection() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; - */ - public ProtoBuf.Type.Argument.Projection getProjection() { - return projection_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; - */ - public Builder setProjection(ProtoBuf.Type.Argument.Projection value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - projection_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type.Argument.Projection projection = 1 [default = INV]; - */ - public Builder clearProjection() { - bitField0_ = (bitField0_ & ~0x00000001); - projection_ = ProtoBuf.Type.Argument.Projection.INV; - - return this; - } - - private ProtoBuf.Type type_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-         * When projection is STAR, no type is written, otherwise type must be specified
-         * 
- */ - public boolean hasType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-         * When projection is STAR, no type is written, otherwise type must be specified
-         * 
- */ - public ProtoBuf.Type getType() { - return type_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-         * When projection is STAR, no type is written, otherwise type must be specified
-         * 
- */ - public Builder setType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - type_ = value; - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-         * When projection is STAR, no type is written, otherwise type must be specified
-         * 
- */ - public Builder setType( - ProtoBuf.Type.Builder builderForValue) { - type_ = builderForValue.build(); - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-         * When projection is STAR, no type is written, otherwise type must be specified
-         * 
- */ - public Builder mergeType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - type_ != ProtoBuf.Type.getDefaultInstance()) { - type_ = - ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); - } else { - type_ = value; - } - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 2; - * - *
-         * When projection is STAR, no type is written, otherwise type must be specified
-         * 
- */ - public Builder clearType() { - type_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - private int typeId_ ; - /** - * optional int32 type_id = 3; - */ - public boolean hasTypeId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 type_id = 3; - */ - public int getTypeId() { - return typeId_; - } - /** - * optional int32 type_id = 3; - */ - public Builder setTypeId(int value) { - bitField0_ |= 0x00000004; - typeId_ = value; - - return this; - } - /** - * optional int32 type_id = 3; - */ - public Builder clearTypeId() { - bitField0_ = (bitField0_ & ~0x00000004); - typeId_ = 0; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Type.Argument) - } - - static { - defaultInstance = new Argument(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Type.Argument) - } - - private int bitField0_; - public static final int ARGUMENT_FIELD_NUMBER = 2; - private java.util.List argument_; - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public java.util.List getArgumentList() { - return argument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public java.util.List - getArgumentOrBuilderList() { - return argument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public int getArgumentCount() { - return argument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public ProtoBuf.Type.Argument getArgument(int index) { - return argument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public ProtoBuf.Type.ArgumentOrBuilder getArgumentOrBuilder( - int index) { - return argument_.get(index); - } - - public static final int NULLABLE_FIELD_NUMBER = 3; - private boolean nullable_; - /** - * optional bool nullable = 3 [default = false]; - */ - public boolean hasNullable() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional bool nullable = 3 [default = false]; - */ - public boolean getNullable() { - return nullable_; - } - - public static final int FLEXIBLE_TYPE_CAPABILITIES_ID_FIELD_NUMBER = 4; - private int flexibleTypeCapabilitiesId_; - /** - * optional int32 flexible_type_capabilities_id = 4; - * - *
-     * If this field is set, the type is flexible.
-     * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
-     * 
- */ - public boolean hasFlexibleTypeCapabilitiesId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 flexible_type_capabilities_id = 4; - * - *
-     * If this field is set, the type is flexible.
-     * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
-     * 
- */ - public int getFlexibleTypeCapabilitiesId() { - return flexibleTypeCapabilitiesId_; - } - - public static final int FLEXIBLE_UPPER_BOUND_FIELD_NUMBER = 5; - private ProtoBuf.Type flexibleUpperBound_; - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - public boolean hasFlexibleUpperBound() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - public ProtoBuf.Type getFlexibleUpperBound() { - return flexibleUpperBound_; - } - - public static final int FLEXIBLE_UPPER_BOUND_ID_FIELD_NUMBER = 8; - private int flexibleUpperBoundId_; - /** - * optional int32 flexible_upper_bound_id = 8; - */ - public boolean hasFlexibleUpperBoundId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 flexible_upper_bound_id = 8; - */ - public int getFlexibleUpperBoundId() { - return flexibleUpperBoundId_; - } - - public static final int CLASS_NAME_FIELD_NUMBER = 6; - private int className_; - /** - * optional int32 class_name = 6; - */ - public boolean hasClassName() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 class_name = 6; - */ - public int getClassName() { - return className_; - } - - public static final int TYPE_PARAMETER_FIELD_NUMBER = 7; - private int typeParameter_; - /** - * optional int32 type_parameter = 7; - * - *
-     * id of the type parameter
-     * 
- */ - public boolean hasTypeParameter() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int32 type_parameter = 7; - * - *
-     * id of the type parameter
-     * 
- */ - public int getTypeParameter() { - return typeParameter_; - } - - public static final int TYPE_PARAMETER_NAME_FIELD_NUMBER = 9; - private int typeParameterName_; - /** - * optional int32 type_parameter_name = 9; - * - *
-     * Name of the type parameter in the immediate owner
-     * 
- */ - public boolean hasTypeParameterName() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 type_parameter_name = 9; - * - *
-     * Name of the type parameter in the immediate owner
-     * 
- */ - public int getTypeParameterName() { - return typeParameterName_; - } - - public static final int TYPE_ALIAS_NAME_FIELD_NUMBER = 12; - private int typeAliasName_; - /** - * optional int32 type_alias_name = 12; - * - *
-     * Note that this may be present only for abbreviated_type
-     * Top level types are always fully expanded
-     * 
- */ - public boolean hasTypeAliasName() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int32 type_alias_name = 12; - * - *
-     * Note that this may be present only for abbreviated_type
-     * Top level types are always fully expanded
-     * 
- */ - public int getTypeAliasName() { - return typeAliasName_; - } - - public static final int OUTER_TYPE_FIELD_NUMBER = 10; - private ProtoBuf.Type outerType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-     * Outer type may be present only if class_name or type_alias_name is present
-     * 
- */ - public boolean hasOuterType() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-     * Outer type may be present only if class_name or type_alias_name is present
-     * 
- */ - public ProtoBuf.Type getOuterType() { - return outerType_; - } - - public static final int OUTER_TYPE_ID_FIELD_NUMBER = 11; - private int outerTypeId_; - /** - * optional int32 outer_type_id = 11; - */ - public boolean hasOuterTypeId() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional int32 outer_type_id = 11; - */ - public int getOuterTypeId() { - return outerTypeId_; - } - - public static final int ABBREVIATED_TYPE_FIELD_NUMBER = 13; - private ProtoBuf.Type abbreviatedType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - public boolean hasAbbreviatedType() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - public ProtoBuf.Type getAbbreviatedType() { - return abbreviatedType_; - } - - public static final int ABBREVIATED_TYPE_ID_FIELD_NUMBER = 14; - private int abbreviatedTypeId_; - /** - * optional int32 abbreviated_type_id = 14; - */ - public boolean hasAbbreviatedTypeId() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - /** - * optional int32 abbreviated_type_id = 14; - */ - public int getAbbreviatedTypeId() { - return abbreviatedTypeId_; - } - - public static final int FLAGS_FIELD_NUMBER = 1; - private int flags_; - /** - * optional int32 flags = 1; - * - *
-     *suspend
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00001000) == 0x00001000); - } - /** - * optional int32 flags = 1; - * - *
-     *suspend
-     * 
- */ - public int getFlags() { - return flags_; - } - - private void initFields() { - argument_ = java.util.Collections.emptyList(); - nullable_ = false; - flexibleTypeCapabilitiesId_ = 0; - flexibleUpperBound_ = ProtoBuf.Type.getDefaultInstance(); - flexibleUpperBoundId_ = 0; - className_ = 0; - typeParameter_ = 0; - typeParameterName_ = 0; - typeAliasName_ = 0; - outerType_ = ProtoBuf.Type.getDefaultInstance(); - outerTypeId_ = 0; - abbreviatedType_ = ProtoBuf.Type.getDefaultInstance(); - abbreviatedTypeId_ = 0; - flags_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getArgumentCount(); i++) { - if (!getArgument(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasFlexibleUpperBound()) { - if (!getFlexibleUpperBound().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasOuterType()) { - if (!getOuterType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasAbbreviatedType()) { - if (!getAbbreviatedType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00001000) == 0x00001000)) { - output.writeInt32(1, flags_); - } - for (int i = 0; i < argument_.size(); i++) { - output.writeMessage(2, argument_.get(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBool(3, nullable_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(4, flexibleTypeCapabilitiesId_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(5, flexibleUpperBound_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(6, className_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt32(7, typeParameter_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(8, flexibleUpperBoundId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeInt32(9, typeParameterName_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeMessage(10, outerType_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeInt32(11, outerTypeId_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeInt32(12, typeAliasName_); - } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - output.writeMessage(13, abbreviatedType_); - } - if (((bitField0_ & 0x00000800) == 0x00000800)) { - output.writeInt32(14, abbreviatedTypeId_); - } - extensionWriter.writeUntil(200, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00001000) == 0x00001000)) { - size += CodedOutputStream - .computeInt32Size(1, flags_); - } - for (int i = 0; i < argument_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(2, argument_.get(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeBoolSize(3, nullable_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(4, flexibleTypeCapabilitiesId_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeMessageSize(5, flexibleUpperBound_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeInt32Size(6, className_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += CodedOutputStream - .computeInt32Size(7, typeParameter_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeInt32Size(8, flexibleUpperBoundId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += CodedOutputStream - .computeInt32Size(9, typeParameterName_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += CodedOutputStream - .computeMessageSize(10, outerType_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += CodedOutputStream - .computeInt32Size(11, outerTypeId_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += CodedOutputStream - .computeInt32Size(12, typeAliasName_); - } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - size += CodedOutputStream - .computeMessageSize(13, abbreviatedType_); - } - if (((bitField0_ & 0x00000800) == 0x00000800)) { - size += CodedOutputStream - .computeInt32Size(14, abbreviatedTypeId_); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.Type parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Type parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Type parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Type parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Type parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Type parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Type parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Type parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Type parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Type parseFrom( - CodedInputStream input, - 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(ProtoBuf.Type prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Type} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.Type, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Type) - ProtoBuf.TypeOrBuilder { - // Construct using ProtoBuf.Type.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - argument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - nullable_ = false; - bitField0_ = (bitField0_ & ~0x00000002); - flexibleTypeCapabilitiesId_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - flexibleUpperBound_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - flexibleUpperBoundId_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - className_ = 0; - bitField0_ = (bitField0_ & ~0x00000020); - typeParameter_ = 0; - bitField0_ = (bitField0_ & ~0x00000040); - typeParameterName_ = 0; - bitField0_ = (bitField0_ & ~0x00000080); - typeAliasName_ = 0; - bitField0_ = (bitField0_ & ~0x00000100); - outerType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000200); - outerTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000400); - abbreviatedType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000800); - abbreviatedTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00001000); - flags_ = 0; - bitField0_ = (bitField0_ & ~0x00002000); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Type getDefaultInstanceForType() { - return ProtoBuf.Type.getDefaultInstance(); - } - - public ProtoBuf.Type build() { - ProtoBuf.Type result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Type buildPartial() { - ProtoBuf.Type result = new ProtoBuf.Type(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - argument_ = java.util.Collections.unmodifiableList(argument_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.argument_ = argument_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000001; - } - result.nullable_ = nullable_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000002; - } - result.flexibleTypeCapabilitiesId_ = flexibleTypeCapabilitiesId_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000004; - } - result.flexibleUpperBound_ = flexibleUpperBound_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000008; - } - result.flexibleUpperBoundId_ = flexibleUpperBoundId_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000010; - } - result.className_ = className_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000020; - } - result.typeParameter_ = typeParameter_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000040; - } - result.typeParameterName_ = typeParameterName_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { - to_bitField0_ |= 0x00000080; - } - result.typeAliasName_ = typeAliasName_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000100; - } - result.outerType_ = outerType_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000200; - } - result.outerTypeId_ = outerTypeId_; - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { - to_bitField0_ |= 0x00000400; - } - result.abbreviatedType_ = abbreviatedType_; - if (((from_bitField0_ & 0x00001000) == 0x00001000)) { - to_bitField0_ |= 0x00000800; - } - result.abbreviatedTypeId_ = abbreviatedTypeId_; - if (((from_bitField0_ & 0x00002000) == 0x00002000)) { - to_bitField0_ |= 0x00001000; - } - result.flags_ = flags_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Type other) { - if (other == ProtoBuf.Type.getDefaultInstance()) return this; - if (!other.argument_.isEmpty()) { - if (argument_.isEmpty()) { - argument_ = other.argument_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureArgumentIsMutable(); - argument_.addAll(other.argument_); - } - - } - if (other.hasNullable()) { - setNullable(other.getNullable()); - } - if (other.hasFlexibleTypeCapabilitiesId()) { - setFlexibleTypeCapabilitiesId(other.getFlexibleTypeCapabilitiesId()); - } - if (other.hasFlexibleUpperBound()) { - mergeFlexibleUpperBound(other.getFlexibleUpperBound()); - } - if (other.hasFlexibleUpperBoundId()) { - setFlexibleUpperBoundId(other.getFlexibleUpperBoundId()); - } - if (other.hasClassName()) { - setClassName(other.getClassName()); - } - if (other.hasTypeParameter()) { - setTypeParameter(other.getTypeParameter()); - } - if (other.hasTypeParameterName()) { - setTypeParameterName(other.getTypeParameterName()); - } - if (other.hasTypeAliasName()) { - setTypeAliasName(other.getTypeAliasName()); - } - if (other.hasOuterType()) { - mergeOuterType(other.getOuterType()); - } - if (other.hasOuterTypeId()) { - setOuterTypeId(other.getOuterTypeId()); - } - if (other.hasAbbreviatedType()) { - mergeAbbreviatedType(other.getAbbreviatedType()); - } - if (other.hasAbbreviatedTypeId()) { - setAbbreviatedTypeId(other.getAbbreviatedTypeId()); - } - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getArgumentCount(); i++) { - if (!getArgument(i).isInitialized()) { - - return false; - } - } - if (hasFlexibleUpperBound()) { - if (!getFlexibleUpperBound().isInitialized()) { - - return false; - } - } - if (hasOuterType()) { - if (!getOuterType().isInitialized()) { - - return false; - } - } - if (hasAbbreviatedType()) { - if (!getAbbreviatedType().isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Type parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Type) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List argument_ = - java.util.Collections.emptyList(); - private void ensureArgumentIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - argument_ = new java.util.ArrayList(argument_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public java.util.List getArgumentList() { - return java.util.Collections.unmodifiableList(argument_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public int getArgumentCount() { - return argument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public ProtoBuf.Type.Argument getArgument(int index) { - return argument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder setArgument( - int index, ProtoBuf.Type.Argument value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentIsMutable(); - argument_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder setArgument( - int index, ProtoBuf.Type.Argument.Builder builderForValue) { - ensureArgumentIsMutable(); - argument_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder addArgument(ProtoBuf.Type.Argument value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentIsMutable(); - argument_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder addArgument( - int index, ProtoBuf.Type.Argument value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentIsMutable(); - argument_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder addArgument( - ProtoBuf.Type.Argument.Builder builderForValue) { - ensureArgumentIsMutable(); - argument_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder addArgument( - int index, ProtoBuf.Type.Argument.Builder builderForValue) { - ensureArgumentIsMutable(); - argument_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder addAllArgument( - java.lang.Iterable values) { - ensureArgumentIsMutable(); - AbstractMessageLite.Builder.addAll( - values, argument_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder clearArgument() { - argument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type.Argument argument = 2; - */ - public Builder removeArgument(int index) { - ensureArgumentIsMutable(); - argument_.remove(index); - - return this; - } - - private boolean nullable_ ; - /** - * optional bool nullable = 3 [default = false]; - */ - public boolean hasNullable() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional bool nullable = 3 [default = false]; - */ - public boolean getNullable() { - return nullable_; - } - /** - * optional bool nullable = 3 [default = false]; - */ - public Builder setNullable(boolean value) { - bitField0_ |= 0x00000002; - nullable_ = value; - - return this; - } - /** - * optional bool nullable = 3 [default = false]; - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000002); - nullable_ = false; - - return this; - } - - private int flexibleTypeCapabilitiesId_ ; - /** - * optional int32 flexible_type_capabilities_id = 4; - * - *
-       * If this field is set, the type is flexible.
-       * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
-       * 
- */ - public boolean hasFlexibleTypeCapabilitiesId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 flexible_type_capabilities_id = 4; - * - *
-       * If this field is set, the type is flexible.
-       * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
-       * 
- */ - public int getFlexibleTypeCapabilitiesId() { - return flexibleTypeCapabilitiesId_; - } - /** - * optional int32 flexible_type_capabilities_id = 4; - * - *
-       * If this field is set, the type is flexible.
-       * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
-       * 
- */ - public Builder setFlexibleTypeCapabilitiesId(int value) { - bitField0_ |= 0x00000004; - flexibleTypeCapabilitiesId_ = value; - - return this; - } - /** - * optional int32 flexible_type_capabilities_id = 4; - * - *
-       * If this field is set, the type is flexible.
-       * All the other fields and extensions represent its lower bound, and flexible_upper_bound must be set and represents its upper bound.
-       * 
- */ - public Builder clearFlexibleTypeCapabilitiesId() { - bitField0_ = (bitField0_ & ~0x00000004); - flexibleTypeCapabilitiesId_ = 0; - - return this; - } - - private ProtoBuf.Type flexibleUpperBound_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - public boolean hasFlexibleUpperBound() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - public ProtoBuf.Type getFlexibleUpperBound() { - return flexibleUpperBound_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - public Builder setFlexibleUpperBound(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - flexibleUpperBound_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - public Builder setFlexibleUpperBound( - ProtoBuf.Type.Builder builderForValue) { - flexibleUpperBound_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - public Builder mergeFlexibleUpperBound(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - flexibleUpperBound_ != ProtoBuf.Type.getDefaultInstance()) { - flexibleUpperBound_ = - ProtoBuf.Type.newBuilder(flexibleUpperBound_).mergeFrom(value).buildPartial(); - } else { - flexibleUpperBound_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type flexible_upper_bound = 5; - */ - public Builder clearFlexibleUpperBound() { - flexibleUpperBound_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private int flexibleUpperBoundId_ ; - /** - * optional int32 flexible_upper_bound_id = 8; - */ - public boolean hasFlexibleUpperBoundId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 flexible_upper_bound_id = 8; - */ - public int getFlexibleUpperBoundId() { - return flexibleUpperBoundId_; - } - /** - * optional int32 flexible_upper_bound_id = 8; - */ - public Builder setFlexibleUpperBoundId(int value) { - bitField0_ |= 0x00000010; - flexibleUpperBoundId_ = value; - - return this; - } - /** - * optional int32 flexible_upper_bound_id = 8; - */ - public Builder clearFlexibleUpperBoundId() { - bitField0_ = (bitField0_ & ~0x00000010); - flexibleUpperBoundId_ = 0; - - return this; - } - - private int className_ ; - /** - * optional int32 class_name = 6; - */ - public boolean hasClassName() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int32 class_name = 6; - */ - public int getClassName() { - return className_; - } - /** - * optional int32 class_name = 6; - */ - public Builder setClassName(int value) { - bitField0_ |= 0x00000020; - className_ = value; - - return this; - } - /** - * optional int32 class_name = 6; - */ - public Builder clearClassName() { - bitField0_ = (bitField0_ & ~0x00000020); - className_ = 0; - - return this; - } - - private int typeParameter_ ; - /** - * optional int32 type_parameter = 7; - * - *
-       * id of the type parameter
-       * 
- */ - public boolean hasTypeParameter() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 type_parameter = 7; - * - *
-       * id of the type parameter
-       * 
- */ - public int getTypeParameter() { - return typeParameter_; - } - /** - * optional int32 type_parameter = 7; - * - *
-       * id of the type parameter
-       * 
- */ - public Builder setTypeParameter(int value) { - bitField0_ |= 0x00000040; - typeParameter_ = value; - - return this; - } - /** - * optional int32 type_parameter = 7; - * - *
-       * id of the type parameter
-       * 
- */ - public Builder clearTypeParameter() { - bitField0_ = (bitField0_ & ~0x00000040); - typeParameter_ = 0; - - return this; - } - - private int typeParameterName_ ; - /** - * optional int32 type_parameter_name = 9; - * - *
-       * Name of the type parameter in the immediate owner
-       * 
- */ - public boolean hasTypeParameterName() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int32 type_parameter_name = 9; - * - *
-       * Name of the type parameter in the immediate owner
-       * 
- */ - public int getTypeParameterName() { - return typeParameterName_; - } - /** - * optional int32 type_parameter_name = 9; - * - *
-       * Name of the type parameter in the immediate owner
-       * 
- */ - public Builder setTypeParameterName(int value) { - bitField0_ |= 0x00000080; - typeParameterName_ = value; - - return this; - } - /** - * optional int32 type_parameter_name = 9; - * - *
-       * Name of the type parameter in the immediate owner
-       * 
- */ - public Builder clearTypeParameterName() { - bitField0_ = (bitField0_ & ~0x00000080); - typeParameterName_ = 0; - - return this; - } - - private int typeAliasName_ ; - /** - * optional int32 type_alias_name = 12; - * - *
-       * Note that this may be present only for abbreviated_type
-       * Top level types are always fully expanded
-       * 
- */ - public boolean hasTypeAliasName() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional int32 type_alias_name = 12; - * - *
-       * Note that this may be present only for abbreviated_type
-       * Top level types are always fully expanded
-       * 
- */ - public int getTypeAliasName() { - return typeAliasName_; - } - /** - * optional int32 type_alias_name = 12; - * - *
-       * Note that this may be present only for abbreviated_type
-       * Top level types are always fully expanded
-       * 
- */ - public Builder setTypeAliasName(int value) { - bitField0_ |= 0x00000100; - typeAliasName_ = value; - - return this; - } - /** - * optional int32 type_alias_name = 12; - * - *
-       * Note that this may be present only for abbreviated_type
-       * Top level types are always fully expanded
-       * 
- */ - public Builder clearTypeAliasName() { - bitField0_ = (bitField0_ & ~0x00000100); - typeAliasName_ = 0; - - return this; - } - - private ProtoBuf.Type outerType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-       * Outer type may be present only if class_name or type_alias_name is present
-       * 
- */ - public boolean hasOuterType() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-       * Outer type may be present only if class_name or type_alias_name is present
-       * 
- */ - public ProtoBuf.Type getOuterType() { - return outerType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-       * Outer type may be present only if class_name or type_alias_name is present
-       * 
- */ - public Builder setOuterType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - outerType_ = value; - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-       * Outer type may be present only if class_name or type_alias_name is present
-       * 
- */ - public Builder setOuterType( - ProtoBuf.Type.Builder builderForValue) { - outerType_ = builderForValue.build(); - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-       * Outer type may be present only if class_name or type_alias_name is present
-       * 
- */ - public Builder mergeOuterType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000200) == 0x00000200) && - outerType_ != ProtoBuf.Type.getDefaultInstance()) { - outerType_ = - ProtoBuf.Type.newBuilder(outerType_).mergeFrom(value).buildPartial(); - } else { - outerType_ = value; - } - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type outer_type = 10; - * - *
-       * Outer type may be present only if class_name or type_alias_name is present
-       * 
- */ - public Builder clearOuterType() { - outerType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000200); - return this; - } - - private int outerTypeId_ ; - /** - * optional int32 outer_type_id = 11; - */ - public boolean hasOuterTypeId() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - /** - * optional int32 outer_type_id = 11; - */ - public int getOuterTypeId() { - return outerTypeId_; - } - /** - * optional int32 outer_type_id = 11; - */ - public Builder setOuterTypeId(int value) { - bitField0_ |= 0x00000400; - outerTypeId_ = value; - - return this; - } - /** - * optional int32 outer_type_id = 11; - */ - public Builder clearOuterTypeId() { - bitField0_ = (bitField0_ & ~0x00000400); - outerTypeId_ = 0; - - return this; - } - - private ProtoBuf.Type abbreviatedType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - public boolean hasAbbreviatedType() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - public ProtoBuf.Type getAbbreviatedType() { - return abbreviatedType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - public Builder setAbbreviatedType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - abbreviatedType_ = value; - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - public Builder setAbbreviatedType( - ProtoBuf.Type.Builder builderForValue) { - abbreviatedType_ = builderForValue.build(); - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - public Builder mergeAbbreviatedType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000800) == 0x00000800) && - abbreviatedType_ != ProtoBuf.Type.getDefaultInstance()) { - abbreviatedType_ = - ProtoBuf.Type.newBuilder(abbreviatedType_).mergeFrom(value).buildPartial(); - } else { - abbreviatedType_ = value; - } - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type abbreviated_type = 13; - */ - public Builder clearAbbreviatedType() { - abbreviatedType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - private int abbreviatedTypeId_ ; - /** - * optional int32 abbreviated_type_id = 14; - */ - public boolean hasAbbreviatedTypeId() { - return ((bitField0_ & 0x00001000) == 0x00001000); - } - /** - * optional int32 abbreviated_type_id = 14; - */ - public int getAbbreviatedTypeId() { - return abbreviatedTypeId_; - } - /** - * optional int32 abbreviated_type_id = 14; - */ - public Builder setAbbreviatedTypeId(int value) { - bitField0_ |= 0x00001000; - abbreviatedTypeId_ = value; - - return this; - } - /** - * optional int32 abbreviated_type_id = 14; - */ - public Builder clearAbbreviatedTypeId() { - bitField0_ = (bitField0_ & ~0x00001000); - abbreviatedTypeId_ = 0; - - return this; - } - - private int flags_ ; - /** - * optional int32 flags = 1; - * - *
-       *suspend
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00002000) == 0x00002000); - } - /** - * optional int32 flags = 1; - * - *
-       *suspend
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 1; - * - *
-       *suspend
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00002000; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 1; - * - *
-       *suspend
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00002000); - flags_ = 0; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Type) - } - - static { - defaultInstance = new Type(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Type) - } - - public interface TypeParameterOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeParameter) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * required int32 id = 1; - */ - boolean hasId(); - /** - * required int32 id = 1; - */ - int getId(); - - /** - * required int32 name = 2; - */ - boolean hasName(); - /** - * required int32 name = 2; - */ - int getName(); - - /** - * optional bool reified = 3 [default = false]; - */ - boolean hasReified(); - /** - * optional bool reified = 3 [default = false]; - */ - boolean getReified(); - - /** - * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; - */ - boolean hasVariance(); - /** - * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; - */ - ProtoBuf.TypeParameter.Variance getVariance(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - java.util.List - getUpperBoundList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - ProtoBuf.Type getUpperBound(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - int getUpperBoundCount(); - - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - java.util.List getUpperBoundIdList(); - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - int getUpperBoundIdCount(); - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - int getUpperBoundId(int index); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeParameter} - */ - public static final class TypeParameter extends - GeneratedMessageLite.ExtendableMessage< - TypeParameter> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeParameter) - TypeParameterOrBuilder { - // Use TypeParameter.newBuilder() to construct. - private TypeParameter(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private TypeParameter(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final TypeParameter defaultInstance; - public static TypeParameter getDefaultInstance() { - return defaultInstance; - } - - public TypeParameter getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private TypeParameter( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - id_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - name_ = input.readInt32(); - break; - } - case 24: { - bitField0_ |= 0x00000004; - reified_ = input.readBool(); - break; - } - case 32: { - int rawValue = input.readEnum(); - ProtoBuf.TypeParameter.Variance value = ProtoBuf.TypeParameter.Variance.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000008; - variance_ = value; - } - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - upperBound_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - upperBound_.add(input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry)); - break; - } - case 48: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - upperBoundId_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - upperBoundId_.add(input.readInt32()); - break; - } - case 50: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) { - upperBoundId_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - while (input.getBytesUntilLimit() > 0) { - upperBoundId_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - upperBound_ = java.util.Collections.unmodifiableList(upperBound_); - } - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - upperBoundId_ = java.util.Collections.unmodifiableList(upperBoundId_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public TypeParameter parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new TypeParameter(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.TypeParameter.Variance} - */ - public enum Variance - implements Internal.EnumLite { - /** - * IN = 0; - */ - IN(0, 0), - /** - * OUT = 1; - */ - OUT(1, 1), - /** - * INV = 2; - */ - INV(2, 2), - ; - - /** - * IN = 0; - */ - public static final int IN_VALUE = 0; - /** - * OUT = 1; - */ - public static final int OUT_VALUE = 1; - /** - * INV = 2; - */ - public static final int INV_VALUE = 2; - - - public final int getNumber() { return value; } - - public static Variance valueOf(int value) { - switch (value) { - case 0: return IN; - case 1: return OUT; - case 2: return INV; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - public Variance findValueByNumber(int number) { - return Variance.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Variance(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.TypeParameter.Variance) - } - - private int bitField0_; - public static final int ID_FIELD_NUMBER = 1; - private int id_; - /** - * required int32 id = 1; - */ - public boolean hasId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 id = 1; - */ - public int getId() { - return id_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private int name_; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - - public static final int REIFIED_FIELD_NUMBER = 3; - private boolean reified_; - /** - * optional bool reified = 3 [default = false]; - */ - public boolean hasReified() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional bool reified = 3 [default = false]; - */ - public boolean getReified() { - return reified_; - } - - public static final int VARIANCE_FIELD_NUMBER = 4; - private ProtoBuf.TypeParameter.Variance variance_; - /** - * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; - */ - public boolean hasVariance() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; - */ - public ProtoBuf.TypeParameter.Variance getVariance() { - return variance_; - } - - public static final int UPPER_BOUND_FIELD_NUMBER = 5; - private java.util.List upperBound_; - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public java.util.List getUpperBoundList() { - return upperBound_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public java.util.List - getUpperBoundOrBuilderList() { - return upperBound_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public int getUpperBoundCount() { - return upperBound_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public ProtoBuf.Type getUpperBound(int index) { - return upperBound_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public ProtoBuf.TypeOrBuilder getUpperBoundOrBuilder( - int index) { - return upperBound_.get(index); - } - - public static final int UPPER_BOUND_ID_FIELD_NUMBER = 6; - private java.util.List upperBoundId_; - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public java.util.List - getUpperBoundIdList() { - return upperBoundId_; - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public int getUpperBoundIdCount() { - return upperBoundId_.size(); - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public int getUpperBoundId(int index) { - return upperBoundId_.get(index); - } - private int upperBoundIdMemoizedSerializedSize = -1; - - private void initFields() { - id_ = 0; - name_ = 0; - reified_ = false; - variance_ = ProtoBuf.TypeParameter.Variance.INV; - upperBound_ = java.util.Collections.emptyList(); - upperBoundId_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasId()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - for (int i = 0; i < getUpperBoundCount(); i++) { - if (!getUpperBound(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, id_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, name_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBool(3, reified_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeEnum(4, variance_.getNumber()); - } - for (int i = 0; i < upperBound_.size(); i++) { - output.writeMessage(5, upperBound_.get(i)); - } - if (getUpperBoundIdList().size() > 0) { - output.writeRawVarint32(50); - output.writeRawVarint32(upperBoundIdMemoizedSerializedSize); - } - for (int i = 0; i < upperBoundId_.size(); i++) { - output.writeInt32NoTag(upperBoundId_.get(i)); - } - extensionWriter.writeUntil(1000, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, id_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(2, name_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeBoolSize(3, reified_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeEnumSize(4, variance_.getNumber()); - } - for (int i = 0; i < upperBound_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(5, upperBound_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < upperBoundId_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(upperBoundId_.get(i)); - } - size += dataSize; - if (!getUpperBoundIdList().isEmpty()) { - size += 1; - size += CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - upperBoundIdMemoizedSerializedSize = dataSize; - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.TypeParameter parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.TypeParameter parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.TypeParameter parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.TypeParameter parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.TypeParameter parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.TypeParameter parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.TypeParameter parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.TypeParameter parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.TypeParameter parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.TypeParameter parseFrom( - CodedInputStream input, - 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(ProtoBuf.TypeParameter prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeParameter} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.TypeParameter, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeParameter) - ProtoBuf.TypeParameterOrBuilder { - // Construct using ProtoBuf.TypeParameter.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - id_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - reified_ = false; - bitField0_ = (bitField0_ & ~0x00000004); - variance_ = ProtoBuf.TypeParameter.Variance.INV; - bitField0_ = (bitField0_ & ~0x00000008); - upperBound_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - upperBoundId_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.TypeParameter getDefaultInstanceForType() { - return ProtoBuf.TypeParameter.getDefaultInstance(); - } - - public ProtoBuf.TypeParameter build() { - ProtoBuf.TypeParameter result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.TypeParameter buildPartial() { - ProtoBuf.TypeParameter result = new ProtoBuf.TypeParameter(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.id_ = id_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.reified_ = reified_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.variance_ = variance_; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - upperBound_ = java.util.Collections.unmodifiableList(upperBound_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.upperBound_ = upperBound_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - upperBoundId_ = java.util.Collections.unmodifiableList(upperBoundId_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.upperBoundId_ = upperBoundId_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.TypeParameter other) { - if (other == ProtoBuf.TypeParameter.getDefaultInstance()) return this; - if (other.hasId()) { - setId(other.getId()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasReified()) { - setReified(other.getReified()); - } - if (other.hasVariance()) { - setVariance(other.getVariance()); - } - if (!other.upperBound_.isEmpty()) { - if (upperBound_.isEmpty()) { - upperBound_ = other.upperBound_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureUpperBoundIsMutable(); - upperBound_.addAll(other.upperBound_); - } - - } - if (!other.upperBoundId_.isEmpty()) { - if (upperBoundId_.isEmpty()) { - upperBoundId_ = other.upperBoundId_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureUpperBoundIdIsMutable(); - upperBoundId_.addAll(other.upperBoundId_); - } - - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasId()) { - - return false; - } - if (!hasName()) { - - return false; - } - for (int i = 0; i < getUpperBoundCount(); i++) { - if (!getUpperBound(i).isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.TypeParameter parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.TypeParameter) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int id_ ; - /** - * required int32 id = 1; - */ - public boolean hasId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required int32 id = 1; - */ - public int getId() { - return id_; - } - /** - * required int32 id = 1; - */ - public Builder setId(int value) { - bitField0_ |= 0x00000001; - id_ = value; - - return this; - } - /** - * required int32 id = 1; - */ - public Builder clearId() { - bitField0_ = (bitField0_ & ~0x00000001); - id_ = 0; - - return this; - } - - private int name_ ; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 2; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000002; - name_ = value; - - return this; - } - /** - * required int32 name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; - - return this; - } - - private boolean reified_ ; - /** - * optional bool reified = 3 [default = false]; - */ - public boolean hasReified() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional bool reified = 3 [default = false]; - */ - public boolean getReified() { - return reified_; - } - /** - * optional bool reified = 3 [default = false]; - */ - public Builder setReified(boolean value) { - bitField0_ |= 0x00000004; - reified_ = value; - - return this; - } - /** - * optional bool reified = 3 [default = false]; - */ - public Builder clearReified() { - bitField0_ = (bitField0_ & ~0x00000004); - reified_ = false; - - return this; - } - - private ProtoBuf.TypeParameter.Variance variance_ = ProtoBuf.TypeParameter.Variance.INV; - /** - * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; - */ - public boolean hasVariance() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; - */ - public ProtoBuf.TypeParameter.Variance getVariance() { - return variance_; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; - */ - public Builder setVariance(ProtoBuf.TypeParameter.Variance value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - variance_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeParameter.Variance variance = 4 [default = INV]; - */ - public Builder clearVariance() { - bitField0_ = (bitField0_ & ~0x00000008); - variance_ = ProtoBuf.TypeParameter.Variance.INV; - - return this; - } - - private java.util.List upperBound_ = - java.util.Collections.emptyList(); - private void ensureUpperBoundIsMutable() { - if (!((bitField0_ & 0x00000010) == 0x00000010)) { - upperBound_ = new java.util.ArrayList(upperBound_); - bitField0_ |= 0x00000010; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public java.util.List getUpperBoundList() { - return java.util.Collections.unmodifiableList(upperBound_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public int getUpperBoundCount() { - return upperBound_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public ProtoBuf.Type getUpperBound(int index) { - return upperBound_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder setUpperBound( - int index, ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureUpperBoundIsMutable(); - upperBound_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder setUpperBound( - int index, ProtoBuf.Type.Builder builderForValue) { - ensureUpperBoundIsMutable(); - upperBound_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder addUpperBound(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureUpperBoundIsMutable(); - upperBound_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder addUpperBound( - int index, ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureUpperBoundIsMutable(); - upperBound_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder addUpperBound( - ProtoBuf.Type.Builder builderForValue) { - ensureUpperBoundIsMutable(); - upperBound_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder addUpperBound( - int index, ProtoBuf.Type.Builder builderForValue) { - ensureUpperBoundIsMutable(); - upperBound_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder addAllUpperBound( - java.lang.Iterable values) { - ensureUpperBoundIsMutable(); - AbstractMessageLite.Builder.addAll( - values, upperBound_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder clearUpperBound() { - upperBound_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type upper_bound = 5; - */ - public Builder removeUpperBound(int index) { - ensureUpperBoundIsMutable(); - upperBound_.remove(index); - - return this; - } - - private java.util.List upperBoundId_ = java.util.Collections.emptyList(); - private void ensureUpperBoundIdIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - upperBoundId_ = new java.util.ArrayList(upperBoundId_); - bitField0_ |= 0x00000020; - } - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public java.util.List - getUpperBoundIdList() { - return java.util.Collections.unmodifiableList(upperBoundId_); - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public int getUpperBoundIdCount() { - return upperBoundId_.size(); - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public int getUpperBoundId(int index) { - return upperBoundId_.get(index); - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public Builder setUpperBoundId( - int index, int value) { - ensureUpperBoundIdIsMutable(); - upperBoundId_.set(index, value); - - return this; - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public Builder addUpperBoundId(int value) { - ensureUpperBoundIdIsMutable(); - upperBoundId_.add(value); - - return this; - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public Builder addAllUpperBoundId( - java.lang.Iterable values) { - ensureUpperBoundIdIsMutable(); - AbstractMessageLite.Builder.addAll( - values, upperBoundId_); - - return this; - } - /** - * repeated int32 upper_bound_id = 6 [packed = true]; - */ - public Builder clearUpperBoundId() { - upperBoundId_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeParameter) - } - - static { - defaultInstance = new TypeParameter(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeParameter) - } - - public interface ClassOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Class) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *ClassKind
-     *isInner
-     *isData
-     *isExternal
-     *isExpect
-     *isInline
-     *isFun
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *ClassKind
-     *isInner
-     *isData
-     *isExternal
-     *isExpect
-     *isInline
-     *isFun
-     * 
- */ - int getFlags(); - - /** - * required int32 fq_name = 3; - */ - boolean hasFqName(); - /** - * required int32 fq_name = 3; - */ - int getFqName(); - - /** - * optional int32 companion_object_name = 4; - */ - boolean hasCompanionObjectName(); - /** - * optional int32 companion_object_name = 4; - */ - int getCompanionObjectName(); - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - java.util.List - getTypeParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - ProtoBuf.TypeParameter getTypeParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - int getTypeParameterCount(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - java.util.List - getSupertypeList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - ProtoBuf.Type getSupertype(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - int getSupertypeCount(); - - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - java.util.List getSupertypeIdList(); - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - int getSupertypeIdCount(); - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - int getSupertypeId(int index); - - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - java.util.List getNestedClassNameList(); - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - int getNestedClassNameCount(); - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - int getNestedClassName(int index); - - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - java.util.List - getConstructorList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - ProtoBuf.Constructor getConstructor(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - int getConstructorCount(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - java.util.List - getFunctionList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - ProtoBuf.Function getFunction(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - int getFunctionCount(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - java.util.List - getPropertyList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - ProtoBuf.Property getProperty(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - int getPropertyCount(); - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - java.util.List - getTypeAliasList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - ProtoBuf.TypeAlias getTypeAlias(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - int getTypeAliasCount(); - - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - java.util.List - getEnumEntryList(); - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - ProtoBuf.EnumEntry getEnumEntry(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - int getEnumEntryCount(); - - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - java.util.List getSealedSubclassFqNameList(); - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - int getSealedSubclassFqNameCount(); - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - int getSealedSubclassFqName(int index); - - /** - * optional int32 inline_class_underlying_property_name = 17; - */ - boolean hasInlineClassUnderlyingPropertyName(); - /** - * optional int32 inline_class_underlying_property_name = 17; - */ - int getInlineClassUnderlyingPropertyName(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - boolean hasInlineClassUnderlyingType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - ProtoBuf.Type getInlineClassUnderlyingType(); - - /** - * optional int32 inline_class_underlying_type_id = 19; - */ - boolean hasInlineClassUnderlyingTypeId(); - /** - * optional int32 inline_class_underlying_type_id = 19; - */ - int getInlineClassUnderlyingTypeId(); - - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - boolean hasTypeTable(); - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - ProtoBuf.TypeTable getTypeTable(); - - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - java.util.List getVersionRequirementList(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirementCount(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirement(int index); - - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - boolean hasVersionRequirementTable(); - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - ProtoBuf.VersionRequirementTable getVersionRequirementTable(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class} - */ - public static final class Class extends - GeneratedMessageLite.ExtendableMessage< - Class> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Class) - ClassOrBuilder { - // Use Class.newBuilder() to construct. - private Class(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Class(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Class defaultInstance; - public static Class getDefaultInstance() { - return defaultInstance; - } - - public Class getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Class( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 16: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - supertypeId_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - supertypeId_.add(input.readInt32()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) { - supertypeId_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - while (input.getBytesUntilLimit() > 0) { - supertypeId_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 24: { - bitField0_ |= 0x00000002; - fqName_ = input.readInt32(); - break; - } - case 32: { - bitField0_ |= 0x00000004; - companionObjectName_ = input.readInt32(); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - typeParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - typeParameter_.add(input.readMessage(ProtoBuf.TypeParameter.PARSER, extensionRegistry)); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - supertype_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - supertype_.add(input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry)); - break; - } - case 56: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - nestedClassName_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - nestedClassName_.add(input.readInt32()); - break; - } - case 58: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040) && input.getBytesUntilLimit() > 0) { - nestedClassName_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - while (input.getBytesUntilLimit() > 0) { - nestedClassName_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - constructor_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; - } - constructor_.add(input.readMessage(ProtoBuf.Constructor.PARSER, extensionRegistry)); - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - function_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - function_.add(input.readMessage(ProtoBuf.Function.PARSER, extensionRegistry)); - break; - } - case 82: { - if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { - property_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000200; - } - property_.add(input.readMessage(ProtoBuf.Property.PARSER, extensionRegistry)); - break; - } - case 90: { - if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { - typeAlias_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; - } - typeAlias_.add(input.readMessage(ProtoBuf.TypeAlias.PARSER, extensionRegistry)); - break; - } - case 106: { - if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - enumEntry_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000800; - } - enumEntry_.add(input.readMessage(ProtoBuf.EnumEntry.PARSER, extensionRegistry)); - break; - } - case 128: { - if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) { - sealedSubclassFqName_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00001000; - } - sealedSubclassFqName_.add(input.readInt32()); - break; - } - case 130: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00001000) == 0x00001000) && input.getBytesUntilLimit() > 0) { - sealedSubclassFqName_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00001000; - } - while (input.getBytesUntilLimit() > 0) { - sealedSubclassFqName_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 136: { - bitField0_ |= 0x00000008; - inlineClassUnderlyingPropertyName_ = input.readInt32(); - break; - } - case 146: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = inlineClassUnderlyingType_.toBuilder(); - } - inlineClassUnderlyingType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(inlineClassUnderlyingType_); - inlineClassUnderlyingType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - case 152: { - bitField0_ |= 0x00000020; - inlineClassUnderlyingTypeId_ = input.readInt32(); - break; - } - case 242: { - ProtoBuf.TypeTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000040) == 0x00000040)) { - subBuilder = typeTable_.toBuilder(); - } - typeTable_ = input.readMessage(ProtoBuf.TypeTable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(typeTable_); - typeTable_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000040; - break; - } - case 248: { - if (!((mutable_bitField0_ & 0x00020000) == 0x00020000)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00020000; - } - versionRequirement_.add(input.readInt32()); - break; - } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00020000) == 0x00020000) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00020000; - } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 258: { - ProtoBuf.VersionRequirementTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - subBuilder = versionRequirementTable_.toBuilder(); - } - versionRequirementTable_ = input.readMessage(ProtoBuf.VersionRequirementTable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(versionRequirementTable_); - versionRequirementTable_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000080; - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - supertypeId_ = java.util.Collections.unmodifiableList(supertypeId_); - } - if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - } - if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - supertype_ = java.util.Collections.unmodifiableList(supertype_); - } - if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - nestedClassName_ = java.util.Collections.unmodifiableList(nestedClassName_); - } - if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - constructor_ = java.util.Collections.unmodifiableList(constructor_); - } - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - function_ = java.util.Collections.unmodifiableList(function_); - } - if (((mutable_bitField0_ & 0x00000200) == 0x00000200)) { - property_ = java.util.Collections.unmodifiableList(property_); - } - if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) { - typeAlias_ = java.util.Collections.unmodifiableList(typeAlias_); - } - if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); - } - if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) { - sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_); - } - if (((mutable_bitField0_ & 0x00020000) == 0x00020000)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Class parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Class(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.Class.Kind} - */ - public enum Kind - implements Internal.EnumLite { - /** - * CLASS = 0; - * - *
-       * 3 bits
-       * 
- */ - CLASS(0, 0), - /** - * INTERFACE = 1; - */ - INTERFACE(1, 1), - /** - * ENUM_CLASS = 2; - */ - ENUM_CLASS(2, 2), - /** - * ENUM_ENTRY = 3; - */ - ENUM_ENTRY(3, 3), - /** - * ANNOTATION_CLASS = 4; - */ - ANNOTATION_CLASS(4, 4), - /** - * OBJECT = 5; - */ - OBJECT(5, 5), - /** - * COMPANION_OBJECT = 6; - */ - COMPANION_OBJECT(6, 6), - ; - - /** - * CLASS = 0; - * - *
-       * 3 bits
-       * 
- */ - public static final int CLASS_VALUE = 0; - /** - * INTERFACE = 1; - */ - public static final int INTERFACE_VALUE = 1; - /** - * ENUM_CLASS = 2; - */ - public static final int ENUM_CLASS_VALUE = 2; - /** - * ENUM_ENTRY = 3; - */ - public static final int ENUM_ENTRY_VALUE = 3; - /** - * ANNOTATION_CLASS = 4; - */ - public static final int ANNOTATION_CLASS_VALUE = 4; - /** - * OBJECT = 5; - */ - public static final int OBJECT_VALUE = 5; - /** - * COMPANION_OBJECT = 6; - */ - public static final int COMPANION_OBJECT_VALUE = 6; - - - public final int getNumber() { return value; } - - public static Kind valueOf(int value) { - switch (value) { - case 0: return CLASS; - case 1: return INTERFACE; - case 2: return ENUM_CLASS; - case 3: return ENUM_ENTRY; - case 4: return ANNOTATION_CLASS; - case 5: return OBJECT; - case 6: return COMPANION_OBJECT; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - public Kind findValueByNumber(int number) { - return Kind.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Kind(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Class.Kind) - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 1; - private int flags_; - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *ClassKind
-     *isInner
-     *isData
-     *isExternal
-     *isExpect
-     *isInline
-     *isFun
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *ClassKind
-     *isInner
-     *isData
-     *isExternal
-     *isExpect
-     *isInline
-     *isFun
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int FQ_NAME_FIELD_NUMBER = 3; - private int fqName_; - /** - * required int32 fq_name = 3; - */ - public boolean hasFqName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 fq_name = 3; - */ - public int getFqName() { - return fqName_; - } - - public static final int COMPANION_OBJECT_NAME_FIELD_NUMBER = 4; - private int companionObjectName_; - /** - * optional int32 companion_object_name = 4; - */ - public boolean hasCompanionObjectName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 companion_object_name = 4; - */ - public int getCompanionObjectName() { - return companionObjectName_; - } - - public static final int TYPE_PARAMETER_FIELD_NUMBER = 5; - private java.util.List typeParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public java.util.List getTypeParameterList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public java.util.List - getTypeParameterOrBuilderList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( - int index) { - return typeParameter_.get(index); - } - - public static final int SUPERTYPE_FIELD_NUMBER = 6; - private java.util.List supertype_; - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public java.util.List getSupertypeList() { - return supertype_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public java.util.List - getSupertypeOrBuilderList() { - return supertype_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public int getSupertypeCount() { - return supertype_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public ProtoBuf.Type getSupertype(int index) { - return supertype_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public ProtoBuf.TypeOrBuilder getSupertypeOrBuilder( - int index) { - return supertype_.get(index); - } - - public static final int SUPERTYPE_ID_FIELD_NUMBER = 2; - private java.util.List supertypeId_; - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public java.util.List - getSupertypeIdList() { - return supertypeId_; - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public int getSupertypeIdCount() { - return supertypeId_.size(); - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public int getSupertypeId(int index) { - return supertypeId_.get(index); - } - private int supertypeIdMemoizedSerializedSize = -1; - - public static final int NESTED_CLASS_NAME_FIELD_NUMBER = 7; - private java.util.List nestedClassName_; - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public java.util.List - getNestedClassNameList() { - return nestedClassName_; - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public int getNestedClassNameCount() { - return nestedClassName_.size(); - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public int getNestedClassName(int index) { - return nestedClassName_.get(index); - } - private int nestedClassNameMemoizedSerializedSize = -1; - - public static final int CONSTRUCTOR_FIELD_NUMBER = 8; - private java.util.List constructor_; - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public java.util.List getConstructorList() { - return constructor_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public java.util.List - getConstructorOrBuilderList() { - return constructor_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public int getConstructorCount() { - return constructor_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public ProtoBuf.Constructor getConstructor(int index) { - return constructor_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public ProtoBuf.ConstructorOrBuilder getConstructorOrBuilder( - int index) { - return constructor_.get(index); - } - - public static final int FUNCTION_FIELD_NUMBER = 9; - private java.util.List function_; - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public java.util.List getFunctionList() { - return function_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public java.util.List - getFunctionOrBuilderList() { - return function_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public int getFunctionCount() { - return function_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public ProtoBuf.Function getFunction(int index) { - return function_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public ProtoBuf.FunctionOrBuilder getFunctionOrBuilder( - int index) { - return function_.get(index); - } - - public static final int PROPERTY_FIELD_NUMBER = 10; - private java.util.List property_; - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public java.util.List getPropertyList() { - return property_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public java.util.List - getPropertyOrBuilderList() { - return property_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public int getPropertyCount() { - return property_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public ProtoBuf.Property getProperty(int index) { - return property_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public ProtoBuf.PropertyOrBuilder getPropertyOrBuilder( - int index) { - return property_.get(index); - } - - public static final int TYPE_ALIAS_FIELD_NUMBER = 11; - private java.util.List typeAlias_; - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public java.util.List getTypeAliasList() { - return typeAlias_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public java.util.List - getTypeAliasOrBuilderList() { - return typeAlias_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public int getTypeAliasCount() { - return typeAlias_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public ProtoBuf.TypeAlias getTypeAlias(int index) { - return typeAlias_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public ProtoBuf.TypeAliasOrBuilder getTypeAliasOrBuilder( - int index) { - return typeAlias_.get(index); - } - - public static final int ENUM_ENTRY_FIELD_NUMBER = 13; - private java.util.List enumEntry_; - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public java.util.List getEnumEntryList() { - return enumEntry_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public java.util.List - getEnumEntryOrBuilderList() { - return enumEntry_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public int getEnumEntryCount() { - return enumEntry_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public ProtoBuf.EnumEntry getEnumEntry(int index) { - return enumEntry_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public ProtoBuf.EnumEntryOrBuilder getEnumEntryOrBuilder( - int index) { - return enumEntry_.get(index); - } - - public static final int SEALED_SUBCLASS_FQ_NAME_FIELD_NUMBER = 16; - private java.util.List sealedSubclassFqName_; - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public java.util.List - getSealedSubclassFqNameList() { - return sealedSubclassFqName_; - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public int getSealedSubclassFqNameCount() { - return sealedSubclassFqName_.size(); - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public int getSealedSubclassFqName(int index) { - return sealedSubclassFqName_.get(index); - } - private int sealedSubclassFqNameMemoizedSerializedSize = -1; - - public static final int INLINE_CLASS_UNDERLYING_PROPERTY_NAME_FIELD_NUMBER = 17; - private int inlineClassUnderlyingPropertyName_; - /** - * optional int32 inline_class_underlying_property_name = 17; - */ - public boolean hasInlineClassUnderlyingPropertyName() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 inline_class_underlying_property_name = 17; - */ - public int getInlineClassUnderlyingPropertyName() { - return inlineClassUnderlyingPropertyName_; - } - - public static final int INLINE_CLASS_UNDERLYING_TYPE_FIELD_NUMBER = 18; - private ProtoBuf.Type inlineClassUnderlyingType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - public boolean hasInlineClassUnderlyingType() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - public ProtoBuf.Type getInlineClassUnderlyingType() { - return inlineClassUnderlyingType_; - } - - public static final int INLINE_CLASS_UNDERLYING_TYPE_ID_FIELD_NUMBER = 19; - private int inlineClassUnderlyingTypeId_; - /** - * optional int32 inline_class_underlying_type_id = 19; - */ - public boolean hasInlineClassUnderlyingTypeId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int32 inline_class_underlying_type_id = 19; - */ - public int getInlineClassUnderlyingTypeId() { - return inlineClassUnderlyingTypeId_; - } - - public static final int TYPE_TABLE_FIELD_NUMBER = 30; - private ProtoBuf.TypeTable typeTable_; - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public boolean hasTypeTable() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public ProtoBuf.TypeTable getTypeTable() { - return typeTable_; - } - - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public java.util.List - getVersionRequirementList() { - return versionRequirement_; - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - - public static final int VERSION_REQUIREMENT_TABLE_FIELD_NUMBER = 32; - private ProtoBuf.VersionRequirementTable versionRequirementTable_; - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public boolean hasVersionRequirementTable() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public ProtoBuf.VersionRequirementTable getVersionRequirementTable() { - return versionRequirementTable_; - } - - private void initFields() { - flags_ = 6; - fqName_ = 0; - companionObjectName_ = 0; - typeParameter_ = java.util.Collections.emptyList(); - supertype_ = java.util.Collections.emptyList(); - supertypeId_ = java.util.Collections.emptyList(); - nestedClassName_ = java.util.Collections.emptyList(); - constructor_ = java.util.Collections.emptyList(); - function_ = java.util.Collections.emptyList(); - property_ = java.util.Collections.emptyList(); - typeAlias_ = java.util.Collections.emptyList(); - enumEntry_ = java.util.Collections.emptyList(); - sealedSubclassFqName_ = java.util.Collections.emptyList(); - inlineClassUnderlyingPropertyName_ = 0; - inlineClassUnderlyingType_ = ProtoBuf.Type.getDefaultInstance(); - inlineClassUnderlyingTypeId_ = 0; - typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); - versionRequirement_ = java.util.Collections.emptyList(); - versionRequirementTable_ = ProtoBuf.VersionRequirementTable.getDefaultInstance(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasFqName()) { - memoizedIsInitialized = 0; - return false; - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getSupertypeCount(); i++) { - if (!getSupertype(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getConstructorCount(); i++) { - if (!getConstructor(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getFunctionCount(); i++) { - if (!getFunction(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getPropertyCount(); i++) { - if (!getProperty(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getTypeAliasCount(); i++) { - if (!getTypeAlias(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getEnumEntryCount(); i++) { - if (!getEnumEntry(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasInlineClassUnderlyingType()) { - if (!getInlineClassUnderlyingType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasTypeTable()) { - if (!getTypeTable().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, flags_); - } - if (getSupertypeIdList().size() > 0) { - output.writeRawVarint32(18); - output.writeRawVarint32(supertypeIdMemoizedSerializedSize); - } - for (int i = 0; i < supertypeId_.size(); i++) { - output.writeInt32NoTag(supertypeId_.get(i)); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(3, fqName_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(4, companionObjectName_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - output.writeMessage(5, typeParameter_.get(i)); - } - for (int i = 0; i < supertype_.size(); i++) { - output.writeMessage(6, supertype_.get(i)); - } - if (getNestedClassNameList().size() > 0) { - output.writeRawVarint32(58); - output.writeRawVarint32(nestedClassNameMemoizedSerializedSize); - } - for (int i = 0; i < nestedClassName_.size(); i++) { - output.writeInt32NoTag(nestedClassName_.get(i)); - } - for (int i = 0; i < constructor_.size(); i++) { - output.writeMessage(8, constructor_.get(i)); - } - for (int i = 0; i < function_.size(); i++) { - output.writeMessage(9, function_.get(i)); - } - for (int i = 0; i < property_.size(); i++) { - output.writeMessage(10, property_.get(i)); - } - for (int i = 0; i < typeAlias_.size(); i++) { - output.writeMessage(11, typeAlias_.get(i)); - } - for (int i = 0; i < enumEntry_.size(); i++) { - output.writeMessage(13, enumEntry_.get(i)); - } - if (getSealedSubclassFqNameList().size() > 0) { - output.writeRawVarint32(130); - output.writeRawVarint32(sealedSubclassFqNameMemoizedSerializedSize); - } - for (int i = 0; i < sealedSubclassFqName_.size(); i++) { - output.writeInt32NoTag(sealedSubclassFqName_.get(i)); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(17, inlineClassUnderlyingPropertyName_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(18, inlineClassUnderlyingType_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt32(19, inlineClassUnderlyingTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeMessage(30, typeTable_); - } - for (int i = 0; i < versionRequirement_.size(); i++) { - output.writeInt32(31, versionRequirement_.get(i)); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeMessage(32, versionRequirementTable_); - } - extensionWriter.writeUntil(19000, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, flags_); - } - { - int dataSize = 0; - for (int i = 0; i < supertypeId_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(supertypeId_.get(i)); - } - size += dataSize; - if (!getSupertypeIdList().isEmpty()) { - size += 1; - size += CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - supertypeIdMemoizedSerializedSize = dataSize; - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(3, fqName_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeInt32Size(4, companionObjectName_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(5, typeParameter_.get(i)); - } - for (int i = 0; i < supertype_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(6, supertype_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < nestedClassName_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(nestedClassName_.get(i)); - } - size += dataSize; - if (!getNestedClassNameList().isEmpty()) { - size += 1; - size += CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - nestedClassNameMemoizedSerializedSize = dataSize; - } - for (int i = 0; i < constructor_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(8, constructor_.get(i)); - } - for (int i = 0; i < function_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(9, function_.get(i)); - } - for (int i = 0; i < property_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(10, property_.get(i)); - } - for (int i = 0; i < typeAlias_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(11, typeAlias_.get(i)); - } - for (int i = 0; i < enumEntry_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(13, enumEntry_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < sealedSubclassFqName_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(sealedSubclassFqName_.get(i)); - } - size += dataSize; - if (!getSealedSubclassFqNameList().isEmpty()) { - size += 2; - size += CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - sealedSubclassFqNameMemoizedSerializedSize = dataSize; - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeInt32Size(17, inlineClassUnderlyingPropertyName_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeMessageSize(18, inlineClassUnderlyingType_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += CodedOutputStream - .computeInt32Size(19, inlineClassUnderlyingTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += CodedOutputStream - .computeMessageSize(30, typeTable_); - } - { - int dataSize = 0; - for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(versionRequirement_.get(i)); - } - size += dataSize; - size += 2 * getVersionRequirementList().size(); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += CodedOutputStream - .computeMessageSize(32, versionRequirementTable_); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.Class parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Class parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Class parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Class parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Class parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Class parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Class parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Class parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Class parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Class parseFrom( - CodedInputStream input, - 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(ProtoBuf.Class prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Class} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.Class, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Class) - ProtoBuf.ClassOrBuilder { - // Construct using ProtoBuf.Class.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 6; - bitField0_ = (bitField0_ & ~0x00000001); - fqName_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - companionObjectName_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - supertype_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - supertypeId_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - nestedClassName_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - constructor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - function_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - property_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); - typeAlias_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - enumEntry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000800); - sealedSubclassFqName_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); - inlineClassUnderlyingPropertyName_ = 0; - bitField0_ = (bitField0_ & ~0x00002000); - inlineClassUnderlyingType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00004000); - inlineClassUnderlyingTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00008000); - typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00010000); - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00020000); - versionRequirementTable_ = ProtoBuf.VersionRequirementTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00040000); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Class getDefaultInstanceForType() { - return ProtoBuf.Class.getDefaultInstance(); - } - - public ProtoBuf.Class build() { - ProtoBuf.Class result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Class buildPartial() { - ProtoBuf.Class result = new ProtoBuf.Class(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.fqName_ = fqName_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.companionObjectName_ = companionObjectName_; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.typeParameter_ = typeParameter_; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - supertype_ = java.util.Collections.unmodifiableList(supertype_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.supertype_ = supertype_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - supertypeId_ = java.util.Collections.unmodifiableList(supertypeId_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.supertypeId_ = supertypeId_; - if (((bitField0_ & 0x00000040) == 0x00000040)) { - nestedClassName_ = java.util.Collections.unmodifiableList(nestedClassName_); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.nestedClassName_ = nestedClassName_; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - constructor_ = java.util.Collections.unmodifiableList(constructor_); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.constructor_ = constructor_; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - function_ = java.util.Collections.unmodifiableList(function_); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.function_ = function_; - if (((bitField0_ & 0x00000200) == 0x00000200)) { - property_ = java.util.Collections.unmodifiableList(property_); - bitField0_ = (bitField0_ & ~0x00000200); - } - result.property_ = property_; - if (((bitField0_ & 0x00000400) == 0x00000400)) { - typeAlias_ = java.util.Collections.unmodifiableList(typeAlias_); - bitField0_ = (bitField0_ & ~0x00000400); - } - result.typeAlias_ = typeAlias_; - if (((bitField0_ & 0x00000800) == 0x00000800)) { - enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); - bitField0_ = (bitField0_ & ~0x00000800); - } - result.enumEntry_ = enumEntry_; - if (((bitField0_ & 0x00001000) == 0x00001000)) { - sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_); - bitField0_ = (bitField0_ & ~0x00001000); - } - result.sealedSubclassFqName_ = sealedSubclassFqName_; - if (((from_bitField0_ & 0x00002000) == 0x00002000)) { - to_bitField0_ |= 0x00000008; - } - result.inlineClassUnderlyingPropertyName_ = inlineClassUnderlyingPropertyName_; - if (((from_bitField0_ & 0x00004000) == 0x00004000)) { - to_bitField0_ |= 0x00000010; - } - result.inlineClassUnderlyingType_ = inlineClassUnderlyingType_; - if (((from_bitField0_ & 0x00008000) == 0x00008000)) { - to_bitField0_ |= 0x00000020; - } - result.inlineClassUnderlyingTypeId_ = inlineClassUnderlyingTypeId_; - if (((from_bitField0_ & 0x00010000) == 0x00010000)) { - to_bitField0_ |= 0x00000040; - } - result.typeTable_ = typeTable_; - if (((bitField0_ & 0x00020000) == 0x00020000)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00020000); - } - result.versionRequirement_ = versionRequirement_; - if (((from_bitField0_ & 0x00040000) == 0x00040000)) { - to_bitField0_ |= 0x00000080; - } - result.versionRequirementTable_ = versionRequirementTable_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Class other) { - if (other == ProtoBuf.Class.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasFqName()) { - setFqName(other.getFqName()); - } - if (other.hasCompanionObjectName()) { - setCompanionObjectName(other.getCompanionObjectName()); - } - if (!other.typeParameter_.isEmpty()) { - if (typeParameter_.isEmpty()) { - typeParameter_ = other.typeParameter_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureTypeParameterIsMutable(); - typeParameter_.addAll(other.typeParameter_); - } - - } - if (!other.supertype_.isEmpty()) { - if (supertype_.isEmpty()) { - supertype_ = other.supertype_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureSupertypeIsMutable(); - supertype_.addAll(other.supertype_); - } - - } - if (!other.supertypeId_.isEmpty()) { - if (supertypeId_.isEmpty()) { - supertypeId_ = other.supertypeId_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureSupertypeIdIsMutable(); - supertypeId_.addAll(other.supertypeId_); - } - - } - if (!other.nestedClassName_.isEmpty()) { - if (nestedClassName_.isEmpty()) { - nestedClassName_ = other.nestedClassName_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureNestedClassNameIsMutable(); - nestedClassName_.addAll(other.nestedClassName_); - } - - } - if (!other.constructor_.isEmpty()) { - if (constructor_.isEmpty()) { - constructor_ = other.constructor_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureConstructorIsMutable(); - constructor_.addAll(other.constructor_); - } - - } - if (!other.function_.isEmpty()) { - if (function_.isEmpty()) { - function_ = other.function_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureFunctionIsMutable(); - function_.addAll(other.function_); - } - - } - if (!other.property_.isEmpty()) { - if (property_.isEmpty()) { - property_ = other.property_; - bitField0_ = (bitField0_ & ~0x00000200); - } else { - ensurePropertyIsMutable(); - property_.addAll(other.property_); - } - - } - if (!other.typeAlias_.isEmpty()) { - if (typeAlias_.isEmpty()) { - typeAlias_ = other.typeAlias_; - bitField0_ = (bitField0_ & ~0x00000400); - } else { - ensureTypeAliasIsMutable(); - typeAlias_.addAll(other.typeAlias_); - } - - } - if (!other.enumEntry_.isEmpty()) { - if (enumEntry_.isEmpty()) { - enumEntry_ = other.enumEntry_; - bitField0_ = (bitField0_ & ~0x00000800); - } else { - ensureEnumEntryIsMutable(); - enumEntry_.addAll(other.enumEntry_); - } - - } - if (!other.sealedSubclassFqName_.isEmpty()) { - if (sealedSubclassFqName_.isEmpty()) { - sealedSubclassFqName_ = other.sealedSubclassFqName_; - bitField0_ = (bitField0_ & ~0x00001000); - } else { - ensureSealedSubclassFqNameIsMutable(); - sealedSubclassFqName_.addAll(other.sealedSubclassFqName_); - } - - } - if (other.hasInlineClassUnderlyingPropertyName()) { - setInlineClassUnderlyingPropertyName(other.getInlineClassUnderlyingPropertyName()); - } - if (other.hasInlineClassUnderlyingType()) { - mergeInlineClassUnderlyingType(other.getInlineClassUnderlyingType()); - } - if (other.hasInlineClassUnderlyingTypeId()) { - setInlineClassUnderlyingTypeId(other.getInlineClassUnderlyingTypeId()); - } - if (other.hasTypeTable()) { - mergeTypeTable(other.getTypeTable()); - } - if (!other.versionRequirement_.isEmpty()) { - if (versionRequirement_.isEmpty()) { - versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00020000); - } else { - ensureVersionRequirementIsMutable(); - versionRequirement_.addAll(other.versionRequirement_); - } - - } - if (other.hasVersionRequirementTable()) { - mergeVersionRequirementTable(other.getVersionRequirementTable()); - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasFqName()) { - - return false; - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getSupertypeCount(); i++) { - if (!getSupertype(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getConstructorCount(); i++) { - if (!getConstructor(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getFunctionCount(); i++) { - if (!getFunction(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getPropertyCount(); i++) { - if (!getProperty(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getTypeAliasCount(); i++) { - if (!getTypeAlias(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getEnumEntryCount(); i++) { - if (!getEnumEntry(i).isInitialized()) { - - return false; - } - } - if (hasInlineClassUnderlyingType()) { - if (!getInlineClassUnderlyingType().isInitialized()) { - - return false; - } - } - if (hasTypeTable()) { - if (!getTypeTable().isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Class parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Class) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ = 6; - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *ClassKind
-       *isInner
-       *isData
-       *isExternal
-       *isExpect
-       *isInline
-       *isFun
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *ClassKind
-       *isInner
-       *isData
-       *isExternal
-       *isExpect
-       *isInline
-       *isFun
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *ClassKind
-       *isInner
-       *isData
-       *isExternal
-       *isExpect
-       *isInline
-       *isFun
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *ClassKind
-       *isInner
-       *isData
-       *isExternal
-       *isExpect
-       *isInline
-       *isFun
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 6; - - return this; - } - - private int fqName_ ; - /** - * required int32 fq_name = 3; - */ - public boolean hasFqName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 fq_name = 3; - */ - public int getFqName() { - return fqName_; - } - /** - * required int32 fq_name = 3; - */ - public Builder setFqName(int value) { - bitField0_ |= 0x00000002; - fqName_ = value; - - return this; - } - /** - * required int32 fq_name = 3; - */ - public Builder clearFqName() { - bitField0_ = (bitField0_ & ~0x00000002); - fqName_ = 0; - - return this; - } - - private int companionObjectName_ ; - /** - * optional int32 companion_object_name = 4; - */ - public boolean hasCompanionObjectName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 companion_object_name = 4; - */ - public int getCompanionObjectName() { - return companionObjectName_; - } - /** - * optional int32 companion_object_name = 4; - */ - public Builder setCompanionObjectName(int value) { - bitField0_ |= 0x00000004; - companionObjectName_ = value; - - return this; - } - /** - * optional int32 companion_object_name = 4; - */ - public Builder clearCompanionObjectName() { - bitField0_ = (bitField0_ & ~0x00000004); - companionObjectName_ = 0; - - return this; - } - - private java.util.List typeParameter_ = - java.util.Collections.emptyList(); - private void ensureTypeParameterIsMutable() { - if (!((bitField0_ & 0x00000008) == 0x00000008)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); - bitField0_ |= 0x00000008; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public java.util.List getTypeParameterList() { - return java.util.Collections.unmodifiableList(typeParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder setTypeParameter( - int index, ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder setTypeParameter( - int index, ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder addTypeParameter(ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder addTypeParameter( - int index, ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder addTypeParameter( - ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder addTypeParameter( - int index, ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder addAllTypeParameter( - java.lang.Iterable values) { - ensureTypeParameterIsMutable(); - AbstractMessageLite.Builder.addAll( - values, typeParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder clearTypeParameter() { - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 5; - */ - public Builder removeTypeParameter(int index) { - ensureTypeParameterIsMutable(); - typeParameter_.remove(index); - - return this; - } - - private java.util.List supertype_ = - java.util.Collections.emptyList(); - private void ensureSupertypeIsMutable() { - if (!((bitField0_ & 0x00000010) == 0x00000010)) { - supertype_ = new java.util.ArrayList(supertype_); - bitField0_ |= 0x00000010; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public java.util.List getSupertypeList() { - return java.util.Collections.unmodifiableList(supertype_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public int getSupertypeCount() { - return supertype_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public ProtoBuf.Type getSupertype(int index) { - return supertype_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder setSupertype( - int index, ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSupertypeIsMutable(); - supertype_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder setSupertype( - int index, ProtoBuf.Type.Builder builderForValue) { - ensureSupertypeIsMutable(); - supertype_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder addSupertype(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSupertypeIsMutable(); - supertype_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder addSupertype( - int index, ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSupertypeIsMutable(); - supertype_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder addSupertype( - ProtoBuf.Type.Builder builderForValue) { - ensureSupertypeIsMutable(); - supertype_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder addSupertype( - int index, ProtoBuf.Type.Builder builderForValue) { - ensureSupertypeIsMutable(); - supertype_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder addAllSupertype( - java.lang.Iterable values) { - ensureSupertypeIsMutable(); - AbstractMessageLite.Builder.addAll( - values, supertype_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder clearSupertype() { - supertype_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type supertype = 6; - */ - public Builder removeSupertype(int index) { - ensureSupertypeIsMutable(); - supertype_.remove(index); - - return this; - } - - private java.util.List supertypeId_ = java.util.Collections.emptyList(); - private void ensureSupertypeIdIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - supertypeId_ = new java.util.ArrayList(supertypeId_); - bitField0_ |= 0x00000020; - } - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public java.util.List - getSupertypeIdList() { - return java.util.Collections.unmodifiableList(supertypeId_); - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public int getSupertypeIdCount() { - return supertypeId_.size(); - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public int getSupertypeId(int index) { - return supertypeId_.get(index); - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public Builder setSupertypeId( - int index, int value) { - ensureSupertypeIdIsMutable(); - supertypeId_.set(index, value); - - return this; - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public Builder addSupertypeId(int value) { - ensureSupertypeIdIsMutable(); - supertypeId_.add(value); - - return this; - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public Builder addAllSupertypeId( - java.lang.Iterable values) { - ensureSupertypeIdIsMutable(); - AbstractMessageLite.Builder.addAll( - values, supertypeId_); - - return this; - } - /** - * repeated int32 supertype_id = 2 [packed = true]; - */ - public Builder clearSupertypeId() { - supertypeId_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } - - private java.util.List nestedClassName_ = java.util.Collections.emptyList(); - private void ensureNestedClassNameIsMutable() { - if (!((bitField0_ & 0x00000040) == 0x00000040)) { - nestedClassName_ = new java.util.ArrayList(nestedClassName_); - bitField0_ |= 0x00000040; - } - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public java.util.List - getNestedClassNameList() { - return java.util.Collections.unmodifiableList(nestedClassName_); - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public int getNestedClassNameCount() { - return nestedClassName_.size(); - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public int getNestedClassName(int index) { - return nestedClassName_.get(index); - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public Builder setNestedClassName( - int index, int value) { - ensureNestedClassNameIsMutable(); - nestedClassName_.set(index, value); - - return this; - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public Builder addNestedClassName(int value) { - ensureNestedClassNameIsMutable(); - nestedClassName_.add(value); - - return this; - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public Builder addAllNestedClassName( - java.lang.Iterable values) { - ensureNestedClassNameIsMutable(); - AbstractMessageLite.Builder.addAll( - values, nestedClassName_); - - return this; - } - /** - * repeated int32 nested_class_name = 7 [packed = true]; - */ - public Builder clearNestedClassName() { - nestedClassName_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - - return this; - } - - private java.util.List constructor_ = - java.util.Collections.emptyList(); - private void ensureConstructorIsMutable() { - if (!((bitField0_ & 0x00000080) == 0x00000080)) { - constructor_ = new java.util.ArrayList(constructor_); - bitField0_ |= 0x00000080; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public java.util.List getConstructorList() { - return java.util.Collections.unmodifiableList(constructor_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public int getConstructorCount() { - return constructor_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public ProtoBuf.Constructor getConstructor(int index) { - return constructor_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder setConstructor( - int index, ProtoBuf.Constructor value) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstructorIsMutable(); - constructor_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder setConstructor( - int index, ProtoBuf.Constructor.Builder builderForValue) { - ensureConstructorIsMutable(); - constructor_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder addConstructor(ProtoBuf.Constructor value) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstructorIsMutable(); - constructor_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder addConstructor( - int index, ProtoBuf.Constructor value) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstructorIsMutable(); - constructor_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder addConstructor( - ProtoBuf.Constructor.Builder builderForValue) { - ensureConstructorIsMutable(); - constructor_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder addConstructor( - int index, ProtoBuf.Constructor.Builder builderForValue) { - ensureConstructorIsMutable(); - constructor_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder addAllConstructor( - java.lang.Iterable values) { - ensureConstructorIsMutable(); - AbstractMessageLite.Builder.addAll( - values, constructor_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder clearConstructor() { - constructor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Constructor constructor = 8; - */ - public Builder removeConstructor(int index) { - ensureConstructorIsMutable(); - constructor_.remove(index); - - return this; - } - - private java.util.List function_ = - java.util.Collections.emptyList(); - private void ensureFunctionIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - function_ = new java.util.ArrayList(function_); - bitField0_ |= 0x00000100; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public java.util.List getFunctionList() { - return java.util.Collections.unmodifiableList(function_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public int getFunctionCount() { - return function_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public ProtoBuf.Function getFunction(int index) { - return function_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder setFunction( - int index, ProtoBuf.Function value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionIsMutable(); - function_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder setFunction( - int index, ProtoBuf.Function.Builder builderForValue) { - ensureFunctionIsMutable(); - function_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder addFunction(ProtoBuf.Function value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionIsMutable(); - function_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder addFunction( - int index, ProtoBuf.Function value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionIsMutable(); - function_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder addFunction( - ProtoBuf.Function.Builder builderForValue) { - ensureFunctionIsMutable(); - function_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder addFunction( - int index, ProtoBuf.Function.Builder builderForValue) { - ensureFunctionIsMutable(); - function_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder addAllFunction( - java.lang.Iterable values) { - ensureFunctionIsMutable(); - AbstractMessageLite.Builder.addAll( - values, function_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder clearFunction() { - function_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Function function = 9; - */ - public Builder removeFunction(int index) { - ensureFunctionIsMutable(); - function_.remove(index); - - return this; - } - - private java.util.List property_ = - java.util.Collections.emptyList(); - private void ensurePropertyIsMutable() { - if (!((bitField0_ & 0x00000200) == 0x00000200)) { - property_ = new java.util.ArrayList(property_); - bitField0_ |= 0x00000200; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public java.util.List getPropertyList() { - return java.util.Collections.unmodifiableList(property_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public int getPropertyCount() { - return property_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public ProtoBuf.Property getProperty(int index) { - return property_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder setProperty( - int index, ProtoBuf.Property value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder setProperty( - int index, ProtoBuf.Property.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder addProperty(ProtoBuf.Property value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder addProperty( - int index, ProtoBuf.Property value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropertyIsMutable(); - property_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder addProperty( - ProtoBuf.Property.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder addProperty( - int index, ProtoBuf.Property.Builder builderForValue) { - ensurePropertyIsMutable(); - property_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder addAllProperty( - java.lang.Iterable values) { - ensurePropertyIsMutable(); - AbstractMessageLite.Builder.addAll( - values, property_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder clearProperty() { - property_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Property property = 10; - */ - public Builder removeProperty(int index) { - ensurePropertyIsMutable(); - property_.remove(index); - - return this; - } - - private java.util.List typeAlias_ = - java.util.Collections.emptyList(); - private void ensureTypeAliasIsMutable() { - if (!((bitField0_ & 0x00000400) == 0x00000400)) { - typeAlias_ = new java.util.ArrayList(typeAlias_); - bitField0_ |= 0x00000400; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public java.util.List getTypeAliasList() { - return java.util.Collections.unmodifiableList(typeAlias_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public int getTypeAliasCount() { - return typeAlias_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public ProtoBuf.TypeAlias getTypeAlias(int index) { - return typeAlias_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder setTypeAlias( - int index, ProtoBuf.TypeAlias value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeAliasIsMutable(); - typeAlias_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder setTypeAlias( - int index, ProtoBuf.TypeAlias.Builder builderForValue) { - ensureTypeAliasIsMutable(); - typeAlias_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder addTypeAlias(ProtoBuf.TypeAlias value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeAliasIsMutable(); - typeAlias_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder addTypeAlias( - int index, ProtoBuf.TypeAlias value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeAliasIsMutable(); - typeAlias_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder addTypeAlias( - ProtoBuf.TypeAlias.Builder builderForValue) { - ensureTypeAliasIsMutable(); - typeAlias_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder addTypeAlias( - int index, ProtoBuf.TypeAlias.Builder builderForValue) { - ensureTypeAliasIsMutable(); - typeAlias_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder addAllTypeAlias( - java.lang.Iterable values) { - ensureTypeAliasIsMutable(); - AbstractMessageLite.Builder.addAll( - values, typeAlias_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder clearTypeAlias() { - typeAlias_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeAlias type_alias = 11; - */ - public Builder removeTypeAlias(int index) { - ensureTypeAliasIsMutable(); - typeAlias_.remove(index); - - return this; - } - - private java.util.List enumEntry_ = - java.util.Collections.emptyList(); - private void ensureEnumEntryIsMutable() { - if (!((bitField0_ & 0x00000800) == 0x00000800)) { - enumEntry_ = new java.util.ArrayList(enumEntry_); - bitField0_ |= 0x00000800; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public java.util.List getEnumEntryList() { - return java.util.Collections.unmodifiableList(enumEntry_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public int getEnumEntryCount() { - return enumEntry_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public ProtoBuf.EnumEntry getEnumEntry(int index) { - return enumEntry_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder setEnumEntry( - int index, ProtoBuf.EnumEntry value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnumEntryIsMutable(); - enumEntry_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder setEnumEntry( - int index, ProtoBuf.EnumEntry.Builder builderForValue) { - ensureEnumEntryIsMutable(); - enumEntry_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder addEnumEntry(ProtoBuf.EnumEntry value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnumEntryIsMutable(); - enumEntry_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder addEnumEntry( - int index, ProtoBuf.EnumEntry value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnumEntryIsMutable(); - enumEntry_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder addEnumEntry( - ProtoBuf.EnumEntry.Builder builderForValue) { - ensureEnumEntryIsMutable(); - enumEntry_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder addEnumEntry( - int index, ProtoBuf.EnumEntry.Builder builderForValue) { - ensureEnumEntryIsMutable(); - enumEntry_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder addAllEnumEntry( - java.lang.Iterable values) { - ensureEnumEntryIsMutable(); - AbstractMessageLite.Builder.addAll( - values, enumEntry_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder clearEnumEntry() { - enumEntry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000800); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.EnumEntry enum_entry = 13; - */ - public Builder removeEnumEntry(int index) { - ensureEnumEntryIsMutable(); - enumEntry_.remove(index); - - return this; - } - - private java.util.List sealedSubclassFqName_ = java.util.Collections.emptyList(); - private void ensureSealedSubclassFqNameIsMutable() { - if (!((bitField0_ & 0x00001000) == 0x00001000)) { - sealedSubclassFqName_ = new java.util.ArrayList(sealedSubclassFqName_); - bitField0_ |= 0x00001000; - } - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public java.util.List - getSealedSubclassFqNameList() { - return java.util.Collections.unmodifiableList(sealedSubclassFqName_); - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public int getSealedSubclassFqNameCount() { - return sealedSubclassFqName_.size(); - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public int getSealedSubclassFqName(int index) { - return sealedSubclassFqName_.get(index); - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public Builder setSealedSubclassFqName( - int index, int value) { - ensureSealedSubclassFqNameIsMutable(); - sealedSubclassFqName_.set(index, value); - - return this; - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public Builder addSealedSubclassFqName(int value) { - ensureSealedSubclassFqNameIsMutable(); - sealedSubclassFqName_.add(value); - - return this; - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public Builder addAllSealedSubclassFqName( - java.lang.Iterable values) { - ensureSealedSubclassFqNameIsMutable(); - AbstractMessageLite.Builder.addAll( - values, sealedSubclassFqName_); - - return this; - } - /** - * repeated int32 sealed_subclass_fq_name = 16 [packed = true]; - */ - public Builder clearSealedSubclassFqName() { - sealedSubclassFqName_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); - - return this; - } - - private int inlineClassUnderlyingPropertyName_ ; - /** - * optional int32 inline_class_underlying_property_name = 17; - */ - public boolean hasInlineClassUnderlyingPropertyName() { - return ((bitField0_ & 0x00002000) == 0x00002000); - } - /** - * optional int32 inline_class_underlying_property_name = 17; - */ - public int getInlineClassUnderlyingPropertyName() { - return inlineClassUnderlyingPropertyName_; - } - /** - * optional int32 inline_class_underlying_property_name = 17; - */ - public Builder setInlineClassUnderlyingPropertyName(int value) { - bitField0_ |= 0x00002000; - inlineClassUnderlyingPropertyName_ = value; - - return this; - } - /** - * optional int32 inline_class_underlying_property_name = 17; - */ - public Builder clearInlineClassUnderlyingPropertyName() { - bitField0_ = (bitField0_ & ~0x00002000); - inlineClassUnderlyingPropertyName_ = 0; - - return this; - } - - private ProtoBuf.Type inlineClassUnderlyingType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - public boolean hasInlineClassUnderlyingType() { - return ((bitField0_ & 0x00004000) == 0x00004000); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - public ProtoBuf.Type getInlineClassUnderlyingType() { - return inlineClassUnderlyingType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - public Builder setInlineClassUnderlyingType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - inlineClassUnderlyingType_ = value; - - bitField0_ |= 0x00004000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - public Builder setInlineClassUnderlyingType( - ProtoBuf.Type.Builder builderForValue) { - inlineClassUnderlyingType_ = builderForValue.build(); - - bitField0_ |= 0x00004000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - public Builder mergeInlineClassUnderlyingType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00004000) == 0x00004000) && - inlineClassUnderlyingType_ != ProtoBuf.Type.getDefaultInstance()) { - inlineClassUnderlyingType_ = - ProtoBuf.Type.newBuilder(inlineClassUnderlyingType_).mergeFrom(value).buildPartial(); - } else { - inlineClassUnderlyingType_ = value; - } - - bitField0_ |= 0x00004000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18; - */ - public Builder clearInlineClassUnderlyingType() { - inlineClassUnderlyingType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00004000); - return this; - } - - private int inlineClassUnderlyingTypeId_ ; - /** - * optional int32 inline_class_underlying_type_id = 19; - */ - public boolean hasInlineClassUnderlyingTypeId() { - return ((bitField0_ & 0x00008000) == 0x00008000); - } - /** - * optional int32 inline_class_underlying_type_id = 19; - */ - public int getInlineClassUnderlyingTypeId() { - return inlineClassUnderlyingTypeId_; - } - /** - * optional int32 inline_class_underlying_type_id = 19; - */ - public Builder setInlineClassUnderlyingTypeId(int value) { - bitField0_ |= 0x00008000; - inlineClassUnderlyingTypeId_ = value; - - return this; - } - /** - * optional int32 inline_class_underlying_type_id = 19; - */ - public Builder clearInlineClassUnderlyingTypeId() { - bitField0_ = (bitField0_ & ~0x00008000); - inlineClassUnderlyingTypeId_ = 0; - - return this; - } - - private ProtoBuf.TypeTable typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public boolean hasTypeTable() { - return ((bitField0_ & 0x00010000) == 0x00010000); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public ProtoBuf.TypeTable getTypeTable() { - return typeTable_; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder setTypeTable(ProtoBuf.TypeTable value) { - if (value == null) { - throw new NullPointerException(); - } - typeTable_ = value; - - bitField0_ |= 0x00010000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder setTypeTable( - ProtoBuf.TypeTable.Builder builderForValue) { - typeTable_ = builderForValue.build(); - - bitField0_ |= 0x00010000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder mergeTypeTable(ProtoBuf.TypeTable value) { - if (((bitField0_ & 0x00010000) == 0x00010000) && - typeTable_ != ProtoBuf.TypeTable.getDefaultInstance()) { - typeTable_ = - ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); - } else { - typeTable_ = value; - } - - bitField0_ |= 0x00010000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder clearTypeTable() { - typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00010000); - return this; - } - - private java.util.List versionRequirement_ = java.util.Collections.emptyList(); - private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00020000) == 0x00020000)) { - versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00020000; - } - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public java.util.List - getVersionRequirementList() { - return java.util.Collections.unmodifiableList(versionRequirement_); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder setVersionRequirement( - int index, int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.set(index, value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder clearVersionRequirement() { - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00020000); - - return this; - } - - private ProtoBuf.VersionRequirementTable versionRequirementTable_ = ProtoBuf.VersionRequirementTable.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public boolean hasVersionRequirementTable() { - return ((bitField0_ & 0x00040000) == 0x00040000); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public ProtoBuf.VersionRequirementTable getVersionRequirementTable() { - return versionRequirementTable_; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public Builder setVersionRequirementTable(ProtoBuf.VersionRequirementTable value) { - if (value == null) { - throw new NullPointerException(); - } - versionRequirementTable_ = value; - - bitField0_ |= 0x00040000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public Builder setVersionRequirementTable( - ProtoBuf.VersionRequirementTable.Builder builderForValue) { - versionRequirementTable_ = builderForValue.build(); - - bitField0_ |= 0x00040000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public Builder mergeVersionRequirementTable(ProtoBuf.VersionRequirementTable value) { - if (((bitField0_ & 0x00040000) == 0x00040000) && - versionRequirementTable_ != ProtoBuf.VersionRequirementTable.getDefaultInstance()) { - versionRequirementTable_ = - ProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial(); - } else { - versionRequirementTable_ = value; - } - - bitField0_ |= 0x00040000; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable version_requirement_table = 32; - */ - public Builder clearVersionRequirementTable() { - versionRequirementTable_ = ProtoBuf.VersionRequirementTable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00040000); - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Class) - } - - static { - defaultInstance = new Class(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Class) - } - - public interface TypeTableOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeTable) - MessageLiteOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - java.util.List - getTypeList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - ProtoBuf.Type getType(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - int getTypeCount(); - - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-     * 
- */ - boolean hasFirstNullable(); - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-     * 
- */ - int getFirstNullable(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} - */ - public static final class TypeTable extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeTable) - TypeTableOrBuilder { - // Use TypeTable.newBuilder() to construct. - private TypeTable(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private TypeTable(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final TypeTable defaultInstance; - public static TypeTable getDefaultInstance() { - return defaultInstance; - } - - public TypeTable getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private TypeTable( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - type_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - type_.add(input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry)); - break; - } - case 16: { - bitField0_ |= 0x00000001; - firstNullable_ = input.readInt32(); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - type_ = java.util.Collections.unmodifiableList(type_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public TypeTable parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new TypeTable(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int TYPE_FIELD_NUMBER = 1; - private java.util.List type_; - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public java.util.List getTypeList() { - return type_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public java.util.List - getTypeOrBuilderList() { - return type_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public int getTypeCount() { - return type_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public ProtoBuf.Type getType(int index) { - return type_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public ProtoBuf.TypeOrBuilder getTypeOrBuilder( - int index) { - return type_.get(index); - } - - public static final int FIRST_NULLABLE_FIELD_NUMBER = 2; - private int firstNullable_; - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-     * 
- */ - public boolean hasFirstNullable() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-     * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-     * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-     * 
- */ - public int getFirstNullable() { - return firstNullable_; - } - - private void initFields() { - type_ = java.util.Collections.emptyList(); - firstNullable_ = -1; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getTypeCount(); i++) { - if (!getType(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < type_.size(); i++) { - output.writeMessage(1, type_.get(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(2, firstNullable_); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < type_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(1, type_.get(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(2, firstNullable_); - } - size += unknownFields.size(); - 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 ProtoBuf.TypeTable parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.TypeTable parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.TypeTable parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.TypeTable parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.TypeTable parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.TypeTable parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.TypeTable parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.TypeTable parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.TypeTable parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.TypeTable parseFrom( - CodedInputStream input, - 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(ProtoBuf.TypeTable prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeTable} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.TypeTable, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeTable) - ProtoBuf.TypeTableOrBuilder { - // Construct using ProtoBuf.TypeTable.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - type_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - firstNullable_ = -1; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.TypeTable getDefaultInstanceForType() { - return ProtoBuf.TypeTable.getDefaultInstance(); - } - - public ProtoBuf.TypeTable build() { - ProtoBuf.TypeTable result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.TypeTable buildPartial() { - ProtoBuf.TypeTable result = new ProtoBuf.TypeTable(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - type_ = java.util.Collections.unmodifiableList(type_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000001; - } - result.firstNullable_ = firstNullable_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.TypeTable other) { - if (other == ProtoBuf.TypeTable.getDefaultInstance()) return this; - if (!other.type_.isEmpty()) { - if (type_.isEmpty()) { - type_ = other.type_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTypeIsMutable(); - type_.addAll(other.type_); - } - - } - if (other.hasFirstNullable()) { - setFirstNullable(other.getFirstNullable()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getTypeCount(); i++) { - if (!getType(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.TypeTable parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.TypeTable) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List type_ = - java.util.Collections.emptyList(); - private void ensureTypeIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - type_ = new java.util.ArrayList(type_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public java.util.List getTypeList() { - return java.util.Collections.unmodifiableList(type_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public int getTypeCount() { - return type_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public ProtoBuf.Type getType(int index) { - return type_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder setType( - int index, ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeIsMutable(); - type_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder setType( - int index, ProtoBuf.Type.Builder builderForValue) { - ensureTypeIsMutable(); - type_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder addType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeIsMutable(); - type_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder addType( - int index, ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeIsMutable(); - type_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder addType( - ProtoBuf.Type.Builder builderForValue) { - ensureTypeIsMutable(); - type_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder addType( - int index, ProtoBuf.Type.Builder builderForValue) { - ensureTypeIsMutable(); - type_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder addAllType( - java.lang.Iterable values) { - ensureTypeIsMutable(); - AbstractMessageLite.Builder.addAll( - values, type_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder clearType() { - type_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Type type = 1; - */ - public Builder removeType(int index) { - ensureTypeIsMutable(); - type_.remove(index); - - return this; - } - - private int firstNullable_ = -1; - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-       * 
- */ - public boolean hasFirstNullable() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-       * 
- */ - public int getFirstNullable() { - return firstNullable_; - } - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-       * 
- */ - public Builder setFirstNullable(int value) { - bitField0_ |= 0x00000002; - firstNullable_ = value; - - return this; - } - /** - * optional int32 first_nullable = 2 [default = -1]; - * - *
-       * Index starting from which all types are nullable, or nothing if all types in this table are non-null.
-       * Note that the 'nullable' field of Type messages is ignored and shouldn't be written because it wastes too much space
-       * 
- */ - public Builder clearFirstNullable() { - bitField0_ = (bitField0_ & ~0x00000002); - firstNullable_ = -1; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeTable) - } - - static { - defaultInstance = new TypeTable(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeTable) - } - - public interface ConstructorOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Constructor) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *isSecondary
-     *hasNonStableParameterNames
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *isSecondary
-     *hasNonStableParameterNames
-     * 
- */ - int getFlags(); - - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - java.util.List - getValueParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - ProtoBuf.ValueParameter getValueParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - int getValueParameterCount(); - - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - java.util.List getVersionRequirementList(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirementCount(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirement(int index); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} - */ - public static final class Constructor extends - GeneratedMessageLite.ExtendableMessage< - Constructor> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Constructor) - ConstructorOrBuilder { - // Use Constructor.newBuilder() to construct. - private Constructor(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Constructor(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Constructor defaultInstance; - public static Constructor getDefaultInstance() { - return defaultInstance; - } - - public Constructor getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Constructor( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - valueParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - valueParameter_.add(input.readMessage(ProtoBuf.ValueParameter.PARSER, extensionRegistry)); - break; - } - case 248: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - versionRequirement_.add(input.readInt32()); - break; - } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); - } - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Constructor parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Constructor(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 1; - private int flags_; - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *isSecondary
-     *hasNonStableParameterNames
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *isSecondary
-     *hasNonStableParameterNames
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int VALUE_PARAMETER_FIELD_NUMBER = 2; - private java.util.List valueParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public java.util.List getValueParameterList() { - return valueParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public java.util.List - getValueParameterOrBuilderList() { - return valueParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public int getValueParameterCount() { - return valueParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public ProtoBuf.ValueParameter getValueParameter(int index) { - return valueParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( - int index) { - return valueParameter_.get(index); - } - - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public java.util.List - getVersionRequirementList() { - return versionRequirement_; - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - - private void initFields() { - flags_ = 6; - valueParameter_ = java.util.Collections.emptyList(); - versionRequirement_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getValueParameterCount(); i++) { - if (!getValueParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, flags_); - } - for (int i = 0; i < valueParameter_.size(); i++) { - output.writeMessage(2, valueParameter_.get(i)); - } - for (int i = 0; i < versionRequirement_.size(); i++) { - output.writeInt32(31, versionRequirement_.get(i)); - } - extensionWriter.writeUntil(19000, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, flags_); - } - for (int i = 0; i < valueParameter_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(2, valueParameter_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(versionRequirement_.get(i)); - } - size += dataSize; - size += 2 * getVersionRequirementList().size(); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.Constructor parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Constructor parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Constructor parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Constructor parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Constructor parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Constructor parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Constructor parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Constructor parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Constructor parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Constructor parseFrom( - CodedInputStream input, - 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(ProtoBuf.Constructor prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Constructor} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.Constructor, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Constructor) - ProtoBuf.ConstructorOrBuilder { - // Construct using ProtoBuf.Constructor.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 6; - bitField0_ = (bitField0_ & ~0x00000001); - valueParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Constructor getDefaultInstanceForType() { - return ProtoBuf.Constructor.getDefaultInstance(); - } - - public ProtoBuf.Constructor build() { - ProtoBuf.Constructor result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Constructor buildPartial() { - ProtoBuf.Constructor result = new ProtoBuf.Constructor(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.valueParameter_ = valueParameter_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.versionRequirement_ = versionRequirement_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Constructor other) { - if (other == ProtoBuf.Constructor.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (!other.valueParameter_.isEmpty()) { - if (valueParameter_.isEmpty()) { - valueParameter_ = other.valueParameter_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureValueParameterIsMutable(); - valueParameter_.addAll(other.valueParameter_); - } - - } - if (!other.versionRequirement_.isEmpty()) { - if (versionRequirement_.isEmpty()) { - versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureVersionRequirementIsMutable(); - versionRequirement_.addAll(other.versionRequirement_); - } - - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getValueParameterCount(); i++) { - if (!getValueParameter(i).isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Constructor parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Constructor) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ = 6; - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *isSecondary
-       *hasNonStableParameterNames
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *isSecondary
-       *hasNonStableParameterNames
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *isSecondary
-       *hasNonStableParameterNames
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *isSecondary
-       *hasNonStableParameterNames
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 6; - - return this; - } - - private java.util.List valueParameter_ = - java.util.Collections.emptyList(); - private void ensureValueParameterIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - valueParameter_ = new java.util.ArrayList(valueParameter_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public java.util.List getValueParameterList() { - return java.util.Collections.unmodifiableList(valueParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public int getValueParameterCount() { - return valueParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public ProtoBuf.ValueParameter getValueParameter(int index) { - return valueParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder setValueParameter( - int index, ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder setValueParameter( - int index, ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder addValueParameter(ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder addValueParameter( - int index, ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder addValueParameter( - ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder addValueParameter( - int index, ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder addAllValueParameter( - java.lang.Iterable values) { - ensureValueParameterIsMutable(); - AbstractMessageLite.Builder.addAll( - values, valueParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder clearValueParameter() { - valueParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 2; - */ - public Builder removeValueParameter(int index) { - ensureValueParameterIsMutable(); - valueParameter_.remove(index); - - return this; - } - - private java.util.List versionRequirement_ = java.util.Collections.emptyList(); - private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00000004; - } - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public java.util.List - getVersionRequirementList() { - return java.util.Collections.unmodifiableList(versionRequirement_); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder setVersionRequirement( - int index, int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.set(index, value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder clearVersionRequirement() { - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Constructor) - } - - static { - defaultInstance = new Constructor(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Constructor) - } - - public interface FunctionOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Function) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 flags = 9 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isOperator
-     *isInfix
-     *isInline
-     *isTailrec
-     *isExternal
-     *isSuspend
-     *isExpect
-     *hasNonStableParameterNames
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 9 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isOperator
-     *isInfix
-     *isInline
-     *isTailrec
-     *isExternal
-     *isSuspend
-     *isExpect
-     *hasNonStableParameterNames
-     * 
- */ - int getFlags(); - - /** - * optional int32 old_flags = 1 [default = 6]; - */ - boolean hasOldFlags(); - /** - * optional int32 old_flags = 1 [default = 6]; - */ - int getOldFlags(); - - /** - * required int32 name = 2; - */ - boolean hasName(); - /** - * required int32 name = 2; - */ - int getName(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - boolean hasReturnType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - ProtoBuf.Type getReturnType(); - - /** - * optional int32 return_type_id = 7; - */ - boolean hasReturnTypeId(); - /** - * optional int32 return_type_id = 7; - */ - int getReturnTypeId(); - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - java.util.List - getTypeParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - ProtoBuf.TypeParameter getTypeParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - int getTypeParameterCount(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - boolean hasReceiverType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - ProtoBuf.Type getReceiverType(); - - /** - * optional int32 receiver_type_id = 8; - */ - boolean hasReceiverTypeId(); - /** - * optional int32 receiver_type_id = 8; - */ - int getReceiverTypeId(); - - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - java.util.List - getValueParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - ProtoBuf.ValueParameter getValueParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - int getValueParameterCount(); - - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - boolean hasTypeTable(); - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - ProtoBuf.TypeTable getTypeTable(); - - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - java.util.List getVersionRequirementList(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirementCount(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirement(int index); - - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - boolean hasContract(); - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - ProtoBuf.Contract getContract(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} - */ - public static final class Function extends - GeneratedMessageLite.ExtendableMessage< - Function> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Function) - FunctionOrBuilder { - // Use Function.newBuilder() to construct. - private Function(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Function(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Function defaultInstance; - public static Function getDefaultInstance() { - return defaultInstance; - } - - public Function getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Function( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000002; - oldFlags_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000004; - name_ = input.readInt32(); - break; - } - case 26: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - subBuilder = returnType_.toBuilder(); - } - returnType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(returnType_); - returnType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000008; - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - typeParameter_.add(input.readMessage(ProtoBuf.TypeParameter.PARSER, extensionRegistry)); - break; - } - case 42: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - subBuilder = receiverType_.toBuilder(); - } - receiverType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(receiverType_); - receiverType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000020; - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - valueParameter_.add(input.readMessage(ProtoBuf.ValueParameter.PARSER, extensionRegistry)); - break; - } - case 56: { - bitField0_ |= 0x00000010; - returnTypeId_ = input.readInt32(); - break; - } - case 64: { - bitField0_ |= 0x00000040; - receiverTypeId_ = input.readInt32(); - break; - } - case 72: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 242: { - ProtoBuf.TypeTable.Builder subBuilder = null; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - subBuilder = typeTable_.toBuilder(); - } - typeTable_ = input.readMessage(ProtoBuf.TypeTable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(typeTable_); - typeTable_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000080; - break; - } - case 248: { - if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; - } - versionRequirement_.add(input.readInt32()); - break; - } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000400) == 0x00000400) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; - } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 258: { - ProtoBuf.Contract.Builder subBuilder = null; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - subBuilder = contract_.toBuilder(); - } - contract_ = input.readMessage(ProtoBuf.Contract.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(contract_); - contract_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000100; - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - } - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); - } - if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Function parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Function(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 9; - private int flags_; - /** - * optional int32 flags = 9 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isOperator
-     *isInfix
-     *isInline
-     *isTailrec
-     *isExternal
-     *isSuspend
-     *isExpect
-     *hasNonStableParameterNames
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 9 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isOperator
-     *isInfix
-     *isInline
-     *isTailrec
-     *isExternal
-     *isSuspend
-     *isExpect
-     *hasNonStableParameterNames
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int OLD_FLAGS_FIELD_NUMBER = 1; - private int oldFlags_; - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public boolean hasOldFlags() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public int getOldFlags() { - return oldFlags_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private int name_; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - - public static final int RETURN_TYPE_FIELD_NUMBER = 3; - private ProtoBuf.Type returnType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public boolean hasReturnType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public ProtoBuf.Type getReturnType() { - return returnType_; - } - - public static final int RETURN_TYPE_ID_FIELD_NUMBER = 7; - private int returnTypeId_; - /** - * optional int32 return_type_id = 7; - */ - public boolean hasReturnTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 return_type_id = 7; - */ - public int getReturnTypeId() { - return returnTypeId_; - } - - public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; - private java.util.List typeParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List getTypeParameterList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List - getTypeParameterOrBuilderList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( - int index) { - return typeParameter_.get(index); - } - - public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; - private ProtoBuf.Type receiverType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public boolean hasReceiverType() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public ProtoBuf.Type getReceiverType() { - return receiverType_; - } - - public static final int RECEIVER_TYPE_ID_FIELD_NUMBER = 8; - private int receiverTypeId_; - /** - * optional int32 receiver_type_id = 8; - */ - public boolean hasReceiverTypeId() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 receiver_type_id = 8; - */ - public int getReceiverTypeId() { - return receiverTypeId_; - } - - public static final int VALUE_PARAMETER_FIELD_NUMBER = 6; - private java.util.List valueParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public java.util.List getValueParameterList() { - return valueParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public java.util.List - getValueParameterOrBuilderList() { - return valueParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public int getValueParameterCount() { - return valueParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public ProtoBuf.ValueParameter getValueParameter(int index) { - return valueParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public ProtoBuf.ValueParameterOrBuilder getValueParameterOrBuilder( - int index) { - return valueParameter_.get(index); - } - - public static final int TYPE_TABLE_FIELD_NUMBER = 30; - private ProtoBuf.TypeTable typeTable_; - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public boolean hasTypeTable() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public ProtoBuf.TypeTable getTypeTable() { - return typeTable_; - } - - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public java.util.List - getVersionRequirementList() { - return versionRequirement_; - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - - public static final int CONTRACT_FIELD_NUMBER = 32; - private ProtoBuf.Contract contract_; - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public boolean hasContract() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public ProtoBuf.Contract getContract() { - return contract_; - } - - private void initFields() { - flags_ = 6; - oldFlags_ = 6; - name_ = 0; - returnType_ = ProtoBuf.Type.getDefaultInstance(); - returnTypeId_ = 0; - typeParameter_ = java.util.Collections.emptyList(); - receiverType_ = ProtoBuf.Type.getDefaultInstance(); - receiverTypeId_ = 0; - valueParameter_ = java.util.Collections.emptyList(); - typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); - versionRequirement_ = java.util.Collections.emptyList(); - contract_ = ProtoBuf.Contract.getDefaultInstance(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - if (hasReturnType()) { - if (!getReturnType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasReceiverType()) { - if (!getReceiverType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getValueParameterCount(); i++) { - if (!getValueParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasTypeTable()) { - if (!getTypeTable().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasContract()) { - if (!getContract().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(1, oldFlags_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(2, name_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(3, returnType_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - output.writeMessage(4, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeMessage(5, receiverType_); - } - for (int i = 0; i < valueParameter_.size(); i++) { - output.writeMessage(6, valueParameter_.get(i)); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(7, returnTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeInt32(8, receiverTypeId_); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(9, flags_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeMessage(30, typeTable_); - } - for (int i = 0; i < versionRequirement_.size(); i++) { - output.writeInt32(31, versionRequirement_.get(i)); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeMessage(32, contract_); - } - extensionWriter.writeUntil(19000, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(1, oldFlags_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeInt32Size(2, name_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeMessageSize(3, returnType_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(4, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += CodedOutputStream - .computeMessageSize(5, receiverType_); - } - for (int i = 0; i < valueParameter_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(6, valueParameter_.get(i)); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeInt32Size(7, returnTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += CodedOutputStream - .computeInt32Size(8, receiverTypeId_); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(9, flags_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += CodedOutputStream - .computeMessageSize(30, typeTable_); - } - { - int dataSize = 0; - for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(versionRequirement_.get(i)); - } - size += dataSize; - size += 2 * getVersionRequirementList().size(); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += CodedOutputStream - .computeMessageSize(32, contract_); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.Function parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Function parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Function parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Function parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Function parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Function parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Function parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Function parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Function parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Function parseFrom( - CodedInputStream input, - 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(ProtoBuf.Function prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Function} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.Function, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Function) - ProtoBuf.FunctionOrBuilder { - // Construct using ProtoBuf.Function.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 6; - bitField0_ = (bitField0_ & ~0x00000001); - oldFlags_ = 6; - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - returnType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - returnTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - receiverType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000040); - receiverTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000080); - valueParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000200); - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - contract_ = ProtoBuf.Contract.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Function getDefaultInstanceForType() { - return ProtoBuf.Function.getDefaultInstance(); - } - - public ProtoBuf.Function build() { - ProtoBuf.Function result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Function buildPartial() { - ProtoBuf.Function result = new ProtoBuf.Function(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.oldFlags_ = oldFlags_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.returnType_ = returnType_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.returnTypeId_ = returnTypeId_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.typeParameter_ = typeParameter_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000020; - } - result.receiverType_ = receiverType_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000040; - } - result.receiverTypeId_ = receiverTypeId_; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = java.util.Collections.unmodifiableList(valueParameter_); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.valueParameter_ = valueParameter_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000080; - } - result.typeTable_ = typeTable_; - if (((bitField0_ & 0x00000400) == 0x00000400)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00000400); - } - result.versionRequirement_ = versionRequirement_; - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { - to_bitField0_ |= 0x00000100; - } - result.contract_ = contract_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Function other) { - if (other == ProtoBuf.Function.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasOldFlags()) { - setOldFlags(other.getOldFlags()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasReturnType()) { - mergeReturnType(other.getReturnType()); - } - if (other.hasReturnTypeId()) { - setReturnTypeId(other.getReturnTypeId()); - } - if (!other.typeParameter_.isEmpty()) { - if (typeParameter_.isEmpty()) { - typeParameter_ = other.typeParameter_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureTypeParameterIsMutable(); - typeParameter_.addAll(other.typeParameter_); - } - - } - if (other.hasReceiverType()) { - mergeReceiverType(other.getReceiverType()); - } - if (other.hasReceiverTypeId()) { - setReceiverTypeId(other.getReceiverTypeId()); - } - if (!other.valueParameter_.isEmpty()) { - if (valueParameter_.isEmpty()) { - valueParameter_ = other.valueParameter_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureValueParameterIsMutable(); - valueParameter_.addAll(other.valueParameter_); - } - - } - if (other.hasTypeTable()) { - mergeTypeTable(other.getTypeTable()); - } - if (!other.versionRequirement_.isEmpty()) { - if (versionRequirement_.isEmpty()) { - versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00000400); - } else { - ensureVersionRequirementIsMutable(); - versionRequirement_.addAll(other.versionRequirement_); - } - - } - if (other.hasContract()) { - mergeContract(other.getContract()); - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (hasReturnType()) { - if (!getReturnType().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - - return false; - } - } - if (hasReceiverType()) { - if (!getReceiverType().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getValueParameterCount(); i++) { - if (!getValueParameter(i).isInitialized()) { - - return false; - } - } - if (hasTypeTable()) { - if (!getTypeTable().isInitialized()) { - - return false; - } - } - if (hasContract()) { - if (!getContract().isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Function parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Function) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ = 6; - /** - * optional int32 flags = 9 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isOperator
-       *isInfix
-       *isInline
-       *isTailrec
-       *isExternal
-       *isSuspend
-       *isExpect
-       *hasNonStableParameterNames
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 9 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isOperator
-       *isInfix
-       *isInline
-       *isTailrec
-       *isExternal
-       *isSuspend
-       *isExpect
-       *hasNonStableParameterNames
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 9 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isOperator
-       *isInfix
-       *isInline
-       *isTailrec
-       *isExternal
-       *isSuspend
-       *isExpect
-       *hasNonStableParameterNames
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 9 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isOperator
-       *isInfix
-       *isInline
-       *isTailrec
-       *isExternal
-       *isSuspend
-       *isExpect
-       *hasNonStableParameterNames
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 6; - - return this; - } - - private int oldFlags_ = 6; - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public boolean hasOldFlags() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public int getOldFlags() { - return oldFlags_; - } - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public Builder setOldFlags(int value) { - bitField0_ |= 0x00000002; - oldFlags_ = value; - - return this; - } - /** - * optional int32 old_flags = 1 [default = 6]; - */ - public Builder clearOldFlags() { - bitField0_ = (bitField0_ & ~0x00000002); - oldFlags_ = 6; - - return this; - } - - private int name_ ; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 2; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000004; - name_ = value; - - return this; - } - /** - * required int32 name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000004); - name_ = 0; - - return this; - } - - private ProtoBuf.Type returnType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public boolean hasReturnType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public ProtoBuf.Type getReturnType() { - return returnType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder setReturnType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - returnType_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder setReturnType( - ProtoBuf.Type.Builder builderForValue) { - returnType_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder mergeReturnType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - returnType_ != ProtoBuf.Type.getDefaultInstance()) { - returnType_ = - ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); - } else { - returnType_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder clearReturnType() { - returnType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private int returnTypeId_ ; - /** - * optional int32 return_type_id = 7; - */ - public boolean hasReturnTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 return_type_id = 7; - */ - public int getReturnTypeId() { - return returnTypeId_; - } - /** - * optional int32 return_type_id = 7; - */ - public Builder setReturnTypeId(int value) { - bitField0_ |= 0x00000010; - returnTypeId_ = value; - - return this; - } - /** - * optional int32 return_type_id = 7; - */ - public Builder clearReturnTypeId() { - bitField0_ = (bitField0_ & ~0x00000010); - returnTypeId_ = 0; - - return this; - } - - private java.util.List typeParameter_ = - java.util.Collections.emptyList(); - private void ensureTypeParameterIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); - bitField0_ |= 0x00000020; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List getTypeParameterList() { - return java.util.Collections.unmodifiableList(typeParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder setTypeParameter( - int index, ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder setTypeParameter( - int index, ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter(ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - int index, ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - int index, ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addAllTypeParameter( - java.lang.Iterable values) { - ensureTypeParameterIsMutable(); - AbstractMessageLite.Builder.addAll( - values, typeParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder clearTypeParameter() { - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder removeTypeParameter(int index) { - ensureTypeParameterIsMutable(); - typeParameter_.remove(index); - - return this; - } - - private ProtoBuf.Type receiverType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public boolean hasReceiverType() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public ProtoBuf.Type getReceiverType() { - return receiverType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder setReceiverType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - receiverType_ = value; - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder setReceiverType( - ProtoBuf.Type.Builder builderForValue) { - receiverType_ = builderForValue.build(); - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder mergeReceiverType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000040) == 0x00000040) && - receiverType_ != ProtoBuf.Type.getDefaultInstance()) { - receiverType_ = - ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); - } else { - receiverType_ = value; - } - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder clearReceiverType() { - receiverType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } - - private int receiverTypeId_ ; - /** - * optional int32 receiver_type_id = 8; - */ - public boolean hasReceiverTypeId() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int32 receiver_type_id = 8; - */ - public int getReceiverTypeId() { - return receiverTypeId_; - } - /** - * optional int32 receiver_type_id = 8; - */ - public Builder setReceiverTypeId(int value) { - bitField0_ |= 0x00000080; - receiverTypeId_ = value; - - return this; - } - /** - * optional int32 receiver_type_id = 8; - */ - public Builder clearReceiverTypeId() { - bitField0_ = (bitField0_ & ~0x00000080); - receiverTypeId_ = 0; - - return this; - } - - private java.util.List valueParameter_ = - java.util.Collections.emptyList(); - private void ensureValueParameterIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - valueParameter_ = new java.util.ArrayList(valueParameter_); - bitField0_ |= 0x00000100; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public java.util.List getValueParameterList() { - return java.util.Collections.unmodifiableList(valueParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public int getValueParameterCount() { - return valueParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public ProtoBuf.ValueParameter getValueParameter(int index) { - return valueParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder setValueParameter( - int index, ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder setValueParameter( - int index, ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addValueParameter(ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addValueParameter( - int index, ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueParameterIsMutable(); - valueParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addValueParameter( - ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addValueParameter( - int index, ProtoBuf.ValueParameter.Builder builderForValue) { - ensureValueParameterIsMutable(); - valueParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder addAllValueParameter( - java.lang.Iterable values) { - ensureValueParameterIsMutable(); - AbstractMessageLite.Builder.addAll( - values, valueParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder clearValueParameter() { - valueParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.ValueParameter value_parameter = 6; - */ - public Builder removeValueParameter(int index) { - ensureValueParameterIsMutable(); - valueParameter_.remove(index); - - return this; - } - - private ProtoBuf.TypeTable typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public boolean hasTypeTable() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public ProtoBuf.TypeTable getTypeTable() { - return typeTable_; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder setTypeTable(ProtoBuf.TypeTable value) { - if (value == null) { - throw new NullPointerException(); - } - typeTable_ = value; - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder setTypeTable( - ProtoBuf.TypeTable.Builder builderForValue) { - typeTable_ = builderForValue.build(); - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder mergeTypeTable(ProtoBuf.TypeTable value) { - if (((bitField0_ & 0x00000200) == 0x00000200) && - typeTable_ != ProtoBuf.TypeTable.getDefaultInstance()) { - typeTable_ = - ProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial(); - } else { - typeTable_ = value; - } - - bitField0_ |= 0x00000200; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30; - */ - public Builder clearTypeTable() { - typeTable_ = ProtoBuf.TypeTable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000200); - return this; - } - - private java.util.List versionRequirement_ = java.util.Collections.emptyList(); - private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00000400) == 0x00000400)) { - versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00000400; - } - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public java.util.List - getVersionRequirementList() { - return java.util.Collections.unmodifiableList(versionRequirement_); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder setVersionRequirement( - int index, int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.set(index, value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder clearVersionRequirement() { - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - - return this; - } - - private ProtoBuf.Contract contract_ = ProtoBuf.Contract.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public boolean hasContract() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public ProtoBuf.Contract getContract() { - return contract_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public Builder setContract(ProtoBuf.Contract value) { - if (value == null) { - throw new NullPointerException(); - } - contract_ = value; - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public Builder setContract( - ProtoBuf.Contract.Builder builderForValue) { - contract_ = builderForValue.build(); - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public Builder mergeContract(ProtoBuf.Contract value) { - if (((bitField0_ & 0x00000800) == 0x00000800) && - contract_ != ProtoBuf.Contract.getDefaultInstance()) { - contract_ = - ProtoBuf.Contract.newBuilder(contract_).mergeFrom(value).buildPartial(); - } else { - contract_ = value; - } - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Contract contract = 32; - */ - public Builder clearContract() { - contract_ = ProtoBuf.Contract.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Function) - } - - static { - defaultInstance = new Function(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Function) - } - - public interface PropertyOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Property) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 flags = 11 [default = 518]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isVar
-     *hasGetter
-     *hasSetter
-     *isConst
-     *isLateinit
-     *hasConstant
-     *isExternal
-     *isDelegated
-     *isExpect
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 11 [default = 518]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isVar
-     *hasGetter
-     *hasSetter
-     *isConst
-     *isLateinit
-     *hasConstant
-     *isExternal
-     *isDelegated
-     *isExpect
-     * 
- */ - int getFlags(); - - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - boolean hasOldFlags(); - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - int getOldFlags(); - - /** - * required int32 name = 2; - */ - boolean hasName(); - /** - * required int32 name = 2; - */ - int getName(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - boolean hasReturnType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - ProtoBuf.Type getReturnType(); - - /** - * optional int32 return_type_id = 9; - */ - boolean hasReturnTypeId(); - /** - * optional int32 return_type_id = 9; - */ - int getReturnTypeId(); - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - java.util.List - getTypeParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - ProtoBuf.TypeParameter getTypeParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - int getTypeParameterCount(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - boolean hasReceiverType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - ProtoBuf.Type getReceiverType(); - - /** - * optional int32 receiver_type_id = 10; - */ - boolean hasReceiverTypeId(); - /** - * optional int32 receiver_type_id = 10; - */ - int getReceiverTypeId(); - - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - boolean hasSetterValueParameter(); - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - ProtoBuf.ValueParameter getSetterValueParameter(); - - /** - * optional int32 getter_flags = 7; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *isNotDefault
-     *isExternal
-     *isInline
-     *If getter_flags or setter_flags are absent, their value should be computed as follows:
-     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-     *- all other flags are false
-     * 
- */ - boolean hasGetterFlags(); - /** - * optional int32 getter_flags = 7; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *isNotDefault
-     *isExternal
-     *isInline
-     *If getter_flags or setter_flags are absent, their value should be computed as follows:
-     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-     *- all other flags are false
-     * 
- */ - int getGetterFlags(); - - /** - * optional int32 setter_flags = 8; - */ - boolean hasSetterFlags(); - /** - * optional int32 setter_flags = 8; - */ - int getSetterFlags(); - - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - java.util.List getVersionRequirementList(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirementCount(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirement(int index); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} - */ - public static final class Property extends - GeneratedMessageLite.ExtendableMessage< - Property> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Property) - PropertyOrBuilder { - // Use Property.newBuilder() to construct. - private Property(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Property(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Property defaultInstance; - public static Property getDefaultInstance() { - return defaultInstance; - } - - public Property getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Property( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000002; - oldFlags_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000004; - name_ = input.readInt32(); - break; - } - case 26: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - subBuilder = returnType_.toBuilder(); - } - returnType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(returnType_); - returnType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000008; - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - typeParameter_.add(input.readMessage(ProtoBuf.TypeParameter.PARSER, extensionRegistry)); - break; - } - case 42: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - subBuilder = receiverType_.toBuilder(); - } - receiverType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(receiverType_); - receiverType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000020; - break; - } - case 50: { - ProtoBuf.ValueParameter.Builder subBuilder = null; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - subBuilder = setterValueParameter_.toBuilder(); - } - setterValueParameter_ = input.readMessage(ProtoBuf.ValueParameter.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(setterValueParameter_); - setterValueParameter_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000080; - break; - } - case 56: { - bitField0_ |= 0x00000100; - getterFlags_ = input.readInt32(); - break; - } - case 64: { - bitField0_ |= 0x00000200; - setterFlags_ = input.readInt32(); - break; - } - case 72: { - bitField0_ |= 0x00000010; - returnTypeId_ = input.readInt32(); - break; - } - case 80: { - bitField0_ |= 0x00000040; - receiverTypeId_ = input.readInt32(); - break; - } - case 88: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 248: { - if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000800; - } - versionRequirement_.add(input.readInt32()); - break; - } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000800) == 0x00000800) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000800; - } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - } - if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Property parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Property(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 11; - private int flags_; - /** - * optional int32 flags = 11 [default = 518]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isVar
-     *hasGetter
-     *hasSetter
-     *isConst
-     *isLateinit
-     *hasConstant
-     *isExternal
-     *isDelegated
-     *isExpect
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 11 [default = 518]; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *MemberKind
-     *isVar
-     *hasGetter
-     *hasSetter
-     *isConst
-     *isLateinit
-     *hasConstant
-     *isExternal
-     *isDelegated
-     *isExpect
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int OLD_FLAGS_FIELD_NUMBER = 1; - private int oldFlags_; - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public boolean hasOldFlags() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public int getOldFlags() { - return oldFlags_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private int name_; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - - public static final int RETURN_TYPE_FIELD_NUMBER = 3; - private ProtoBuf.Type returnType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public boolean hasReturnType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public ProtoBuf.Type getReturnType() { - return returnType_; - } - - public static final int RETURN_TYPE_ID_FIELD_NUMBER = 9; - private int returnTypeId_; - /** - * optional int32 return_type_id = 9; - */ - public boolean hasReturnTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 return_type_id = 9; - */ - public int getReturnTypeId() { - return returnTypeId_; - } - - public static final int TYPE_PARAMETER_FIELD_NUMBER = 4; - private java.util.List typeParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List getTypeParameterList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List - getTypeParameterOrBuilderList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( - int index) { - return typeParameter_.get(index); - } - - public static final int RECEIVER_TYPE_FIELD_NUMBER = 5; - private ProtoBuf.Type receiverType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public boolean hasReceiverType() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public ProtoBuf.Type getReceiverType() { - return receiverType_; - } - - public static final int RECEIVER_TYPE_ID_FIELD_NUMBER = 10; - private int receiverTypeId_; - /** - * optional int32 receiver_type_id = 10; - */ - public boolean hasReceiverTypeId() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 receiver_type_id = 10; - */ - public int getReceiverTypeId() { - return receiverTypeId_; - } - - public static final int SETTER_VALUE_PARAMETER_FIELD_NUMBER = 6; - private ProtoBuf.ValueParameter setterValueParameter_; - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public boolean hasSetterValueParameter() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public ProtoBuf.ValueParameter getSetterValueParameter() { - return setterValueParameter_; - } - - public static final int GETTER_FLAGS_FIELD_NUMBER = 7; - private int getterFlags_; - /** - * optional int32 getter_flags = 7; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *isNotDefault
-     *isExternal
-     *isInline
-     *If getter_flags or setter_flags are absent, their value should be computed as follows:
-     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-     *- all other flags are false
-     * 
- */ - public boolean hasGetterFlags() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional int32 getter_flags = 7; - * - *
-     *hasAnnotations
-     *Visibility
-     *Modality
-     *isNotDefault
-     *isExternal
-     *isInline
-     *If getter_flags or setter_flags are absent, their value should be computed as follows:
-     *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-     *- all other flags are false
-     * 
- */ - public int getGetterFlags() { - return getterFlags_; - } - - public static final int SETTER_FLAGS_FIELD_NUMBER = 8; - private int setterFlags_; - /** - * optional int32 setter_flags = 8; - */ - public boolean hasSetterFlags() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional int32 setter_flags = 8; - */ - public int getSetterFlags() { - return setterFlags_; - } - - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public java.util.List - getVersionRequirementList() { - return versionRequirement_; - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - - private void initFields() { - flags_ = 518; - oldFlags_ = 2054; - name_ = 0; - returnType_ = ProtoBuf.Type.getDefaultInstance(); - returnTypeId_ = 0; - typeParameter_ = java.util.Collections.emptyList(); - receiverType_ = ProtoBuf.Type.getDefaultInstance(); - receiverTypeId_ = 0; - setterValueParameter_ = ProtoBuf.ValueParameter.getDefaultInstance(); - getterFlags_ = 0; - setterFlags_ = 0; - versionRequirement_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - if (hasReturnType()) { - if (!getReturnType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasReceiverType()) { - if (!getReceiverType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasSetterValueParameter()) { - if (!getSetterValueParameter().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(1, oldFlags_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(2, name_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(3, returnType_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - output.writeMessage(4, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeMessage(5, receiverType_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeMessage(6, setterValueParameter_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeInt32(7, getterFlags_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeInt32(8, setterFlags_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(9, returnTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeInt32(10, receiverTypeId_); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(11, flags_); - } - for (int i = 0; i < versionRequirement_.size(); i++) { - output.writeInt32(31, versionRequirement_.get(i)); - } - extensionWriter.writeUntil(19000, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(1, oldFlags_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeInt32Size(2, name_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeMessageSize(3, returnType_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(4, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += CodedOutputStream - .computeMessageSize(5, receiverType_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += CodedOutputStream - .computeMessageSize(6, setterValueParameter_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += CodedOutputStream - .computeInt32Size(7, getterFlags_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += CodedOutputStream - .computeInt32Size(8, setterFlags_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeInt32Size(9, returnTypeId_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += CodedOutputStream - .computeInt32Size(10, receiverTypeId_); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(11, flags_); - } - { - int dataSize = 0; - for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(versionRequirement_.get(i)); - } - size += dataSize; - size += 2 * getVersionRequirementList().size(); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.Property parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Property parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Property parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Property parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Property parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Property parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Property parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Property parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Property parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Property parseFrom( - CodedInputStream input, - 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(ProtoBuf.Property prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Property} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.Property, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Property) - ProtoBuf.PropertyOrBuilder { - // Construct using ProtoBuf.Property.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 518; - bitField0_ = (bitField0_ & ~0x00000001); - oldFlags_ = 2054; - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - returnType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - returnTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - receiverType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000040); - receiverTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000080); - setterValueParameter_ = ProtoBuf.ValueParameter.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000100); - getterFlags_ = 0; - bitField0_ = (bitField0_ & ~0x00000200); - setterFlags_ = 0; - bitField0_ = (bitField0_ & ~0x00000400); - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Property getDefaultInstanceForType() { - return ProtoBuf.Property.getDefaultInstance(); - } - - public ProtoBuf.Property build() { - ProtoBuf.Property result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Property buildPartial() { - ProtoBuf.Property result = new ProtoBuf.Property(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.oldFlags_ = oldFlags_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.returnType_ = returnType_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.returnTypeId_ = returnTypeId_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.typeParameter_ = typeParameter_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000020; - } - result.receiverType_ = receiverType_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000040; - } - result.receiverTypeId_ = receiverTypeId_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { - to_bitField0_ |= 0x00000080; - } - result.setterValueParameter_ = setterValueParameter_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000100; - } - result.getterFlags_ = getterFlags_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000200; - } - result.setterFlags_ = setterFlags_; - if (((bitField0_ & 0x00000800) == 0x00000800)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00000800); - } - result.versionRequirement_ = versionRequirement_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Property other) { - if (other == ProtoBuf.Property.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasOldFlags()) { - setOldFlags(other.getOldFlags()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasReturnType()) { - mergeReturnType(other.getReturnType()); - } - if (other.hasReturnTypeId()) { - setReturnTypeId(other.getReturnTypeId()); - } - if (!other.typeParameter_.isEmpty()) { - if (typeParameter_.isEmpty()) { - typeParameter_ = other.typeParameter_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureTypeParameterIsMutable(); - typeParameter_.addAll(other.typeParameter_); - } - - } - if (other.hasReceiverType()) { - mergeReceiverType(other.getReceiverType()); - } - if (other.hasReceiverTypeId()) { - setReceiverTypeId(other.getReceiverTypeId()); - } - if (other.hasSetterValueParameter()) { - mergeSetterValueParameter(other.getSetterValueParameter()); - } - if (other.hasGetterFlags()) { - setGetterFlags(other.getGetterFlags()); - } - if (other.hasSetterFlags()) { - setSetterFlags(other.getSetterFlags()); - } - if (!other.versionRequirement_.isEmpty()) { - if (versionRequirement_.isEmpty()) { - versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00000800); - } else { - ensureVersionRequirementIsMutable(); - versionRequirement_.addAll(other.versionRequirement_); - } - - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (hasReturnType()) { - if (!getReturnType().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - - return false; - } - } - if (hasReceiverType()) { - if (!getReceiverType().isInitialized()) { - - return false; - } - } - if (hasSetterValueParameter()) { - if (!getSetterValueParameter().isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Property parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Property) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ = 518; - /** - * optional int32 flags = 11 [default = 518]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isVar
-       *hasGetter
-       *hasSetter
-       *isConst
-       *isLateinit
-       *hasConstant
-       *isExternal
-       *isDelegated
-       *isExpect
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 11 [default = 518]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isVar
-       *hasGetter
-       *hasSetter
-       *isConst
-       *isLateinit
-       *hasConstant
-       *isExternal
-       *isDelegated
-       *isExpect
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 11 [default = 518]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isVar
-       *hasGetter
-       *hasSetter
-       *isConst
-       *isLateinit
-       *hasConstant
-       *isExternal
-       *isDelegated
-       *isExpect
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 11 [default = 518]; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *MemberKind
-       *isVar
-       *hasGetter
-       *hasSetter
-       *isConst
-       *isLateinit
-       *hasConstant
-       *isExternal
-       *isDelegated
-       *isExpect
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 518; - - return this; - } - - private int oldFlags_ = 2054; - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public boolean hasOldFlags() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public int getOldFlags() { - return oldFlags_; - } - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public Builder setOldFlags(int value) { - bitField0_ |= 0x00000002; - oldFlags_ = value; - - return this; - } - /** - * optional int32 old_flags = 1 [default = 2054]; - */ - public Builder clearOldFlags() { - bitField0_ = (bitField0_ & ~0x00000002); - oldFlags_ = 2054; - - return this; - } - - private int name_ ; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 2; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000004; - name_ = value; - - return this; - } - /** - * required int32 name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000004); - name_ = 0; - - return this; - } - - private ProtoBuf.Type returnType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public boolean hasReturnType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public ProtoBuf.Type getReturnType() { - return returnType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder setReturnType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - returnType_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder setReturnType( - ProtoBuf.Type.Builder builderForValue) { - returnType_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder mergeReturnType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - returnType_ != ProtoBuf.Type.getDefaultInstance()) { - returnType_ = - ProtoBuf.Type.newBuilder(returnType_).mergeFrom(value).buildPartial(); - } else { - returnType_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type return_type = 3; - */ - public Builder clearReturnType() { - returnType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private int returnTypeId_ ; - /** - * optional int32 return_type_id = 9; - */ - public boolean hasReturnTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 return_type_id = 9; - */ - public int getReturnTypeId() { - return returnTypeId_; - } - /** - * optional int32 return_type_id = 9; - */ - public Builder setReturnTypeId(int value) { - bitField0_ |= 0x00000010; - returnTypeId_ = value; - - return this; - } - /** - * optional int32 return_type_id = 9; - */ - public Builder clearReturnTypeId() { - bitField0_ = (bitField0_ & ~0x00000010); - returnTypeId_ = 0; - - return this; - } - - private java.util.List typeParameter_ = - java.util.Collections.emptyList(); - private void ensureTypeParameterIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); - bitField0_ |= 0x00000020; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public java.util.List getTypeParameterList() { - return java.util.Collections.unmodifiableList(typeParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder setTypeParameter( - int index, ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder setTypeParameter( - int index, ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter(ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - int index, ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addTypeParameter( - int index, ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder addAllTypeParameter( - java.lang.Iterable values) { - ensureTypeParameterIsMutable(); - AbstractMessageLite.Builder.addAll( - values, typeParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder clearTypeParameter() { - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 4; - */ - public Builder removeTypeParameter(int index) { - ensureTypeParameterIsMutable(); - typeParameter_.remove(index); - - return this; - } - - private ProtoBuf.Type receiverType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public boolean hasReceiverType() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public ProtoBuf.Type getReceiverType() { - return receiverType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder setReceiverType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - receiverType_ = value; - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder setReceiverType( - ProtoBuf.Type.Builder builderForValue) { - receiverType_ = builderForValue.build(); - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder mergeReceiverType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000040) == 0x00000040) && - receiverType_ != ProtoBuf.Type.getDefaultInstance()) { - receiverType_ = - ProtoBuf.Type.newBuilder(receiverType_).mergeFrom(value).buildPartial(); - } else { - receiverType_ = value; - } - - bitField0_ |= 0x00000040; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type receiver_type = 5; - */ - public Builder clearReceiverType() { - receiverType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } - - private int receiverTypeId_ ; - /** - * optional int32 receiver_type_id = 10; - */ - public boolean hasReceiverTypeId() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int32 receiver_type_id = 10; - */ - public int getReceiverTypeId() { - return receiverTypeId_; - } - /** - * optional int32 receiver_type_id = 10; - */ - public Builder setReceiverTypeId(int value) { - bitField0_ |= 0x00000080; - receiverTypeId_ = value; - - return this; - } - /** - * optional int32 receiver_type_id = 10; - */ - public Builder clearReceiverTypeId() { - bitField0_ = (bitField0_ & ~0x00000080); - receiverTypeId_ = 0; - - return this; - } - - private ProtoBuf.ValueParameter setterValueParameter_ = ProtoBuf.ValueParameter.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public boolean hasSetterValueParameter() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public ProtoBuf.ValueParameter getSetterValueParameter() { - return setterValueParameter_; - } - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public Builder setSetterValueParameter(ProtoBuf.ValueParameter value) { - if (value == null) { - throw new NullPointerException(); - } - setterValueParameter_ = value; - - bitField0_ |= 0x00000100; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public Builder setSetterValueParameter( - ProtoBuf.ValueParameter.Builder builderForValue) { - setterValueParameter_ = builderForValue.build(); - - bitField0_ |= 0x00000100; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public Builder mergeSetterValueParameter(ProtoBuf.ValueParameter value) { - if (((bitField0_ & 0x00000100) == 0x00000100) && - setterValueParameter_ != ProtoBuf.ValueParameter.getDefaultInstance()) { - setterValueParameter_ = - ProtoBuf.ValueParameter.newBuilder(setterValueParameter_).mergeFrom(value).buildPartial(); - } else { - setterValueParameter_ = value; - } - - bitField0_ |= 0x00000100; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.ValueParameter setter_value_parameter = 6; - */ - public Builder clearSetterValueParameter() { - setterValueParameter_ = ProtoBuf.ValueParameter.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000100); - return this; - } - - private int getterFlags_ ; - /** - * optional int32 getter_flags = 7; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *isNotDefault
-       *isExternal
-       *isInline
-       *If getter_flags or setter_flags are absent, their value should be computed as follows:
-       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-       *- all other flags are false
-       * 
- */ - public boolean hasGetterFlags() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional int32 getter_flags = 7; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *isNotDefault
-       *isExternal
-       *isInline
-       *If getter_flags or setter_flags are absent, their value should be computed as follows:
-       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-       *- all other flags are false
-       * 
- */ - public int getGetterFlags() { - return getterFlags_; - } - /** - * optional int32 getter_flags = 7; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *isNotDefault
-       *isExternal
-       *isInline
-       *If getter_flags or setter_flags are absent, their value should be computed as follows:
-       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-       *- all other flags are false
-       * 
- */ - public Builder setGetterFlags(int value) { - bitField0_ |= 0x00000200; - getterFlags_ = value; - - return this; - } - /** - * optional int32 getter_flags = 7; - * - *
-       *hasAnnotations
-       *Visibility
-       *Modality
-       *isNotDefault
-       *isExternal
-       *isInline
-       *If getter_flags or setter_flags are absent, their value should be computed as follows:
-       *- hasAnnotations, Visibility, Modality have the same value as in the property flags
-       *- all other flags are false
-       * 
- */ - public Builder clearGetterFlags() { - bitField0_ = (bitField0_ & ~0x00000200); - getterFlags_ = 0; - - return this; - } - - private int setterFlags_ ; - /** - * optional int32 setter_flags = 8; - */ - public boolean hasSetterFlags() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - /** - * optional int32 setter_flags = 8; - */ - public int getSetterFlags() { - return setterFlags_; - } - /** - * optional int32 setter_flags = 8; - */ - public Builder setSetterFlags(int value) { - bitField0_ |= 0x00000400; - setterFlags_ = value; - - return this; - } - /** - * optional int32 setter_flags = 8; - */ - public Builder clearSetterFlags() { - bitField0_ = (bitField0_ & ~0x00000400); - setterFlags_ = 0; - - return this; - } - - private java.util.List versionRequirement_ = java.util.Collections.emptyList(); - private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00000800) == 0x00000800)) { - versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00000800; - } - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public java.util.List - getVersionRequirementList() { - return java.util.Collections.unmodifiableList(versionRequirement_); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder setVersionRequirement( - int index, int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.set(index, value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder clearVersionRequirement() { - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000800); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Property) - } - - static { - defaultInstance = new Property(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Property) - } - - public interface ValueParameterOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.ValueParameter) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 flags = 1 [default = 0]; - * - *
-     *hasAnnotations
-     *declaresDefault
-     *isCrossinline
-     *isNoinline
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 1 [default = 0]; - * - *
-     *hasAnnotations
-     *declaresDefault
-     *isCrossinline
-     *isNoinline
-     * 
- */ - int getFlags(); - - /** - * required int32 name = 2; - */ - boolean hasName(); - /** - * required int32 name = 2; - */ - int getName(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - boolean hasType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - ProtoBuf.Type getType(); - - /** - * optional int32 type_id = 5; - */ - boolean hasTypeId(); - /** - * optional int32 type_id = 5; - */ - int getTypeId(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - boolean hasVarargElementType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - ProtoBuf.Type getVarargElementType(); - - /** - * optional int32 vararg_element_type_id = 6; - */ - boolean hasVarargElementTypeId(); - /** - * optional int32 vararg_element_type_id = 6; - */ - int getVarargElementTypeId(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} - */ - public static final class ValueParameter extends - GeneratedMessageLite.ExtendableMessage< - ValueParameter> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.ValueParameter) - ValueParameterOrBuilder { - // Use ValueParameter.newBuilder() to construct. - private ValueParameter(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private ValueParameter(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final ValueParameter defaultInstance; - public static ValueParameter getDefaultInstance() { - return defaultInstance; - } - - public ValueParameter getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private ValueParameter( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - name_ = input.readInt32(); - break; - } - case 26: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = type_.toBuilder(); - } - type_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(type_); - type_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 34: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = varargElementType_.toBuilder(); - } - varargElementType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(varargElementType_); - varargElementType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - case 40: { - bitField0_ |= 0x00000008; - typeId_ = input.readInt32(); - break; - } - case 48: { - bitField0_ |= 0x00000020; - varargElementTypeId_ = input.readInt32(); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public ValueParameter parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new ValueParameter(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 1; - private int flags_; - /** - * optional int32 flags = 1 [default = 0]; - * - *
-     *hasAnnotations
-     *declaresDefault
-     *isCrossinline
-     *isNoinline
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 0]; - * - *
-     *hasAnnotations
-     *declaresDefault
-     *isCrossinline
-     *isNoinline
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private int name_; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - - public static final int TYPE_FIELD_NUMBER = 3; - private ProtoBuf.Type type_; - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public ProtoBuf.Type getType() { - return type_; - } - - public static final int TYPE_ID_FIELD_NUMBER = 5; - private int typeId_; - /** - * optional int32 type_id = 5; - */ - public boolean hasTypeId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 type_id = 5; - */ - public int getTypeId() { - return typeId_; - } - - public static final int VARARG_ELEMENT_TYPE_FIELD_NUMBER = 4; - private ProtoBuf.Type varargElementType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public boolean hasVarargElementType() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public ProtoBuf.Type getVarargElementType() { - return varargElementType_; - } - - public static final int VARARG_ELEMENT_TYPE_ID_FIELD_NUMBER = 6; - private int varargElementTypeId_; - /** - * optional int32 vararg_element_type_id = 6; - */ - public boolean hasVarargElementTypeId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int32 vararg_element_type_id = 6; - */ - public int getVarargElementTypeId() { - return varargElementTypeId_; - } - - private void initFields() { - flags_ = 0; - name_ = 0; - type_ = ProtoBuf.Type.getDefaultInstance(); - typeId_ = 0; - varargElementType_ = ProtoBuf.Type.getDefaultInstance(); - varargElementTypeId_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - if (hasType()) { - if (!getType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasVarargElementType()) { - if (!getVarargElementType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, flags_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, name_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(3, type_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(4, varargElementType_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(5, typeId_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt32(6, varargElementTypeId_); - } - extensionWriter.writeUntil(200, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, flags_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(2, name_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeMessageSize(3, type_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeMessageSize(4, varargElementType_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeInt32Size(5, typeId_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += CodedOutputStream - .computeInt32Size(6, varargElementTypeId_); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.ValueParameter parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.ValueParameter parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.ValueParameter parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.ValueParameter parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.ValueParameter parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.ValueParameter parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.ValueParameter parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.ValueParameter parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.ValueParameter parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.ValueParameter parseFrom( - CodedInputStream input, - 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(ProtoBuf.ValueParameter prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.ValueParameter} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.ValueParameter, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.ValueParameter) - ProtoBuf.ValueParameterOrBuilder { - // Construct using ProtoBuf.ValueParameter.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - type_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000004); - typeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000008); - varargElementType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000010); - varargElementTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.ValueParameter getDefaultInstanceForType() { - return ProtoBuf.ValueParameter.getDefaultInstance(); - } - - public ProtoBuf.ValueParameter build() { - ProtoBuf.ValueParameter result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.ValueParameter buildPartial() { - ProtoBuf.ValueParameter result = new ProtoBuf.ValueParameter(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.typeId_ = typeId_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.varargElementType_ = varargElementType_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.varargElementTypeId_ = varargElementTypeId_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.ValueParameter other) { - if (other == ProtoBuf.ValueParameter.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasType()) { - mergeType(other.getType()); - } - if (other.hasTypeId()) { - setTypeId(other.getTypeId()); - } - if (other.hasVarargElementType()) { - mergeVarargElementType(other.getVarargElementType()); - } - if (other.hasVarargElementTypeId()) { - setVarargElementTypeId(other.getVarargElementTypeId()); - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - if (hasType()) { - if (!getType().isInitialized()) { - - return false; - } - } - if (hasVarargElementType()) { - if (!getVarargElementType().isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.ValueParameter parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.ValueParameter) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ ; - /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *hasAnnotations
-       *declaresDefault
-       *isCrossinline
-       *isNoinline
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *hasAnnotations
-       *declaresDefault
-       *isCrossinline
-       *isNoinline
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *hasAnnotations
-       *declaresDefault
-       *isCrossinline
-       *isNoinline
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *hasAnnotations
-       *declaresDefault
-       *isCrossinline
-       *isNoinline
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 0; - - return this; - } - - private int name_ ; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 2; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000002; - name_ = value; - - return this; - } - /** - * required int32 name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; - - return this; - } - - private ProtoBuf.Type type_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public ProtoBuf.Type getType() { - return type_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public Builder setType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - type_ = value; - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public Builder setType( - ProtoBuf.Type.Builder builderForValue) { - type_ = builderForValue.build(); - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public Builder mergeType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - type_ != ProtoBuf.Type.getDefaultInstance()) { - type_ = - ProtoBuf.Type.newBuilder(type_).mergeFrom(value).buildPartial(); - } else { - type_ = value; - } - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type type = 3; - */ - public Builder clearType() { - type_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - private int typeId_ ; - /** - * optional int32 type_id = 5; - */ - public boolean hasTypeId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 type_id = 5; - */ - public int getTypeId() { - return typeId_; - } - /** - * optional int32 type_id = 5; - */ - public Builder setTypeId(int value) { - bitField0_ |= 0x00000008; - typeId_ = value; - - return this; - } - /** - * optional int32 type_id = 5; - */ - public Builder clearTypeId() { - bitField0_ = (bitField0_ & ~0x00000008); - typeId_ = 0; - - return this; - } - - private ProtoBuf.Type varargElementType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public boolean hasVarargElementType() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public ProtoBuf.Type getVarargElementType() { - return varargElementType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public Builder setVarargElementType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - varargElementType_ = value; - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public Builder setVarargElementType( - ProtoBuf.Type.Builder builderForValue) { - varargElementType_ = builderForValue.build(); - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public Builder mergeVarargElementType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000010) == 0x00000010) && - varargElementType_ != ProtoBuf.Type.getDefaultInstance()) { - varargElementType_ = - ProtoBuf.Type.newBuilder(varargElementType_).mergeFrom(value).buildPartial(); - } else { - varargElementType_ = value; - } - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type vararg_element_type = 4; - */ - public Builder clearVarargElementType() { - varargElementType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - private int varargElementTypeId_ ; - /** - * optional int32 vararg_element_type_id = 6; - */ - public boolean hasVarargElementTypeId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int32 vararg_element_type_id = 6; - */ - public int getVarargElementTypeId() { - return varargElementTypeId_; - } - /** - * optional int32 vararg_element_type_id = 6; - */ - public Builder setVarargElementTypeId(int value) { - bitField0_ |= 0x00000020; - varargElementTypeId_ = value; - - return this; - } - /** - * optional int32 vararg_element_type_id = 6; - */ - public Builder clearVarargElementTypeId() { - bitField0_ = (bitField0_ & ~0x00000020); - varargElementTypeId_ = 0; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.ValueParameter) - } - - static { - defaultInstance = new ValueParameter(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.ValueParameter) - } - - public interface TypeAliasOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.TypeAlias) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     * 
- */ - int getFlags(); - - /** - * required int32 name = 2; - */ - boolean hasName(); - /** - * required int32 name = 2; - */ - int getName(); - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - java.util.List - getTypeParameterList(); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - ProtoBuf.TypeParameter getTypeParameter(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - int getTypeParameterCount(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - boolean hasUnderlyingType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - ProtoBuf.Type getUnderlyingType(); - - /** - * optional int32 underlying_type_id = 5; - */ - boolean hasUnderlyingTypeId(); - /** - * optional int32 underlying_type_id = 5; - */ - int getUnderlyingTypeId(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - boolean hasExpandedType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - ProtoBuf.Type getExpandedType(); - - /** - * optional int32 expanded_type_id = 7; - */ - boolean hasExpandedTypeId(); - /** - * optional int32 expanded_type_id = 7; - */ - int getExpandedTypeId(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - java.util.List - getAnnotationList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - ProtoBuf.Annotation getAnnotation(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - int getAnnotationCount(); - - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - java.util.List getVersionRequirementList(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirementCount(); - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - int getVersionRequirement(int index); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} - */ - public static final class TypeAlias extends - GeneratedMessageLite.ExtendableMessage< - TypeAlias> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.TypeAlias) - TypeAliasOrBuilder { - // Use TypeAlias.newBuilder() to construct. - private TypeAlias(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private TypeAlias(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final TypeAlias defaultInstance; - public static TypeAlias getDefaultInstance() { - return defaultInstance; - } - - public TypeAlias getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private TypeAlias( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - name_ = input.readInt32(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - typeParameter_.add(input.readMessage(ProtoBuf.TypeParameter.PARSER, extensionRegistry)); - break; - } - case 34: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = underlyingType_.toBuilder(); - } - underlyingType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(underlyingType_); - underlyingType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 40: { - bitField0_ |= 0x00000008; - underlyingTypeId_ = input.readInt32(); - break; - } - case 50: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = expandedType_.toBuilder(); - } - expandedType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(expandedType_); - expandedType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - case 56: { - bitField0_ |= 0x00000020; - expandedTypeId_ = input.readInt32(); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; - } - annotation_.add(input.readMessage(ProtoBuf.Annotation.PARSER, extensionRegistry)); - break; - } - case 248: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - versionRequirement_.add(input.readInt32()); - break; - } - case 250: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100) && input.getBytesUntilLimit() > 0) { - versionRequirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - while (input.getBytesUntilLimit() > 0) { - versionRequirement_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - } - if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = java.util.Collections.unmodifiableList(annotation_); - } - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public TypeAlias parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new TypeAlias(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 1; - private int flags_; - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-     *hasAnnotations
-     *Visibility
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private int name_; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - - public static final int TYPE_PARAMETER_FIELD_NUMBER = 3; - private java.util.List typeParameter_; - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public java.util.List getTypeParameterList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public java.util.List - getTypeParameterOrBuilderList() { - return typeParameter_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public ProtoBuf.TypeParameterOrBuilder getTypeParameterOrBuilder( - int index) { - return typeParameter_.get(index); - } - - public static final int UNDERLYING_TYPE_FIELD_NUMBER = 4; - private ProtoBuf.Type underlyingType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public boolean hasUnderlyingType() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public ProtoBuf.Type getUnderlyingType() { - return underlyingType_; - } - - public static final int UNDERLYING_TYPE_ID_FIELD_NUMBER = 5; - private int underlyingTypeId_; - /** - * optional int32 underlying_type_id = 5; - */ - public boolean hasUnderlyingTypeId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 underlying_type_id = 5; - */ - public int getUnderlyingTypeId() { - return underlyingTypeId_; - } - - public static final int EXPANDED_TYPE_FIELD_NUMBER = 6; - private ProtoBuf.Type expandedType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public boolean hasExpandedType() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public ProtoBuf.Type getExpandedType() { - return expandedType_; - } - - public static final int EXPANDED_TYPE_ID_FIELD_NUMBER = 7; - private int expandedTypeId_; - /** - * optional int32 expanded_type_id = 7; - */ - public boolean hasExpandedTypeId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int32 expanded_type_id = 7; - */ - public int getExpandedTypeId() { - return expandedTypeId_; - } - - public static final int ANNOTATION_FIELD_NUMBER = 8; - private java.util.List annotation_; - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public java.util.List getAnnotationList() { - return annotation_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public java.util.List - getAnnotationOrBuilderList() { - return annotation_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public int getAnnotationCount() { - return annotation_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public ProtoBuf.Annotation getAnnotation(int index) { - return annotation_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public ProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder( - int index) { - return annotation_.get(index); - } - - public static final int VERSION_REQUIREMENT_FIELD_NUMBER = 31; - private java.util.List versionRequirement_; - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public java.util.List - getVersionRequirementList() { - return versionRequirement_; - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-     * Index into the VersionRequirementTable
-     * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - - private void initFields() { - flags_ = 6; - name_ = 0; - typeParameter_ = java.util.Collections.emptyList(); - underlyingType_ = ProtoBuf.Type.getDefaultInstance(); - underlyingTypeId_ = 0; - expandedType_ = ProtoBuf.Type.getDefaultInstance(); - expandedTypeId_ = 0; - annotation_ = java.util.Collections.emptyList(); - versionRequirement_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasName()) { - memoizedIsInitialized = 0; - return false; - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasUnderlyingType()) { - if (!getUnderlyingType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasExpandedType()) { - if (!getExpandedType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getAnnotationCount(); i++) { - if (!getAnnotation(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, flags_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, name_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - output.writeMessage(3, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(4, underlyingType_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(5, underlyingTypeId_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(6, expandedType_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt32(7, expandedTypeId_); - } - for (int i = 0; i < annotation_.size(); i++) { - output.writeMessage(8, annotation_.get(i)); - } - for (int i = 0; i < versionRequirement_.size(); i++) { - output.writeInt32(31, versionRequirement_.get(i)); - } - extensionWriter.writeUntil(200, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, flags_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(2, name_); - } - for (int i = 0; i < typeParameter_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(3, typeParameter_.get(i)); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeMessageSize(4, underlyingType_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeInt32Size(5, underlyingTypeId_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeMessageSize(6, expandedType_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += CodedOutputStream - .computeInt32Size(7, expandedTypeId_); - } - for (int i = 0; i < annotation_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(8, annotation_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < versionRequirement_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(versionRequirement_.get(i)); - } - size += dataSize; - size += 2 * getVersionRequirementList().size(); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.TypeAlias parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.TypeAlias parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.TypeAlias parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.TypeAlias parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.TypeAlias parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.TypeAlias parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.TypeAlias parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.TypeAlias parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.TypeAlias parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.TypeAlias parseFrom( - CodedInputStream input, - 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(ProtoBuf.TypeAlias prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.TypeAlias} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.TypeAlias, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.TypeAlias) - ProtoBuf.TypeAliasOrBuilder { - // Construct using ProtoBuf.TypeAlias.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 6; - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - underlyingType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - underlyingTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - expandedType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000020); - expandedTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000040); - annotation_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.TypeAlias getDefaultInstanceForType() { - return ProtoBuf.TypeAlias.getDefaultInstance(); - } - - public ProtoBuf.TypeAlias build() { - ProtoBuf.TypeAlias result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.TypeAlias buildPartial() { - ProtoBuf.TypeAlias result = new ProtoBuf.TypeAlias(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.name_ = name_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.typeParameter_ = typeParameter_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000004; - } - result.underlyingType_ = underlyingType_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000008; - } - result.underlyingTypeId_ = underlyingTypeId_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000010; - } - result.expandedType_ = expandedType_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000020; - } - result.expandedTypeId_ = expandedTypeId_; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = java.util.Collections.unmodifiableList(annotation_); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.annotation_ = annotation_; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.versionRequirement_ = versionRequirement_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.TypeAlias other) { - if (other == ProtoBuf.TypeAlias.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasName()) { - setName(other.getName()); - } - if (!other.typeParameter_.isEmpty()) { - if (typeParameter_.isEmpty()) { - typeParameter_ = other.typeParameter_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureTypeParameterIsMutable(); - typeParameter_.addAll(other.typeParameter_); - } - - } - if (other.hasUnderlyingType()) { - mergeUnderlyingType(other.getUnderlyingType()); - } - if (other.hasUnderlyingTypeId()) { - setUnderlyingTypeId(other.getUnderlyingTypeId()); - } - if (other.hasExpandedType()) { - mergeExpandedType(other.getExpandedType()); - } - if (other.hasExpandedTypeId()) { - setExpandedTypeId(other.getExpandedTypeId()); - } - if (!other.annotation_.isEmpty()) { - if (annotation_.isEmpty()) { - annotation_ = other.annotation_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureAnnotationIsMutable(); - annotation_.addAll(other.annotation_); - } - - } - if (!other.versionRequirement_.isEmpty()) { - if (versionRequirement_.isEmpty()) { - versionRequirement_ = other.versionRequirement_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureVersionRequirementIsMutable(); - versionRequirement_.addAll(other.versionRequirement_); - } - - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasName()) { - - return false; - } - for (int i = 0; i < getTypeParameterCount(); i++) { - if (!getTypeParameter(i).isInitialized()) { - - return false; - } - } - if (hasUnderlyingType()) { - if (!getUnderlyingType().isInitialized()) { - - return false; - } - } - if (hasExpandedType()) { - if (!getExpandedType().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getAnnotationCount(); i++) { - if (!getAnnotation(i).isInitialized()) { - - return false; - } - } - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.TypeAlias parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.TypeAlias) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ = 6; - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 1 [default = 6]; - * - *
-       *hasAnnotations
-       *Visibility
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 6; - - return this; - } - - private int name_ ; - /** - * required int32 name = 2; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required int32 name = 2; - */ - public int getName() { - return name_; - } - /** - * required int32 name = 2; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000002; - name_ = value; - - return this; - } - /** - * required int32 name = 2; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000002); - name_ = 0; - - return this; - } - - private java.util.List typeParameter_ = - java.util.Collections.emptyList(); - private void ensureTypeParameterIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - typeParameter_ = new java.util.ArrayList(typeParameter_); - bitField0_ |= 0x00000004; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public java.util.List getTypeParameterList() { - return java.util.Collections.unmodifiableList(typeParameter_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public int getTypeParameterCount() { - return typeParameter_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public ProtoBuf.TypeParameter getTypeParameter(int index) { - return typeParameter_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder setTypeParameter( - int index, ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder setTypeParameter( - int index, ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addTypeParameter(ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addTypeParameter( - int index, ProtoBuf.TypeParameter value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeParameterIsMutable(); - typeParameter_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addTypeParameter( - ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addTypeParameter( - int index, ProtoBuf.TypeParameter.Builder builderForValue) { - ensureTypeParameterIsMutable(); - typeParameter_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder addAllTypeParameter( - java.lang.Iterable values) { - ensureTypeParameterIsMutable(); - AbstractMessageLite.Builder.addAll( - values, typeParameter_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder clearTypeParameter() { - typeParameter_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.TypeParameter type_parameter = 3; - */ - public Builder removeTypeParameter(int index) { - ensureTypeParameterIsMutable(); - typeParameter_.remove(index); - - return this; - } - - private ProtoBuf.Type underlyingType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public boolean hasUnderlyingType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public ProtoBuf.Type getUnderlyingType() { - return underlyingType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public Builder setUnderlyingType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - underlyingType_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public Builder setUnderlyingType( - ProtoBuf.Type.Builder builderForValue) { - underlyingType_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public Builder mergeUnderlyingType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - underlyingType_ != ProtoBuf.Type.getDefaultInstance()) { - underlyingType_ = - ProtoBuf.Type.newBuilder(underlyingType_).mergeFrom(value).buildPartial(); - } else { - underlyingType_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type underlying_type = 4; - */ - public Builder clearUnderlyingType() { - underlyingType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private int underlyingTypeId_ ; - /** - * optional int32 underlying_type_id = 5; - */ - public boolean hasUnderlyingTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 underlying_type_id = 5; - */ - public int getUnderlyingTypeId() { - return underlyingTypeId_; - } - /** - * optional int32 underlying_type_id = 5; - */ - public Builder setUnderlyingTypeId(int value) { - bitField0_ |= 0x00000010; - underlyingTypeId_ = value; - - return this; - } - /** - * optional int32 underlying_type_id = 5; - */ - public Builder clearUnderlyingTypeId() { - bitField0_ = (bitField0_ & ~0x00000010); - underlyingTypeId_ = 0; - - return this; - } - - private ProtoBuf.Type expandedType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public boolean hasExpandedType() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public ProtoBuf.Type getExpandedType() { - return expandedType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public Builder setExpandedType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - expandedType_ = value; - - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public Builder setExpandedType( - ProtoBuf.Type.Builder builderForValue) { - expandedType_ = builderForValue.build(); - - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public Builder mergeExpandedType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000020) == 0x00000020) && - expandedType_ != ProtoBuf.Type.getDefaultInstance()) { - expandedType_ = - ProtoBuf.Type.newBuilder(expandedType_).mergeFrom(value).buildPartial(); - } else { - expandedType_ = value; - } - - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type expanded_type = 6; - */ - public Builder clearExpandedType() { - expandedType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - private int expandedTypeId_ ; - /** - * optional int32 expanded_type_id = 7; - */ - public boolean hasExpandedTypeId() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional int32 expanded_type_id = 7; - */ - public int getExpandedTypeId() { - return expandedTypeId_; - } - /** - * optional int32 expanded_type_id = 7; - */ - public Builder setExpandedTypeId(int value) { - bitField0_ |= 0x00000040; - expandedTypeId_ = value; - - return this; - } - /** - * optional int32 expanded_type_id = 7; - */ - public Builder clearExpandedTypeId() { - bitField0_ = (bitField0_ & ~0x00000040); - expandedTypeId_ = 0; - - return this; - } - - private java.util.List annotation_ = - java.util.Collections.emptyList(); - private void ensureAnnotationIsMutable() { - if (!((bitField0_ & 0x00000080) == 0x00000080)) { - annotation_ = new java.util.ArrayList(annotation_); - bitField0_ |= 0x00000080; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public java.util.List getAnnotationList() { - return java.util.Collections.unmodifiableList(annotation_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public int getAnnotationCount() { - return annotation_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public ProtoBuf.Annotation getAnnotation(int index) { - return annotation_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder setAnnotation( - int index, ProtoBuf.Annotation value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder setAnnotation( - int index, ProtoBuf.Annotation.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAnnotation(ProtoBuf.Annotation value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAnnotation( - int index, ProtoBuf.Annotation value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAnnotation( - ProtoBuf.Annotation.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAnnotation( - int index, ProtoBuf.Annotation.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder addAllAnnotation( - java.lang.Iterable values) { - ensureAnnotationIsMutable(); - AbstractMessageLite.Builder.addAll( - values, annotation_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder clearAnnotation() { - annotation_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Annotation annotation = 8; - */ - public Builder removeAnnotation(int index) { - ensureAnnotationIsMutable(); - annotation_.remove(index); - - return this; - } - - private java.util.List versionRequirement_ = java.util.Collections.emptyList(); - private void ensureVersionRequirementIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - versionRequirement_ = new java.util.ArrayList(versionRequirement_); - bitField0_ |= 0x00000100; - } - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public java.util.List - getVersionRequirementList() { - return java.util.Collections.unmodifiableList(versionRequirement_); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirementCount() { - return versionRequirement_.size(); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public int getVersionRequirement(int index) { - return versionRequirement_.get(index); - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder setVersionRequirement( - int index, int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.set(index, value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addVersionRequirement(int value) { - ensureVersionRequirementIsMutable(); - versionRequirement_.add(value); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder addAllVersionRequirement( - java.lang.Iterable values) { - ensureVersionRequirementIsMutable(); - AbstractMessageLite.Builder.addAll( - values, versionRequirement_); - - return this; - } - /** - * repeated int32 version_requirement = 31; - * - *
-       * Index into the VersionRequirementTable
-       * 
- */ - public Builder clearVersionRequirement() { - versionRequirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.TypeAlias) - } - - static { - defaultInstance = new TypeAlias(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.TypeAlias) - } - - public interface EnumEntryOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.EnumEntry) - GeneratedMessageLite. - ExtendableMessageOrBuilder { - - /** - * optional int32 name = 1; - */ - boolean hasName(); - /** - * optional int32 name = 1; - */ - int getName(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} - */ - public static final class EnumEntry extends - GeneratedMessageLite.ExtendableMessage< - EnumEntry> implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.EnumEntry) - EnumEntryOrBuilder { - // Use EnumEntry.newBuilder() to construct. - private EnumEntry(GeneratedMessageLite.ExtendableBuilder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private EnumEntry(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final EnumEntry defaultInstance; - public static EnumEntry getDefaultInstance() { - return defaultInstance; - } - - public EnumEntry getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private EnumEntry( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - name_ = input.readInt32(); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public EnumEntry parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new EnumEntry(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private int name_; - /** - * optional int32 name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 name = 1; - */ - public int getName() { - return name_; - } - - private void initFields() { - name_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!extensionsAreInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - GeneratedMessageLite - .ExtendableMessage.ExtensionWriter extensionWriter = - newExtensionWriter(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, name_); - } - extensionWriter.writeUntil(200, output); - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, name_); - } - size += extensionsSerializedSize(); - size += unknownFields.size(); - 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 ProtoBuf.EnumEntry parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.EnumEntry parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.EnumEntry parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.EnumEntry parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.EnumEntry parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.EnumEntry parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.EnumEntry parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.EnumEntry parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.EnumEntry parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.EnumEntry parseFrom( - CodedInputStream input, - 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(ProtoBuf.EnumEntry prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.EnumEntry} - */ - public static final class Builder extends - GeneratedMessageLite.ExtendableBuilder< - ProtoBuf.EnumEntry, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.EnumEntry) - ProtoBuf.EnumEntryOrBuilder { - // Construct using ProtoBuf.EnumEntry.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.EnumEntry getDefaultInstanceForType() { - return ProtoBuf.EnumEntry.getDefaultInstance(); - } - - public ProtoBuf.EnumEntry build() { - ProtoBuf.EnumEntry result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.EnumEntry buildPartial() { - ProtoBuf.EnumEntry result = new ProtoBuf.EnumEntry(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.EnumEntry other) { - if (other == ProtoBuf.EnumEntry.getDefaultInstance()) return this; - if (other.hasName()) { - setName(other.getName()); - } - this.mergeExtensionFields(other); - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!extensionsAreInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.EnumEntry parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.EnumEntry) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int name_ ; - /** - * optional int32 name = 1; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 name = 1; - */ - public int getName() { - return name_; - } - /** - * optional int32 name = 1; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000001; - name_ = value; - - return this; - } - /** - * optional int32 name = 1; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.EnumEntry) - } - - static { - defaultInstance = new EnumEntry(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.EnumEntry) - } - - public interface VersionRequirementOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - MessageLiteOrBuilder { - - /** - * optional int32 version = 1; - * - *
-     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-     * (patch << 7) + (minor << 3) + major
-     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-     * 
- */ - boolean hasVersion(); - /** - * optional int32 version = 1; - * - *
-     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-     * (patch << 7) + (minor << 3) + major
-     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-     * 
- */ - int getVersion(); - - /** - * optional int32 version_full = 2; - * - *
-     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-     * (patch << 16) + (minor << 8) + major
-     * 
- */ - boolean hasVersionFull(); - /** - * optional int32 version_full = 2; - * - *
-     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-     * (patch << 16) + (minor << 8) + major
-     * 
- */ - int getVersionFull(); - - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-     * Level of the reported diagnostic
-     * 
- */ - boolean hasLevel(); - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-     * Level of the reported diagnostic
-     * 
- */ - ProtoBuf.VersionRequirement.Level getLevel(); - - /** - * optional int32 error_code = 4; - * - *
-     * Error code, to be looked up on the website
-     * 
- */ - boolean hasErrorCode(); - /** - * optional int32 error_code = 4; - * - *
-     * Error code, to be looked up on the website
-     * 
- */ - int getErrorCode(); - - /** - * optional int32 message = 5; - * - *
-     * Diagnostic message
-     * 
- */ - boolean hasMessage(); - /** - * optional int32 message = 5; - * - *
-     * Diagnostic message
-     * 
- */ - int getMessage(); - - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-     * 
- */ - boolean hasVersionKind(); - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-     * 
- */ - ProtoBuf.VersionRequirement.VersionKind getVersionKind(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} - */ - public static final class VersionRequirement extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - VersionRequirementOrBuilder { - // Use VersionRequirement.newBuilder() to construct. - private VersionRequirement(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private VersionRequirement(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final VersionRequirement defaultInstance; - public static VersionRequirement getDefaultInstance() { - return defaultInstance; - } - - public VersionRequirement getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private VersionRequirement( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - version_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - versionFull_ = input.readInt32(); - break; - } - case 24: { - int rawValue = input.readEnum(); - ProtoBuf.VersionRequirement.Level value = ProtoBuf.VersionRequirement.Level.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000004; - level_ = value; - } - break; - } - case 32: { - bitField0_ |= 0x00000008; - errorCode_ = input.readInt32(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - message_ = input.readInt32(); - break; - } - case 48: { - int rawValue = input.readEnum(); - ProtoBuf.VersionRequirement.VersionKind value = ProtoBuf.VersionRequirement.VersionKind.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000020; - versionKind_ = value; - } - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public VersionRequirement parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new VersionRequirement(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level} - */ - public enum Level - implements Internal.EnumLite { - /** - * WARNING = 0; - */ - WARNING(0, 0), - /** - * ERROR = 1; - */ - ERROR(1, 1), - /** - * HIDDEN = 2; - */ - HIDDEN(2, 2), - ; - - /** - * WARNING = 0; - */ - public static final int WARNING_VALUE = 0; - /** - * ERROR = 1; - */ - public static final int ERROR_VALUE = 1; - /** - * HIDDEN = 2; - */ - public static final int HIDDEN_VALUE = 2; - - - public final int getNumber() { return value; } - - public static Level valueOf(int value) { - switch (value) { - case 0: return WARNING; - case 1: return ERROR; - case 2: return HIDDEN; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - public Level findValueByNumber(int number) { - return Level.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Level(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level) - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind} - */ - public enum VersionKind - implements Internal.EnumLite { - /** - * LANGUAGE_VERSION = 0; - */ - LANGUAGE_VERSION(0, 0), - /** - * COMPILER_VERSION = 1; - */ - COMPILER_VERSION(1, 1), - /** - * API_VERSION = 2; - */ - API_VERSION(2, 2), - ; - - /** - * LANGUAGE_VERSION = 0; - */ - public static final int LANGUAGE_VERSION_VALUE = 0; - /** - * COMPILER_VERSION = 1; - */ - public static final int COMPILER_VERSION_VALUE = 1; - /** - * API_VERSION = 2; - */ - public static final int API_VERSION_VALUE = 2; - - - public final int getNumber() { return value; } - - public static VersionKind valueOf(int value) { - switch (value) { - case 0: return LANGUAGE_VERSION; - case 1: return COMPILER_VERSION; - case 2: return API_VERSION; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - public VersionKind findValueByNumber(int number) { - return VersionKind.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private VersionKind(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind) - } - - private int bitField0_; - public static final int VERSION_FIELD_NUMBER = 1; - private int version_; - /** - * optional int32 version = 1; - * - *
-     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-     * (patch << 7) + (minor << 3) + major
-     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-     * 
- */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 version = 1; - * - *
-     * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-     * (patch << 7) + (minor << 3) + major
-     * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-     * 
- */ - public int getVersion() { - return version_; - } - - public static final int VERSION_FULL_FIELD_NUMBER = 2; - private int versionFull_; - /** - * optional int32 version_full = 2; - * - *
-     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-     * (patch << 16) + (minor << 8) + major
-     * 
- */ - public boolean hasVersionFull() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 version_full = 2; - * - *
-     * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-     * (patch << 16) + (minor << 8) + major
-     * 
- */ - public int getVersionFull() { - return versionFull_; - } - - public static final int LEVEL_FIELD_NUMBER = 3; - private ProtoBuf.VersionRequirement.Level level_; - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-     * Level of the reported diagnostic
-     * 
- */ - public boolean hasLevel() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-     * Level of the reported diagnostic
-     * 
- */ - public ProtoBuf.VersionRequirement.Level getLevel() { - return level_; - } - - public static final int ERROR_CODE_FIELD_NUMBER = 4; - private int errorCode_; - /** - * optional int32 error_code = 4; - * - *
-     * Error code, to be looked up on the website
-     * 
- */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 error_code = 4; - * - *
-     * Error code, to be looked up on the website
-     * 
- */ - public int getErrorCode() { - return errorCode_; - } - - public static final int MESSAGE_FIELD_NUMBER = 5; - private int message_; - /** - * optional int32 message = 5; - * - *
-     * Diagnostic message
-     * 
- */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 message = 5; - * - *
-     * Diagnostic message
-     * 
- */ - public int getMessage() { - return message_; - } - - public static final int VERSION_KIND_FIELD_NUMBER = 6; - private ProtoBuf.VersionRequirement.VersionKind versionKind_; - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-     * 
- */ - public boolean hasVersionKind() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-     * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-     * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-     * 
- */ - public ProtoBuf.VersionRequirement.VersionKind getVersionKind() { - return versionKind_; - } - - private void initFields() { - version_ = 0; - versionFull_ = 0; - level_ = ProtoBuf.VersionRequirement.Level.ERROR; - errorCode_ = 0; - message_ = 0; - versionKind_ = ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, version_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, versionFull_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeEnum(3, level_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(4, errorCode_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(5, message_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeEnum(6, versionKind_.getNumber()); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, version_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(2, versionFull_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeEnumSize(3, level_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeInt32Size(4, errorCode_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeInt32Size(5, message_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += CodedOutputStream - .computeEnumSize(6, versionKind_.getNumber()); - } - size += unknownFields.size(); - 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 ProtoBuf.VersionRequirement parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.VersionRequirement parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.VersionRequirement parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.VersionRequirement parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.VersionRequirement parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.VersionRequirement parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.VersionRequirement parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.VersionRequirement parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.VersionRequirement parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.VersionRequirement parseFrom( - CodedInputStream input, - 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(ProtoBuf.VersionRequirement prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirement} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.VersionRequirement, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - ProtoBuf.VersionRequirementOrBuilder { - // Construct using ProtoBuf.VersionRequirement.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - version_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - versionFull_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - level_ = ProtoBuf.VersionRequirement.Level.ERROR; - bitField0_ = (bitField0_ & ~0x00000004); - errorCode_ = 0; - bitField0_ = (bitField0_ & ~0x00000008); - message_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - versionKind_ = ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.VersionRequirement getDefaultInstanceForType() { - return ProtoBuf.VersionRequirement.getDefaultInstance(); - } - - public ProtoBuf.VersionRequirement build() { - ProtoBuf.VersionRequirement result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.VersionRequirement buildPartial() { - ProtoBuf.VersionRequirement result = new ProtoBuf.VersionRequirement(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.version_ = version_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.versionFull_ = versionFull_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.level_ = level_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.errorCode_ = errorCode_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.message_ = message_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.versionKind_ = versionKind_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.VersionRequirement other) { - if (other == ProtoBuf.VersionRequirement.getDefaultInstance()) return this; - if (other.hasVersion()) { - setVersion(other.getVersion()); - } - if (other.hasVersionFull()) { - setVersionFull(other.getVersionFull()); - } - if (other.hasLevel()) { - setLevel(other.getLevel()); - } - if (other.hasErrorCode()) { - setErrorCode(other.getErrorCode()); - } - if (other.hasMessage()) { - setMessage(other.getMessage()); - } - if (other.hasVersionKind()) { - setVersionKind(other.getVersionKind()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.VersionRequirement parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.VersionRequirement) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int version_ ; - /** - * optional int32 version = 1; - * - *
-       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-       * (patch << 7) + (minor << 3) + major
-       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-       * 
- */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 version = 1; - * - *
-       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-       * (patch << 7) + (minor << 3) + major
-       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-       * 
- */ - public int getVersion() { - return version_; - } - /** - * optional int32 version = 1; - * - *
-       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-       * (patch << 7) + (minor << 3) + major
-       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-       * 
- */ - public Builder setVersion(int value) { - bitField0_ |= 0x00000001; - version_ = value; - - return this; - } - /** - * optional int32 version = 1; - * - *
-       * Kotlin version, since which this declaration is accessible, in the following format (encoded version is "major.minor.patch"):
-       * (patch << 7) + (minor << 3) + major
-       * Compilers with version less than this value should report a diagnostic if this declaration is selected as the resolution result
-       * 
- */ - public Builder clearVersion() { - bitField0_ = (bitField0_ & ~0x00000001); - version_ = 0; - - return this; - } - - private int versionFull_ ; - /** - * optional int32 version_full = 2; - * - *
-       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-       * (patch << 16) + (minor << 8) + major
-       * 
- */ - public boolean hasVersionFull() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 version_full = 2; - * - *
-       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-       * (patch << 16) + (minor << 8) + major
-       * 
- */ - public int getVersionFull() { - return versionFull_; - } - /** - * optional int32 version_full = 2; - * - *
-       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-       * (patch << 16) + (minor << 8) + major
-       * 
- */ - public Builder setVersionFull(int value) { - bitField0_ |= 0x00000002; - versionFull_ = value; - - return this; - } - /** - * optional int32 version_full = 2; - * - *
-       * Version in base 256, in case we run out of space to store the version in the optimized form. Has priority over 'version'.
-       * (patch << 16) + (minor << 8) + major
-       * 
- */ - public Builder clearVersionFull() { - bitField0_ = (bitField0_ & ~0x00000002); - versionFull_ = 0; - - return this; - } - - private ProtoBuf.VersionRequirement.Level level_ = ProtoBuf.VersionRequirement.Level.ERROR; - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-       * Level of the reported diagnostic
-       * 
- */ - public boolean hasLevel() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-       * Level of the reported diagnostic
-       * 
- */ - public ProtoBuf.VersionRequirement.Level getLevel() { - return level_; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-       * Level of the reported diagnostic
-       * 
- */ - public Builder setLevel(ProtoBuf.VersionRequirement.Level value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - level_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.Level level = 3 [default = ERROR]; - * - *
-       * Level of the reported diagnostic
-       * 
- */ - public Builder clearLevel() { - bitField0_ = (bitField0_ & ~0x00000004); - level_ = ProtoBuf.VersionRequirement.Level.ERROR; - - return this; - } - - private int errorCode_ ; - /** - * optional int32 error_code = 4; - * - *
-       * Error code, to be looked up on the website
-       * 
- */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 error_code = 4; - * - *
-       * Error code, to be looked up on the website
-       * 
- */ - public int getErrorCode() { - return errorCode_; - } - /** - * optional int32 error_code = 4; - * - *
-       * Error code, to be looked up on the website
-       * 
- */ - public Builder setErrorCode(int value) { - bitField0_ |= 0x00000008; - errorCode_ = value; - - return this; - } - /** - * optional int32 error_code = 4; - * - *
-       * Error code, to be looked up on the website
-       * 
- */ - public Builder clearErrorCode() { - bitField0_ = (bitField0_ & ~0x00000008); - errorCode_ = 0; - - return this; - } - - private int message_ ; - /** - * optional int32 message = 5; - * - *
-       * Diagnostic message
-       * 
- */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 message = 5; - * - *
-       * Diagnostic message
-       * 
- */ - public int getMessage() { - return message_; - } - /** - * optional int32 message = 5; - * - *
-       * Diagnostic message
-       * 
- */ - public Builder setMessage(int value) { - bitField0_ |= 0x00000010; - message_ = value; - - return this; - } - /** - * optional int32 message = 5; - * - *
-       * Diagnostic message
-       * 
- */ - public Builder clearMessage() { - bitField0_ = (bitField0_ & ~0x00000010); - message_ = 0; - - return this; - } - - private ProtoBuf.VersionRequirement.VersionKind versionKind_ = ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-       * 
- */ - public boolean hasVersionKind() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-       * 
- */ - public ProtoBuf.VersionRequirement.VersionKind getVersionKind() { - return versionKind_; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-       * 
- */ - public Builder setVersionKind(ProtoBuf.VersionRequirement.VersionKind value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - versionKind_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement.VersionKind version_kind = 6 [default = LANGUAGE_VERSION]; - * - *
-       * Which version is this requirement for. For example, if version_kind = API_VERSION, this declaration requires the API version
-       * (the "-api-version" argument value when compiling the call site) to be of at least the specified value
-       * 
- */ - public Builder clearVersionKind() { - bitField0_ = (bitField0_ & ~0x00000020); - versionKind_ = ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - } - - static { - defaultInstance = new VersionRequirement(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirement) - } - - public interface VersionRequirementTableOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - MessageLiteOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - java.util.List - getRequirementList(); - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - ProtoBuf.VersionRequirement getRequirement(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - int getRequirementCount(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} - */ - public static final class VersionRequirementTable extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - VersionRequirementTableOrBuilder { - // Use VersionRequirementTable.newBuilder() to construct. - private VersionRequirementTable(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private VersionRequirementTable(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final VersionRequirementTable defaultInstance; - public static VersionRequirementTable getDefaultInstance() { - return defaultInstance; - } - - public VersionRequirementTable getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private VersionRequirementTable( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - requirement_.add(input.readMessage(ProtoBuf.VersionRequirement.PARSER, extensionRegistry)); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = java.util.Collections.unmodifiableList(requirement_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public VersionRequirementTable parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new VersionRequirementTable(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - public static final int REQUIREMENT_FIELD_NUMBER = 1; - private java.util.List requirement_; - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public java.util.List getRequirementList() { - return requirement_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public java.util.List - getRequirementOrBuilderList() { - return requirement_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public int getRequirementCount() { - return requirement_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public ProtoBuf.VersionRequirement getRequirement(int index) { - return requirement_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public ProtoBuf.VersionRequirementOrBuilder getRequirementOrBuilder( - int index) { - return requirement_.get(index); - } - - private void initFields() { - requirement_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < requirement_.size(); i++) { - output.writeMessage(1, requirement_.get(i)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < requirement_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(1, requirement_.get(i)); - } - size += unknownFields.size(); - 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 ProtoBuf.VersionRequirementTable parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.VersionRequirementTable parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.VersionRequirementTable parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.VersionRequirementTable parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.VersionRequirementTable parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.VersionRequirementTable parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.VersionRequirementTable parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.VersionRequirementTable parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.VersionRequirementTable parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.VersionRequirementTable parseFrom( - CodedInputStream input, - 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(ProtoBuf.VersionRequirementTable prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.VersionRequirementTable, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - ProtoBuf.VersionRequirementTableOrBuilder { - // Construct using ProtoBuf.VersionRequirementTable.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - requirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.VersionRequirementTable getDefaultInstanceForType() { - return ProtoBuf.VersionRequirementTable.getDefaultInstance(); - } - - public ProtoBuf.VersionRequirementTable build() { - ProtoBuf.VersionRequirementTable result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.VersionRequirementTable buildPartial() { - ProtoBuf.VersionRequirementTable result = new ProtoBuf.VersionRequirementTable(this); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = java.util.Collections.unmodifiableList(requirement_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.requirement_ = requirement_; - return result; - } - - public Builder mergeFrom(ProtoBuf.VersionRequirementTable other) { - if (other == ProtoBuf.VersionRequirementTable.getDefaultInstance()) return this; - if (!other.requirement_.isEmpty()) { - if (requirement_.isEmpty()) { - requirement_ = other.requirement_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRequirementIsMutable(); - requirement_.addAll(other.requirement_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.VersionRequirementTable parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.VersionRequirementTable) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List requirement_ = - java.util.Collections.emptyList(); - private void ensureRequirementIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - requirement_ = new java.util.ArrayList(requirement_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public java.util.List getRequirementList() { - return java.util.Collections.unmodifiableList(requirement_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public int getRequirementCount() { - return requirement_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public ProtoBuf.VersionRequirement getRequirement(int index) { - return requirement_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder setRequirement( - int index, ProtoBuf.VersionRequirement value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequirementIsMutable(); - requirement_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder setRequirement( - int index, ProtoBuf.VersionRequirement.Builder builderForValue) { - ensureRequirementIsMutable(); - requirement_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder addRequirement(ProtoBuf.VersionRequirement value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequirementIsMutable(); - requirement_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder addRequirement( - int index, ProtoBuf.VersionRequirement value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequirementIsMutable(); - requirement_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder addRequirement( - ProtoBuf.VersionRequirement.Builder builderForValue) { - ensureRequirementIsMutable(); - requirement_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder addRequirement( - int index, ProtoBuf.VersionRequirement.Builder builderForValue) { - ensureRequirementIsMutable(); - requirement_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder addAllRequirement( - java.lang.Iterable values) { - ensureRequirementIsMutable(); - AbstractMessageLite.Builder.addAll( - values, requirement_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder clearRequirement() { - requirement_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.deserialization.VersionRequirement requirement = 1; - */ - public Builder removeRequirement(int index) { - ensureRequirementIsMutable(); - requirement_.remove(index); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - } - - static { - defaultInstance = new VersionRequirementTable(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.deserialization.VersionRequirementTable) - } - - public interface ContractOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Contract) - MessageLiteOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - java.util.List - getEffectList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - ProtoBuf.Effect getEffect(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - int getEffectCount(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Contract} - */ - public static final class Contract extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Contract) - ContractOrBuilder { - // Use Contract.newBuilder() to construct. - private Contract(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Contract(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Contract defaultInstance; - public static Contract getDefaultInstance() { - return defaultInstance; - } - - public Contract getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Contract( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - effect_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - effect_.add(input.readMessage(ProtoBuf.Effect.PARSER, extensionRegistry)); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - effect_ = java.util.Collections.unmodifiableList(effect_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Contract parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Contract(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - public static final int EFFECT_FIELD_NUMBER = 1; - private java.util.List effect_; - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public java.util.List getEffectList() { - return effect_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public java.util.List - getEffectOrBuilderList() { - return effect_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public int getEffectCount() { - return effect_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public ProtoBuf.Effect getEffect(int index) { - return effect_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public ProtoBuf.EffectOrBuilder getEffectOrBuilder( - int index) { - return effect_.get(index); - } - - private void initFields() { - effect_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getEffectCount(); i++) { - if (!getEffect(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < effect_.size(); i++) { - output.writeMessage(1, effect_.get(i)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < effect_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(1, effect_.get(i)); - } - size += unknownFields.size(); - 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 ProtoBuf.Contract parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Contract parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Contract parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Contract parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Contract parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Contract parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Contract parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Contract parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Contract parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Contract parseFrom( - CodedInputStream input, - 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(ProtoBuf.Contract prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Contract} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.Contract, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Contract) - ProtoBuf.ContractOrBuilder { - // Construct using ProtoBuf.Contract.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - effect_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Contract getDefaultInstanceForType() { - return ProtoBuf.Contract.getDefaultInstance(); - } - - public ProtoBuf.Contract build() { - ProtoBuf.Contract result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Contract buildPartial() { - ProtoBuf.Contract result = new ProtoBuf.Contract(this); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - effect_ = java.util.Collections.unmodifiableList(effect_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.effect_ = effect_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Contract other) { - if (other == ProtoBuf.Contract.getDefaultInstance()) return this; - if (!other.effect_.isEmpty()) { - if (effect_.isEmpty()) { - effect_ = other.effect_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEffectIsMutable(); - effect_.addAll(other.effect_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getEffectCount(); i++) { - if (!getEffect(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Contract parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Contract) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List effect_ = - java.util.Collections.emptyList(); - private void ensureEffectIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - effect_ = new java.util.ArrayList(effect_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public java.util.List getEffectList() { - return java.util.Collections.unmodifiableList(effect_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public int getEffectCount() { - return effect_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public ProtoBuf.Effect getEffect(int index) { - return effect_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder setEffect( - int index, ProtoBuf.Effect value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEffectIsMutable(); - effect_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder setEffect( - int index, ProtoBuf.Effect.Builder builderForValue) { - ensureEffectIsMutable(); - effect_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder addEffect(ProtoBuf.Effect value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEffectIsMutable(); - effect_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder addEffect( - int index, ProtoBuf.Effect value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEffectIsMutable(); - effect_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder addEffect( - ProtoBuf.Effect.Builder builderForValue) { - ensureEffectIsMutable(); - effect_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder addEffect( - int index, ProtoBuf.Effect.Builder builderForValue) { - ensureEffectIsMutable(); - effect_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder addAllEffect( - java.lang.Iterable values) { - ensureEffectIsMutable(); - AbstractMessageLite.Builder.addAll( - values, effect_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder clearEffect() { - effect_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Effect effect = 1; - */ - public Builder removeEffect(int index) { - ensureEffectIsMutable(); - effect_.remove(index); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Contract) - } - - static { - defaultInstance = new Contract(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Contract) - } - - public interface EffectOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Effect) - MessageLiteOrBuilder { - - /** - * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; - */ - boolean hasEffectType(); - /** - * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; - */ - ProtoBuf.Effect.EffectType getEffectType(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - java.util.List - getEffectConstructorArgumentList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - ProtoBuf.Expression getEffectConstructorArgument(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - int getEffectConstructorArgumentCount(); - - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-     * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-     * is given by other fields in this message, and 'Expression' is stored in this field.
-     * 
- */ - boolean hasConclusionOfConditionalEffect(); - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-     * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-     * is given by other fields in this message, and 'Expression' is stored in this field.
-     * 
- */ - ProtoBuf.Expression getConclusionOfConditionalEffect(); - - /** - * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; - */ - boolean hasKind(); - /** - * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; - */ - ProtoBuf.Effect.InvocationKind getKind(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Effect} - */ - public static final class Effect extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Effect) - EffectOrBuilder { - // Use Effect.newBuilder() to construct. - private Effect(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Effect(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Effect defaultInstance; - public static Effect getDefaultInstance() { - return defaultInstance; - } - - public Effect getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Effect( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - ProtoBuf.Effect.EffectType value = ProtoBuf.Effect.EffectType.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000001; - effectType_ = value; - } - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - effectConstructorArgument_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - effectConstructorArgument_.add(input.readMessage(ProtoBuf.Expression.PARSER, extensionRegistry)); - break; - } - case 26: { - ProtoBuf.Expression.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = conclusionOfConditionalEffect_.toBuilder(); - } - conclusionOfConditionalEffect_ = input.readMessage(ProtoBuf.Expression.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(conclusionOfConditionalEffect_); - conclusionOfConditionalEffect_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 32: { - int rawValue = input.readEnum(); - ProtoBuf.Effect.InvocationKind value = ProtoBuf.Effect.InvocationKind.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000004; - kind_ = value; - } - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - effectConstructorArgument_ = java.util.Collections.unmodifiableList(effectConstructorArgument_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Effect parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Effect(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.Effect.EffectType} - * - *
-     * This enum controls which effect this message contains and how 'effectConstructorArguments'
-     * should be parsed.
-     * Each enum value documented in the following syntax: "EffectName(arg1: T1, arg2: T2, ...)"
-     * Those arguments are expected to be found in 'effectConstructorArguments' in exactly the same
-     * order and amount as defined by signature, otherwise message should be dropped.
-     * 
- */ - public enum EffectType - implements Internal.EnumLite { - /** - * RETURNS_CONSTANT = 0; - * - *
-       * Returns(value: ConstantValue?)
-       * 
- */ - RETURNS_CONSTANT(0, 0), - /** - * CALLS = 1; - * - *
-       * CallsInPlace(callable: ParameterReference)
-       * Additionally, InvocationKind in the field 'kind' may be provided to define exact amount of invocations.
-       * 
- */ - CALLS(1, 1), - /** - * RETURNS_NOT_NULL = 2; - * - *
-       * ReturnsNotNull()
-       * 
- */ - RETURNS_NOT_NULL(2, 2), - ; - - /** - * RETURNS_CONSTANT = 0; - * - *
-       * Returns(value: ConstantValue?)
-       * 
- */ - public static final int RETURNS_CONSTANT_VALUE = 0; - /** - * CALLS = 1; - * - *
-       * CallsInPlace(callable: ParameterReference)
-       * Additionally, InvocationKind in the field 'kind' may be provided to define exact amount of invocations.
-       * 
- */ - public static final int CALLS_VALUE = 1; - /** - * RETURNS_NOT_NULL = 2; - * - *
-       * ReturnsNotNull()
-       * 
- */ - public static final int RETURNS_NOT_NULL_VALUE = 2; - - - public final int getNumber() { return value; } - - public static EffectType valueOf(int value) { - switch (value) { - case 0: return RETURNS_CONSTANT; - case 1: return CALLS; - case 2: return RETURNS_NOT_NULL; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - public EffectType findValueByNumber(int number) { - return EffectType.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private EffectType(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Effect.EffectType) - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.Effect.InvocationKind} - */ - public enum InvocationKind - implements Internal.EnumLite { - /** - * AT_MOST_ONCE = 0; - */ - AT_MOST_ONCE(0, 0), - /** - * EXACTLY_ONCE = 1; - */ - EXACTLY_ONCE(1, 1), - /** - * AT_LEAST_ONCE = 2; - */ - AT_LEAST_ONCE(2, 2), - ; - - /** - * AT_MOST_ONCE = 0; - */ - public static final int AT_MOST_ONCE_VALUE = 0; - /** - * EXACTLY_ONCE = 1; - */ - public static final int EXACTLY_ONCE_VALUE = 1; - /** - * AT_LEAST_ONCE = 2; - */ - public static final int AT_LEAST_ONCE_VALUE = 2; - - - public final int getNumber() { return value; } - - public static InvocationKind valueOf(int value) { - switch (value) { - case 0: return AT_MOST_ONCE; - case 1: return EXACTLY_ONCE; - case 2: return AT_LEAST_ONCE; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - public InvocationKind findValueByNumber(int number) { - return InvocationKind.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private InvocationKind(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Effect.InvocationKind) - } - - private int bitField0_; - public static final int EFFECT_TYPE_FIELD_NUMBER = 1; - private ProtoBuf.Effect.EffectType effectType_; - /** - * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; - */ - public boolean hasEffectType() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; - */ - public ProtoBuf.Effect.EffectType getEffectType() { - return effectType_; - } - - public static final int EFFECT_CONSTRUCTOR_ARGUMENT_FIELD_NUMBER = 2; - private java.util.List effectConstructorArgument_; - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public java.util.List getEffectConstructorArgumentList() { - return effectConstructorArgument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public java.util.List - getEffectConstructorArgumentOrBuilderList() { - return effectConstructorArgument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public int getEffectConstructorArgumentCount() { - return effectConstructorArgument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public ProtoBuf.Expression getEffectConstructorArgument(int index) { - return effectConstructorArgument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public ProtoBuf.ExpressionOrBuilder getEffectConstructorArgumentOrBuilder( - int index) { - return effectConstructorArgument_.get(index); - } - - public static final int CONCLUSION_OF_CONDITIONAL_EFFECT_FIELD_NUMBER = 3; - private ProtoBuf.Expression conclusionOfConditionalEffect_; - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-     * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-     * is given by other fields in this message, and 'Expression' is stored in this field.
-     * 
- */ - public boolean hasConclusionOfConditionalEffect() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-     * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-     * is given by other fields in this message, and 'Expression' is stored in this field.
-     * 
- */ - public ProtoBuf.Expression getConclusionOfConditionalEffect() { - return conclusionOfConditionalEffect_; - } - - public static final int KIND_FIELD_NUMBER = 4; - private ProtoBuf.Effect.InvocationKind kind_; - /** - * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; - */ - public boolean hasKind() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; - */ - public ProtoBuf.Effect.InvocationKind getKind() { - return kind_; - } - - private void initFields() { - effectType_ = ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; - effectConstructorArgument_ = java.util.Collections.emptyList(); - conclusionOfConditionalEffect_ = ProtoBuf.Expression.getDefaultInstance(); - kind_ = ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getEffectConstructorArgumentCount(); i++) { - if (!getEffectConstructorArgument(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasConclusionOfConditionalEffect()) { - if (!getConclusionOfConditionalEffect().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeEnum(1, effectType_.getNumber()); - } - for (int i = 0; i < effectConstructorArgument_.size(); i++) { - output.writeMessage(2, effectConstructorArgument_.get(i)); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(3, conclusionOfConditionalEffect_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeEnum(4, kind_.getNumber()); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeEnumSize(1, effectType_.getNumber()); - } - for (int i = 0; i < effectConstructorArgument_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(2, effectConstructorArgument_.get(i)); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeMessageSize(3, conclusionOfConditionalEffect_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeEnumSize(4, kind_.getNumber()); - } - size += unknownFields.size(); - 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 ProtoBuf.Effect parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Effect parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Effect parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Effect parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Effect parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Effect parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Effect parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Effect parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Effect parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Effect parseFrom( - CodedInputStream input, - 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(ProtoBuf.Effect prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Effect} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.Effect, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Effect) - ProtoBuf.EffectOrBuilder { - // Construct using ProtoBuf.Effect.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - effectType_ = ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; - bitField0_ = (bitField0_ & ~0x00000001); - effectConstructorArgument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - conclusionOfConditionalEffect_ = ProtoBuf.Expression.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000004); - kind_ = ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Effect getDefaultInstanceForType() { - return ProtoBuf.Effect.getDefaultInstance(); - } - - public ProtoBuf.Effect build() { - ProtoBuf.Effect result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Effect buildPartial() { - ProtoBuf.Effect result = new ProtoBuf.Effect(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.effectType_ = effectType_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - effectConstructorArgument_ = java.util.Collections.unmodifiableList(effectConstructorArgument_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.effectConstructorArgument_ = effectConstructorArgument_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000002; - } - result.conclusionOfConditionalEffect_ = conclusionOfConditionalEffect_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000004; - } - result.kind_ = kind_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Effect other) { - if (other == ProtoBuf.Effect.getDefaultInstance()) return this; - if (other.hasEffectType()) { - setEffectType(other.getEffectType()); - } - if (!other.effectConstructorArgument_.isEmpty()) { - if (effectConstructorArgument_.isEmpty()) { - effectConstructorArgument_ = other.effectConstructorArgument_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureEffectConstructorArgumentIsMutable(); - effectConstructorArgument_.addAll(other.effectConstructorArgument_); - } - - } - if (other.hasConclusionOfConditionalEffect()) { - mergeConclusionOfConditionalEffect(other.getConclusionOfConditionalEffect()); - } - if (other.hasKind()) { - setKind(other.getKind()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getEffectConstructorArgumentCount(); i++) { - if (!getEffectConstructorArgument(i).isInitialized()) { - - return false; - } - } - if (hasConclusionOfConditionalEffect()) { - if (!getConclusionOfConditionalEffect().isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Effect parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Effect) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private ProtoBuf.Effect.EffectType effectType_ = ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; - /** - * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; - */ - public boolean hasEffectType() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; - */ - public ProtoBuf.Effect.EffectType getEffectType() { - return effectType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; - */ - public Builder setEffectType(ProtoBuf.Effect.EffectType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - effectType_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Effect.EffectType effect_type = 1; - */ - public Builder clearEffectType() { - bitField0_ = (bitField0_ & ~0x00000001); - effectType_ = ProtoBuf.Effect.EffectType.RETURNS_CONSTANT; - - return this; - } - - private java.util.List effectConstructorArgument_ = - java.util.Collections.emptyList(); - private void ensureEffectConstructorArgumentIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - effectConstructorArgument_ = new java.util.ArrayList(effectConstructorArgument_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public java.util.List getEffectConstructorArgumentList() { - return java.util.Collections.unmodifiableList(effectConstructorArgument_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public int getEffectConstructorArgumentCount() { - return effectConstructorArgument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public ProtoBuf.Expression getEffectConstructorArgument(int index) { - return effectConstructorArgument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder setEffectConstructorArgument( - int index, ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEffectConstructorArgumentIsMutable(); - effectConstructorArgument_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder setEffectConstructorArgument( - int index, ProtoBuf.Expression.Builder builderForValue) { - ensureEffectConstructorArgumentIsMutable(); - effectConstructorArgument_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder addEffectConstructorArgument(ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEffectConstructorArgumentIsMutable(); - effectConstructorArgument_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder addEffectConstructorArgument( - int index, ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEffectConstructorArgumentIsMutable(); - effectConstructorArgument_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder addEffectConstructorArgument( - ProtoBuf.Expression.Builder builderForValue) { - ensureEffectConstructorArgumentIsMutable(); - effectConstructorArgument_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder addEffectConstructorArgument( - int index, ProtoBuf.Expression.Builder builderForValue) { - ensureEffectConstructorArgumentIsMutable(); - effectConstructorArgument_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder addAllEffectConstructorArgument( - java.lang.Iterable values) { - ensureEffectConstructorArgumentIsMutable(); - AbstractMessageLite.Builder.addAll( - values, effectConstructorArgument_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder clearEffectConstructorArgument() { - effectConstructorArgument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression effect_constructor_argument = 2; - */ - public Builder removeEffectConstructorArgument(int index) { - ensureEffectConstructorArgumentIsMutable(); - effectConstructorArgument_.remove(index); - - return this; - } - - private ProtoBuf.Expression conclusionOfConditionalEffect_ = ProtoBuf.Expression.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-       * is given by other fields in this message, and 'Expression' is stored in this field.
-       * 
- */ - public boolean hasConclusionOfConditionalEffect() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-       * is given by other fields in this message, and 'Expression' is stored in this field.
-       * 
- */ - public ProtoBuf.Expression getConclusionOfConditionalEffect() { - return conclusionOfConditionalEffect_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-       * is given by other fields in this message, and 'Expression' is stored in this field.
-       * 
- */ - public Builder setConclusionOfConditionalEffect(ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - conclusionOfConditionalEffect_ = value; - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-       * is given by other fields in this message, and 'Expression' is stored in this field.
-       * 
- */ - public Builder setConclusionOfConditionalEffect( - ProtoBuf.Expression.Builder builderForValue) { - conclusionOfConditionalEffect_ = builderForValue.build(); - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-       * is given by other fields in this message, and 'Expression' is stored in this field.
-       * 
- */ - public Builder mergeConclusionOfConditionalEffect(ProtoBuf.Expression value) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - conclusionOfConditionalEffect_ != ProtoBuf.Expression.getDefaultInstance()) { - conclusionOfConditionalEffect_ = - ProtoBuf.Expression.newBuilder(conclusionOfConditionalEffect_).mergeFrom(value).buildPartial(); - } else { - conclusionOfConditionalEffect_ = value; - } - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression conclusion_of_conditional_effect = 3; - * - *
-       * If present, then whole message is clause of form 'Effect -> Expression', where 'Effect'
-       * is given by other fields in this message, and 'Expression' is stored in this field.
-       * 
- */ - public Builder clearConclusionOfConditionalEffect() { - conclusionOfConditionalEffect_ = ProtoBuf.Expression.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - private ProtoBuf.Effect.InvocationKind kind_ = ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; - /** - * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; - */ - public boolean hasKind() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; - */ - public ProtoBuf.Effect.InvocationKind getKind() { - return kind_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; - */ - public Builder setKind(ProtoBuf.Effect.InvocationKind value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - kind_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Effect.InvocationKind kind = 4; - */ - public Builder clearKind() { - bitField0_ = (bitField0_ & ~0x00000008); - kind_ = ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Effect) - } - - static { - defaultInstance = new Effect(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Effect) - } - - public interface ExpressionOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.Expression) - MessageLiteOrBuilder { - - /** - * optional int32 flags = 1 [default = 0]; - * - *
-     *isNegated => this expression should be negated
-     *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
-     * 
- */ - boolean hasFlags(); - /** - * optional int32 flags = 1 [default = 0]; - * - *
-     *isNegated => this expression should be negated
-     *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
-     * 
- */ - int getFlags(); - - /** - * optional int32 value_parameter_reference = 2; - * - *
-     * stored as index in valueParameters list of owner-function in 1-indexation
-     * Index '0' is reserved for extension receiver
-     * 
- */ - boolean hasValueParameterReference(); - /** - * optional int32 value_parameter_reference = 2; - * - *
-     * stored as index in valueParameters list of owner-function in 1-indexation
-     * Index '0' is reserved for extension receiver
-     * 
- */ - int getValueParameterReference(); - - /** - * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; - */ - boolean hasConstantValue(); - /** - * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; - */ - ProtoBuf.Expression.ConstantValue getConstantValue(); - - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-     * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-     * and with type encoded in either one of next two fields as RHS.
-     * 
- */ - boolean hasIsInstanceType(); - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-     * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-     * and with type encoded in either one of next two fields as RHS.
-     * 
- */ - ProtoBuf.Type getIsInstanceType(); - - /** - * optional int32 is_instance_type_id = 5; - */ - boolean hasIsInstanceTypeId(); - /** - * optional int32 is_instance_type_id = 5; - */ - int getIsInstanceTypeId(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message
-     * 
- */ - java.util.List - getAndArgumentList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message
-     * 
- */ - ProtoBuf.Expression getAndArgument(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message
-     * 
- */ - int getAndArgumentCount(); - - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message.
-     * 
- */ - java.util.List - getOrArgumentList(); - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message.
-     * 
- */ - ProtoBuf.Expression getOrArgument(int index); - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message.
-     * 
- */ - int getOrArgumentCount(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Expression} - * - *
-   * We use some trickery to optimize memory footprint of contract-expressions:
-   * exact type of Expression is determined based on its contents.
-   * 
- */ - public static final class Expression extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.Expression) - ExpressionOrBuilder { - // Use Expression.newBuilder() to construct. - private Expression(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Expression(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Expression defaultInstance; - public static Expression getDefaultInstance() { - return defaultInstance; - } - - public Expression getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Expression( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - flags_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - valueParameterReference_ = input.readInt32(); - break; - } - case 24: { - int rawValue = input.readEnum(); - ProtoBuf.Expression.ConstantValue value = ProtoBuf.Expression.ConstantValue.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000004; - constantValue_ = value; - } - break; - } - case 34: { - ProtoBuf.Type.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - subBuilder = isInstanceType_.toBuilder(); - } - isInstanceType_ = input.readMessage(ProtoBuf.Type.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(isInstanceType_); - isInstanceType_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000008; - break; - } - case 40: { - bitField0_ |= 0x00000010; - isInstanceTypeId_ = input.readInt32(); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - andArgument_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - andArgument_.add(input.readMessage(ProtoBuf.Expression.PARSER, extensionRegistry)); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - orArgument_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - orArgument_.add(input.readMessage(ProtoBuf.Expression.PARSER, extensionRegistry)); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - andArgument_ = java.util.Collections.unmodifiableList(andArgument_); - } - if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - orArgument_ = java.util.Collections.unmodifiableList(orArgument_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - public Expression parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Expression(input, extensionRegistry); - } - }; - - @java.lang.Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.Expression.ConstantValue} - */ - public enum ConstantValue - implements Internal.EnumLite { - /** - * TRUE = 0; - */ - TRUE(0, 0), - /** - * FALSE = 1; - */ - FALSE(1, 1), - /** - * NULL = 2; - */ - NULL(2, 2), - ; - - /** - * TRUE = 0; - */ - public static final int TRUE_VALUE = 0; - /** - * FALSE = 1; - */ - public static final int FALSE_VALUE = 1; - /** - * NULL = 2; - */ - public static final int NULL_VALUE = 2; - - - public final int getNumber() { return value; } - - public static ConstantValue valueOf(int value) { - switch (value) { - case 0: return TRUE; - case 1: return FALSE; - case 2: return NULL; - default: return null; - } - } - - public static Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - public ConstantValue findValueByNumber(int number) { - return ConstantValue.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private ConstantValue(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.Expression.ConstantValue) - } - - private int bitField0_; - public static final int FLAGS_FIELD_NUMBER = 1; - private int flags_; - /** - * optional int32 flags = 1 [default = 0]; - * - *
-     *isNegated => this expression should be negated
-     *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
-     * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 0]; - * - *
-     *isNegated => this expression should be negated
-     *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
-     * 
- */ - public int getFlags() { - return flags_; - } - - public static final int VALUE_PARAMETER_REFERENCE_FIELD_NUMBER = 2; - private int valueParameterReference_; - /** - * optional int32 value_parameter_reference = 2; - * - *
-     * stored as index in valueParameters list of owner-function in 1-indexation
-     * Index '0' is reserved for extension receiver
-     * 
- */ - public boolean hasValueParameterReference() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 value_parameter_reference = 2; - * - *
-     * stored as index in valueParameters list of owner-function in 1-indexation
-     * Index '0' is reserved for extension receiver
-     * 
- */ - public int getValueParameterReference() { - return valueParameterReference_; - } - - public static final int CONSTANT_VALUE_FIELD_NUMBER = 3; - private ProtoBuf.Expression.ConstantValue constantValue_; - /** - * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; - */ - public boolean hasConstantValue() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; - */ - public ProtoBuf.Expression.ConstantValue getConstantValue() { - return constantValue_; - } - - public static final int IS_INSTANCE_TYPE_FIELD_NUMBER = 4; - private ProtoBuf.Type isInstanceType_; - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-     * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-     * and with type encoded in either one of next two fields as RHS.
-     * 
- */ - public boolean hasIsInstanceType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-     * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-     * and with type encoded in either one of next two fields as RHS.
-     * 
- */ - public ProtoBuf.Type getIsInstanceType() { - return isInstanceType_; - } - - public static final int IS_INSTANCE_TYPE_ID_FIELD_NUMBER = 5; - private int isInstanceTypeId_; - /** - * optional int32 is_instance_type_id = 5; - */ - public boolean hasIsInstanceTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 is_instance_type_id = 5; - */ - public int getIsInstanceTypeId() { - return isInstanceTypeId_; - } - - public static final int AND_ARGUMENT_FIELD_NUMBER = 6; - private java.util.List andArgument_; - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message
-     * 
- */ - public java.util.List getAndArgumentList() { - return andArgument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message
-     * 
- */ - public java.util.List - getAndArgumentOrBuilderList() { - return andArgument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message
-     * 
- */ - public int getAndArgumentCount() { - return andArgument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message
-     * 
- */ - public ProtoBuf.Expression getAndArgument(int index) { - return andArgument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-     * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message
-     * 
- */ - public ProtoBuf.ExpressionOrBuilder getAndArgumentOrBuilder( - int index) { - return andArgument_.get(index); - } - - public static final int OR_ARGUMENT_FIELD_NUMBER = 7; - private java.util.List orArgument_; - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message.
-     * 
- */ - public java.util.List getOrArgumentList() { - return orArgument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message.
-     * 
- */ - public java.util.List - getOrArgumentOrBuilderList() { - return orArgument_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message.
-     * 
- */ - public int getOrArgumentCount() { - return orArgument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message.
-     * 
- */ - public ProtoBuf.Expression getOrArgument(int index) { - return orArgument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-     * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-     * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-     * it is optimized and embedded straight into this message.
-     * 
- */ - public ProtoBuf.ExpressionOrBuilder getOrArgumentOrBuilder( - int index) { - return orArgument_.get(index); - } - - private void initFields() { - flags_ = 0; - valueParameterReference_ = 0; - constantValue_ = ProtoBuf.Expression.ConstantValue.TRUE; - isInstanceType_ = ProtoBuf.Type.getDefaultInstance(); - isInstanceTypeId_ = 0; - andArgument_ = java.util.Collections.emptyList(); - orArgument_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (hasIsInstanceType()) { - if (!getIsInstanceType().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getAndArgumentCount(); i++) { - if (!getAndArgument(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getOrArgumentCount(); i++) { - if (!getOrArgument(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, flags_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, valueParameterReference_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeEnum(3, constantValue_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(4, isInstanceType_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(5, isInstanceTypeId_); - } - for (int i = 0; i < andArgument_.size(); i++) { - output.writeMessage(6, andArgument_.get(i)); - } - for (int i = 0; i < orArgument_.size(); i++) { - output.writeMessage(7, orArgument_.get(i)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, flags_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(2, valueParameterReference_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeEnumSize(3, constantValue_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeMessageSize(4, isInstanceType_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += CodedOutputStream - .computeInt32Size(5, isInstanceTypeId_); - } - for (int i = 0; i < andArgument_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(6, andArgument_.get(i)); - } - for (int i = 0; i < orArgument_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(7, orArgument_.get(i)); - } - size += unknownFields.size(); - 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 ProtoBuf.Expression parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Expression parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Expression parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ProtoBuf.Expression parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ProtoBuf.Expression parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Expression parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static ProtoBuf.Expression parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static ProtoBuf.Expression parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static ProtoBuf.Expression parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static ProtoBuf.Expression parseFrom( - CodedInputStream input, - 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(ProtoBuf.Expression prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.Expression} - * - *
-     * We use some trickery to optimize memory footprint of contract-expressions:
-     * exact type of Expression is determined based on its contents.
-     * 
- */ - public static final class Builder extends - GeneratedMessageLite.Builder< - ProtoBuf.Expression, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.Expression) - ProtoBuf.ExpressionOrBuilder { - // Construct using ProtoBuf.Expression.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - flags_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - valueParameterReference_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - constantValue_ = ProtoBuf.Expression.ConstantValue.TRUE; - bitField0_ = (bitField0_ & ~0x00000004); - isInstanceType_ = ProtoBuf.Type.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - isInstanceTypeId_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - andArgument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - orArgument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public ProtoBuf.Expression getDefaultInstanceForType() { - return ProtoBuf.Expression.getDefaultInstance(); - } - - public ProtoBuf.Expression build() { - ProtoBuf.Expression result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public ProtoBuf.Expression buildPartial() { - ProtoBuf.Expression result = new ProtoBuf.Expression(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.flags_ = flags_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.valueParameterReference_ = valueParameterReference_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.constantValue_ = constantValue_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.isInstanceType_ = isInstanceType_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.isInstanceTypeId_ = isInstanceTypeId_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - andArgument_ = java.util.Collections.unmodifiableList(andArgument_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.andArgument_ = andArgument_; - if (((bitField0_ & 0x00000040) == 0x00000040)) { - orArgument_ = java.util.Collections.unmodifiableList(orArgument_); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.orArgument_ = orArgument_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(ProtoBuf.Expression other) { - if (other == ProtoBuf.Expression.getDefaultInstance()) return this; - if (other.hasFlags()) { - setFlags(other.getFlags()); - } - if (other.hasValueParameterReference()) { - setValueParameterReference(other.getValueParameterReference()); - } - if (other.hasConstantValue()) { - setConstantValue(other.getConstantValue()); - } - if (other.hasIsInstanceType()) { - mergeIsInstanceType(other.getIsInstanceType()); - } - if (other.hasIsInstanceTypeId()) { - setIsInstanceTypeId(other.getIsInstanceTypeId()); - } - if (!other.andArgument_.isEmpty()) { - if (andArgument_.isEmpty()) { - andArgument_ = other.andArgument_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureAndArgumentIsMutable(); - andArgument_.addAll(other.andArgument_); - } - - } - if (!other.orArgument_.isEmpty()) { - if (orArgument_.isEmpty()) { - orArgument_ = other.orArgument_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureOrArgumentIsMutable(); - orArgument_.addAll(other.orArgument_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (hasIsInstanceType()) { - if (!getIsInstanceType().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getAndArgumentCount(); i++) { - if (!getAndArgument(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getOrArgumentCount(); i++) { - if (!getOrArgument(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ProtoBuf.Expression parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (ProtoBuf.Expression) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int flags_ ; - /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *isNegated => this expression should be negated
-       *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
-       * 
- */ - public boolean hasFlags() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *isNegated => this expression should be negated
-       *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
-       * 
- */ - public int getFlags() { - return flags_; - } - /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *isNegated => this expression should be negated
-       *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
-       * 
- */ - public Builder setFlags(int value) { - bitField0_ |= 0x00000001; - flags_ = value; - - return this; - } - /** - * optional int32 flags = 1 [default = 0]; - * - *
-       *isNegated => this expression should be negated
-       *isIsNullPredicate => this expression is IsNullPredicate with 'variableName' as argument
-       * 
- */ - public Builder clearFlags() { - bitField0_ = (bitField0_ & ~0x00000001); - flags_ = 0; - - return this; - } - - private int valueParameterReference_ ; - /** - * optional int32 value_parameter_reference = 2; - * - *
-       * stored as index in valueParameters list of owner-function in 1-indexation
-       * Index '0' is reserved for extension receiver
-       * 
- */ - public boolean hasValueParameterReference() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 value_parameter_reference = 2; - * - *
-       * stored as index in valueParameters list of owner-function in 1-indexation
-       * Index '0' is reserved for extension receiver
-       * 
- */ - public int getValueParameterReference() { - return valueParameterReference_; - } - /** - * optional int32 value_parameter_reference = 2; - * - *
-       * stored as index in valueParameters list of owner-function in 1-indexation
-       * Index '0' is reserved for extension receiver
-       * 
- */ - public Builder setValueParameterReference(int value) { - bitField0_ |= 0x00000002; - valueParameterReference_ = value; - - return this; - } - /** - * optional int32 value_parameter_reference = 2; - * - *
-       * stored as index in valueParameters list of owner-function in 1-indexation
-       * Index '0' is reserved for extension receiver
-       * 
- */ - public Builder clearValueParameterReference() { - bitField0_ = (bitField0_ & ~0x00000002); - valueParameterReference_ = 0; - - return this; - } - - private ProtoBuf.Expression.ConstantValue constantValue_ = ProtoBuf.Expression.ConstantValue.TRUE; - /** - * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; - */ - public boolean hasConstantValue() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; - */ - public ProtoBuf.Expression.ConstantValue getConstantValue() { - return constantValue_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; - */ - public Builder setConstantValue(ProtoBuf.Expression.ConstantValue value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - constantValue_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Expression.ConstantValue constant_value = 3; - */ - public Builder clearConstantValue() { - bitField0_ = (bitField0_ & ~0x00000004); - constantValue_ = ProtoBuf.Expression.ConstantValue.TRUE; - - return this; - } - - private ProtoBuf.Type isInstanceType_ = ProtoBuf.Type.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-       * and with type encoded in either one of next two fields as RHS.
-       * 
- */ - public boolean hasIsInstanceType() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-       * and with type encoded in either one of next two fields as RHS.
-       * 
- */ - public ProtoBuf.Type getIsInstanceType() { - return isInstanceType_; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-       * and with type encoded in either one of next two fields as RHS.
-       * 
- */ - public Builder setIsInstanceType(ProtoBuf.Type value) { - if (value == null) { - throw new NullPointerException(); - } - isInstanceType_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-       * and with type encoded in either one of next two fields as RHS.
-       * 
- */ - public Builder setIsInstanceType( - ProtoBuf.Type.Builder builderForValue) { - isInstanceType_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-       * and with type encoded in either one of next two fields as RHS.
-       * 
- */ - public Builder mergeIsInstanceType(ProtoBuf.Type value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - isInstanceType_ != ProtoBuf.Type.getDefaultInstance()) { - isInstanceType_ = - ProtoBuf.Type.newBuilder(isInstanceType_).mergeFrom(value).buildPartial(); - } else { - isInstanceType_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.Type is_instance_type = 4; - * - *
-       * present => this expression is IsInstancePredicate,  with 'variableName' as LHS
-       * and with type encoded in either one of next two fields as RHS.
-       * 
- */ - public Builder clearIsInstanceType() { - isInstanceType_ = ProtoBuf.Type.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private int isInstanceTypeId_ ; - /** - * optional int32 is_instance_type_id = 5; - */ - public boolean hasIsInstanceTypeId() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 is_instance_type_id = 5; - */ - public int getIsInstanceTypeId() { - return isInstanceTypeId_; - } - /** - * optional int32 is_instance_type_id = 5; - */ - public Builder setIsInstanceTypeId(int value) { - bitField0_ |= 0x00000010; - isInstanceTypeId_ = value; - - return this; - } - /** - * optional int32 is_instance_type_id = 5; - */ - public Builder clearIsInstanceTypeId() { - bitField0_ = (bitField0_ & ~0x00000010); - isInstanceTypeId_ = 0; - - return this; - } - - private java.util.List andArgument_ = - java.util.Collections.emptyList(); - private void ensureAndArgumentIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - andArgument_ = new java.util.ArrayList(andArgument_); - bitField0_ |= 0x00000020; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public java.util.List getAndArgumentList() { - return java.util.Collections.unmodifiableList(andArgument_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public int getAndArgumentCount() { - return andArgument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public ProtoBuf.Expression getAndArgument(int index) { - return andArgument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder setAndArgument( - int index, ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAndArgumentIsMutable(); - andArgument_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder setAndArgument( - int index, ProtoBuf.Expression.Builder builderForValue) { - ensureAndArgumentIsMutable(); - andArgument_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder addAndArgument(ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAndArgumentIsMutable(); - andArgument_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder addAndArgument( - int index, ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAndArgumentIsMutable(); - andArgument_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder addAndArgument( - ProtoBuf.Expression.Builder builderForValue) { - ensureAndArgumentIsMutable(); - andArgument_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder addAndArgument( - int index, ProtoBuf.Expression.Builder builderForValue) { - ensureAndArgumentIsMutable(); - andArgument_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder addAllAndArgument( - java.lang.Iterable values) { - ensureAndArgumentIsMutable(); - AbstractMessageLite.Builder.addAll( - values, andArgument_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder clearAndArgument() { - andArgument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression and_argument = 6; - * - *
-       * non-empty => this expression is boolean formula of form 'andArguments[0] && andArguments[1] && ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message
-       * 
- */ - public Builder removeAndArgument(int index) { - ensureAndArgumentIsMutable(); - andArgument_.remove(index); - - return this; - } - - private java.util.List orArgument_ = - java.util.Collections.emptyList(); - private void ensureOrArgumentIsMutable() { - if (!((bitField0_ & 0x00000040) == 0x00000040)) { - orArgument_ = new java.util.ArrayList(orArgument_); - bitField0_ |= 0x00000040; - } - } - - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public java.util.List getOrArgumentList() { - return java.util.Collections.unmodifiableList(orArgument_); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public int getOrArgumentCount() { - return orArgument_.size(); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public ProtoBuf.Expression getOrArgument(int index) { - return orArgument_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder setOrArgument( - int index, ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOrArgumentIsMutable(); - orArgument_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder setOrArgument( - int index, ProtoBuf.Expression.Builder builderForValue) { - ensureOrArgumentIsMutable(); - orArgument_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder addOrArgument(ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOrArgumentIsMutable(); - orArgument_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder addOrArgument( - int index, ProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOrArgumentIsMutable(); - orArgument_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder addOrArgument( - ProtoBuf.Expression.Builder builderForValue) { - ensureOrArgumentIsMutable(); - orArgument_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder addOrArgument( - int index, ProtoBuf.Expression.Builder builderForValue) { - ensureOrArgumentIsMutable(); - orArgument_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder addAllOrArgument( - java.lang.Iterable values) { - ensureOrArgumentIsMutable(); - AbstractMessageLite.Builder.addAll( - values, orArgument_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder clearOrArgument() { - orArgument_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.metadata.Expression or_argument = 7; - * - *
-       * non-empty => this expression is boolean formula of form 'orArguments[0] || andArguments[1] || ...'
-       * Additionally, if first argument of formula is primitive expression (i.e. predicate or value),
-       * it is optimized and embedded straight into this message.
-       * 
- */ - public Builder removeOrArgument(int index) { - ensureOrArgumentIsMutable(); - orArgument_.remove(index); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.Expression) - } - - static { - defaultInstance = new Expression(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.Expression) - } - - - static { - } - - // @@protoc_insertion_point(outer_class_scope) -} \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/BitEncoding.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java similarity index 96% rename from retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/BitEncoding.java rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java index 1bd00e4b5e..db32eabd1b 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/BitEncoding.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java @@ -3,11 +3,12 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package retrofit2.kotlin.metadata.jvm.deserialization; +package retrofit2.kotlin.metadata.deserialization; import org.jetbrains.annotations.NotNull; -import static retrofit2.kotlin.metadata.jvm.deserialization.UtfEncodingKt.MAX_UTF8_INFO_LENGTH; +import static retrofit2.kotlin.metadata.deserialization.UtfEncodingKt.MAX_UTF8_INFO_LENGTH; + public class BitEncoding { diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Flags.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Flags.java deleted file mode 100644 index 38a34a926e..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Flags.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlin.metadata.deserialization; - -import org.jetbrains.annotations.NotNull; - -public class Flags { - protected Flags() {} - - // Infrastructure - - public static abstract class FlagField { - - public final int offset; - public final int bitWidth; - - private FlagField(int offset, int bitWidth) { - this.offset = offset; - this.bitWidth = bitWidth; - } - - public abstract E get(int flags); - } - - @SuppressWarnings("WeakerAccess") - public static class BooleanFlagField extends FlagField { - public BooleanFlagField(int offset) { - super(offset, 1); - } - - @Override - @NotNull - public Boolean get(int flags) { - return (flags & (1 << offset)) != 0; - } - - public int invert(int flags) { return (flags ^ (1 << offset)); } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt similarity index 96% rename from retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt index 0f28d118b8..51153483d9 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package retrofit2.kotlin.metadata.jvm.deserialization +package retrofit2.kotlin.metadata.deserialization import retrofit2.kotlin.metadata.deserialization.BinaryVersion diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt new file mode 100644 index 0000000000..229480f8c6 --- /dev/null +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt @@ -0,0 +1,193 @@ +package retrofit2.kotlin.metadata.deserialization + +import retrofit2.KotlinMetadata +import java.io.ByteArrayInputStream + +class MetadataParser(val strings: Array, val input: ByteArrayInputStream) { + + data class Record(val range: Int, val predefinedIndex: Int, val operation: Int) + + companion object { + private 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/collections/Iterable", "kotlin/collections/MutableIterable", + "kotlin/collections/Collection", "kotlin/collections/MutableCollection", + "kotlin/collections/List", "kotlin/collections/MutableList", + "kotlin/collections/Set", "kotlin/collections/MutableSet", + "kotlin/collections/Map", "kotlin/collections/MutableMap", + "kotlin/collections/Map.Entry", "kotlin/collections/MutableMap.MutableEntry", + + "kotlin/collections/Iterator", "kotlin/collections/MutableIterator", + "kotlin/collections/ListIterator", "kotlin/collections/MutableListIterator" + ) + } + + private val records = parseStringTableTypes() + + fun parseClass(): List { + val functions = mutableListOf() + while (true) { + val tag = input.readTag() + if (tag == 0) break + + val field = tag ushr 3 + val wire = tag and 7 + when (field) { + 9 -> { functions += parseFunction() } + else -> { input.skipProto(wire) } + } + } + + return functions + } + + private fun parseFunction(): KotlinMetadata.Function { + lateinit var returnType: KotlinMetadata.ReturnType + lateinit var name: String + lateinit var signature: Signature + + input.readMessage { field, wire -> + when (field) { + 2 -> { + val nameIndex = input.readRawVarint32() + name = getString(nameIndex) + } + 3 -> { + returnType = parseReturnType() + } + 100 -> { + signature = parseSignature() + } + else -> { input.skipProto(wire) } + } + } + + val actualName = if (signature.nameIndex != -1) getString(signature.nameIndex) else name + return KotlinMetadata.Function(actualName + signature.desc, returnType) + } + + private fun parseReturnType(): KotlinMetadata.ReturnType { + var nullable = false + lateinit var name: String + + input.readMessage { field, wire -> + when (field) { + 3 -> { + nullable = input.readRawVarint32() != 0 + } + 6 -> { + val nameIndex = input.readRawVarint32() + name = getString(nameIndex) + } + else -> input.skipProto(wire) + } + } + + return KotlinMetadata.ReturnType(nullable, name == "kotlin/Unit") + } + + data class Signature(val nameIndex: Int, val desc: String) + + private fun parseSignature(): Signature { + var nameIndex = -1 + var desc = "" + input.readMessage { field, wireType -> + when (field) { + 1 -> { + nameIndex = input.readRawVarint32() + } + 2 -> { + desc = getString(input.readRawVarint32()) + } + else -> input.skipProto(wireType) + } + } + + return Signature(nameIndex, desc) + } + + private fun parseStringTableTypes(): List { + val records = mutableListOf() + input.readMessage { field, wireType -> + when (field) { + 1 -> { + val record = parseRecord() + repeat(record.range) { records += record } + } + else -> { input.skipProto(wireType) } + } + } + + return records + } + + private fun parseRecord(): Record { + var range = 1 + var operation = 0 + var predefinedIndex = -1 + + input.readMessage { field, wireType -> + when (field) { + 1 -> { + range = input.readRawVarint32() + } + 2 -> { + predefinedIndex = input.readRawVarint32() + } + 3 -> { + operation = input.readRawVarint32() + } + else -> { input.skipProto(wireType) } + } + } + + return Record(range, predefinedIndex, operation) + } + + private fun getString(index: Int): String { + val record = records[index] + + var string = when { + record.predefinedIndex != -1 && record.predefinedIndex in PREDEFINED_STRINGS.indices -> + PREDEFINED_STRINGS[record.predefinedIndex] + else -> strings[index] + } + + when (record.operation) { + 0 -> { + // Do nothing + } + 1 -> { + string = string.replace('$', '.') + } + 2 -> { + if (string.length >= 2) { + string = string.substring(1, string.length - 1) + } + string = string.replace('$', '.') + } + } + + return string + } +} \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/NameResolver.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/NameResolver.kt deleted file mode 100644 index 77c78a759d..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/NameResolver.kt +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlin.metadata.deserialization - -interface NameResolver { - fun getString(index: Int): String - - /** - * @return the fully qualified name of some class in the format: `org/foo/bar/Test.Inner` - */ - fun getQualifiedClassName(index: Int): String - - fun isLocalClassName(index: Int): Boolean -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtoBufUtil.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtoBufUtil.kt deleted file mode 100644 index 7a78243a69..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtoBufUtil.kt +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlin.metadata.deserialization - -import retrofit2.kotlin.protobuf.GeneratedMessageLite - -fun , T> GeneratedMessageLite.ExtendableMessage.getExtensionOrNull( - extension: GeneratedMessageLite.GeneratedExtension -): T? = if (hasExtension(extension)) getExtension(extension) else null diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt new file mode 100644 index 0000000000..2a280b6251 --- /dev/null +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt @@ -0,0 +1,95 @@ +package retrofit2.kotlin.metadata.deserialization + +import java.io.ByteArrayInputStream + +fun ByteArrayInputStream.skipProto(wire: Int) { + when (wire) { + 0 -> readRawVarint32() + 1 -> skip(8L) + 2 -> skip(readRawVarint32().toLong()) + 5 -> skip(4L) + else -> throw IllegalStateException("Invalid wire type: $wire") + } +} + +inline fun ByteArrayInputStream.readMessage(block: (Int, Int) -> Unit) { + val size = readRawVarint32() + + val start = available() + while (true) { + if (start - available() >= size) break + + val tag = readTag() + if (tag == 0) break + + val wire = tag and 7 + val field = tag ushr 3 + block(field, wire) + } +} + +fun ByteArrayInputStream.readTag(): Int { + if (available() == 0) { + return 0 + } + + val result = readRawVarint32() + if (result ushr 3 == 0) { + // If we actually read zero (or any tag number corresponding to field + // number zero), that's not a valid tag. + throw IllegalStateException("Invalid tag") + } + return result +} + +fun ByteArrayInputStream.readRawVarint32(): Int { + // See implementation notes for readRawVarint64 + fastpath@while (true) { + if (available() == 0) { + reset() + break@fastpath + } + mark(0) + var x: Int + if (readByte().also { x = it.toInt() } >= 0) { + return x + } else if (available() < 9) { + reset() + break@fastpath + } else if ((readByte().toInt() shl 7).let { x = x xor it; x } < 0L) { + x = x xor (0L.inv() shl 7).toInt() + } else if ((readByte().toInt() shl 14).let { x = x xor it; x } >= 0L) { + x = x xor (0L.inv() shl 7 xor (0L.inv() shl 14)).toInt() + } else if ((readByte().toInt() shl 21).let { x = x xor it; x } < 0L) { + x = x xor (0L.inv() shl 7 xor (0L.inv() shl 14) xor (0L.inv() shl 21)).toInt() + } else { + val y = readByte().toInt() + x = x xor (y shl 28) + x = x xor (0L.inv() shl 7 xor (0L.inv() shl 14) xor (0L.inv() shl 21) xor (0L.inv() shl 28)).toInt() + if (y < 0 && readByte() < 0 && readByte() < 0 && readByte() < 0 && readByte() < 0 && readByte() < 0) { + reset() + break@fastpath // Will throw malformedVarint() + } + } + return x + } + + return readRawVarint64SlowPath().toInt() +} + + +fun ByteArrayInputStream.readRawVarint64SlowPath(): Long { + var result: Long = 0 + var shift = 0 + while (shift < 64) { + val b = read().toLong() + result = result or ((b and 0x7F) shl shift) + if ((b and 0x80) == 0L) { + return result + } + shift += 7 + } + throw IllegalStateException("Malformed varint") +} + +fun ByteArrayInputStream.readByte(): Byte = read().toByte() \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/TypeTable.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/TypeTable.kt deleted file mode 100644 index 47965db40b..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/TypeTable.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 retrofit2.kotlin.metadata.deserialization - -import retrofit2.kotlin.metadata.ProtoBuf - -class TypeTable(typeTable: ProtoBuf.TypeTable) { - val types: List = run { - val originalTypes = typeTable.typeList - if (typeTable.hasFirstNullable()) { - val firstNullable = typeTable.firstNullable - typeTable.typeList.mapIndexed { i, type -> - if (i >= firstNullable) { - type.toBuilder().setNullable(true).build() - } else type - } - } else originalTypes - } - - operator fun get(index: Int) = types[index] -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/VersionRequirement.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/VersionRequirement.kt deleted file mode 100644 index 6dfa40f9a4..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/VersionRequirement.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlin.metadata.deserialization - -import retrofit2.kotlin.metadata.ProtoBuf - -class VersionRequirementTable private constructor(private val infos: List) { - operator fun get(id: Int): ProtoBuf.VersionRequirement? = infos.getOrNull(id) - - companion object { - val EMPTY = VersionRequirementTable(emptyList()) - - fun create(table: ProtoBuf.VersionRequirementTable): VersionRequirementTable = - if (table.requirementCount == 0) EMPTY else VersionRequirementTable( - table.requirementList - ) - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/protoTypeTableUtil.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/protoTypeTableUtil.kt deleted file mode 100644 index be46dea253..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/protoTypeTableUtil.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 retrofit2.kotlin.metadata.deserialization - -import retrofit2.kotlin.metadata.ProtoBuf - -fun ProtoBuf.Function.returnType(typeTable: TypeTable): ProtoBuf.Type = when { - hasReturnType() -> returnType - hasReturnTypeId() -> typeTable[returnTypeId] - else -> error("No returnType in ProtoBuf.Function") -} - -fun ProtoBuf.Function.receiverType(typeTable: TypeTable): ProtoBuf.Type? = when { - hasReceiverType() -> receiverType - hasReceiverTypeId() -> typeTable[receiverTypeId] - else -> null -} - -fun ProtoBuf.ValueParameter.type(typeTable: TypeTable): ProtoBuf.Type = when { - hasType() -> type - hasTypeId() -> typeTable[typeId] - else -> error("No type in ProtoBuf.ValueParameter") -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/utfEncoding.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt similarity index 95% rename from retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/utfEncoding.kt rename to retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt index dc65a388e2..680be1ae2d 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/utfEncoding.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package retrofit2.kotlin.metadata.jvm.deserialization +package retrofit2.kotlin.metadata.deserialization import java.util.* diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/JvmProtoBuf.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/JvmProtoBuf.java deleted file mode 100644 index 6c184efe8f..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/JvmProtoBuf.java +++ /dev/null @@ -1,2434 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: core/metadata.jvm/src/jvm_metadata.proto - -package retrofit2.kotlin.metadata.jvm; - -import retrofit2.kotlin.metadata.ProtoBuf; -import retrofit2.kotlin.protobuf.*; - -public final class JvmProtoBuf { - private JvmProtoBuf() {} - public static void registerAllExtensions(ExtensionRegistryLite registry) { - registry.add(JvmProtoBuf.methodSignature); - } - public interface StringTableTypesOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) - MessageLiteOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - java.util.List - getRecordList(); - - /** - * repeated int32 local_name = 5 [packed = true]; - * - *
-     * Indices of strings which are names of local classes or anonymous objects
-     * 
- */ - java.util.List getLocalNameList(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes} - */ - public static final class StringTableTypes extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) - StringTableTypesOrBuilder { - // Use StringTableTypes.newBuilder() to construct. - private StringTableTypes(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private StringTableTypes(boolean noInit) { - this.unknownFields = ByteString.EMPTY;} - - private static final StringTableTypes defaultInstance; - public static StringTableTypes getDefaultInstance() { - return defaultInstance; - } - - @Override - public StringTableTypes getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private StringTableTypes( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - record_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - record_.add(input.readMessage(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 (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new 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_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - - public static Parser PARSER = - new AbstractParser() { - - @Override - public StringTableTypes parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new StringTableTypes(input, extensionRegistry); - } - }; - - @Override - public Parser getParserForType() { - return PARSER; - } - - public interface RecordOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) - MessageLiteOrBuilder { - - /** - * 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; - * - *
-       * 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 string string = 6; - * - *
-       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-       * 
- */ - boolean hasString(); - /** - * optional string string = 6; - * - *
-       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-       * 
- */ - String getString(); - /** - * optional string string = 6; - * - *
-       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-       * 
- */ - ByteString - getStringBytes(); - - /** - * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; - * - *
-       * Perform a described operation on the string
-       * 
- */ - boolean hasOperation(); - /** - * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; - * - *
-       * Perform a described operation on the string
-       * 
- */ - Record.Operation getOperation(); - - /** - * 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]; - * - *
-       * 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.metadata.jvm.StringTableTypes.Record} - */ - public static final class Record extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) - RecordOrBuilder { - // Use Record.newBuilder() to construct. - private Record(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private Record(boolean noInit) { this.unknownFields = ByteString.EMPTY;} - - private static final Record defaultInstance; - public static Record getDefaultInstance() { - return defaultInstance; - } - - @Override - public Record getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private Record( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - 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(); - Operation value = Operation.valueOf(rawValue); - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeRawVarint32(rawValue); - } else { - bitField0_ |= 0x00000008; - operation_ = value; - } - break; - } - case 32: { - if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - substringIndex_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - substringIndex_.add(input.readInt32()); - break; - } - case 34: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000010) == 0x00000010) && input.getBytesUntilLimit() > 0) { - substringIndex_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - while (input.getBytesUntilLimit() > 0) { - substringIndex_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 40: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - replaceChar_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - replaceChar_.add(input.readInt32()); - break; - } - case 42: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) { - replaceChar_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - while (input.getBytesUntilLimit() > 0) { - replaceChar_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 50: { - ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - string_ = bs; - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - substringIndex_ = java.util.Collections.unmodifiableList(substringIndex_); - } - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - replaceChar_ = java.util.Collections.unmodifiableList(replaceChar_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - - @Override - public Record parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new Record(input, extensionRegistry); - } - }; - - @Override - public Parser getParserForType() { - return PARSER; - } - - /** - * Protobuf enum {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation} - */ - public enum Operation - implements 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; - - @Override - 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 Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static Internal.EnumLiteMap - internalValueMap = - new Internal.EnumLiteMap() { - - @Override - public Operation findValueByNumber(int number) { - return Operation.valueOf(number); - } - }; - - private final int value; - - @SuppressWarnings("UnusedVariable") - private Operation(int index, int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation) - } - - private int bitField0_; - 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
-       * 
- */ - @Override - 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
-       * 
- */ - @Override - public int getRange() { - return range_; - } - - 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
-       * 
- */ - @Override - 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
-       * 
- */ - @Override - public int getPredefinedIndex() { - return predefinedIndex_; - } - - public static final int STRING_FIELD_NUMBER = 6; - private Object string_; - /** - * optional string string = 6; - * - *
-       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-       * 
- */ - @Override - public boolean hasString() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string string = 6; - * - *
-       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-       * 
- */ - @Override - public String getString() { - Object ref = string_; - if (ref instanceof String) { - return (String) ref; - } else { - ByteString bs = - (ByteString) ref; - String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - string_ = s; - } - return s; - } - } - /** - * optional string string = 6; - * - *
-       * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-       * 
- */ - @Override - public ByteString - getStringBytes() { - Object ref = string_; - if (ref instanceof String) { - ByteString b = - ByteString.copyFromUtf8( - (String) ref); - string_ = b; - return b; - } else { - return (ByteString) ref; - } - } - - public static final int OPERATION_FIELD_NUMBER = 3; - private Operation operation_; - /** - * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; - * - *
-       * Perform a described operation on the string
-       * 
- */ - @Override - public boolean hasOperation() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; - * - *
-       * Perform a described operation on the string
-       * 
- */ - @Override - public Operation getOperation() { - return operation_; - } - - 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
-       * 
- */ - @Override - 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
-       * 
- */ - @Override - 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
-       * 
- */ - @Override - public int getSubstringIndex(int index) { - return substringIndex_.get(index); - } - private int substringIndexMemoizedSerializedSize = -1; - - 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
-       * 
- */ - @Override - 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
-       * 
- */ - @Override - 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
-       * 
- */ - @Override - public int getReplaceChar(int index) { - return replaceChar_.get(index); - } - private int replaceCharMemoizedSerializedSize = -1; - - private void initFields() { - range_ = 1; - predefinedIndex_ = 0; - string_ = ""; - operation_ = Operation.NONE; - substringIndex_ = java.util.Collections.emptyList(); - replaceChar_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(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_ & 0x00000008) == 0x00000008)) { - 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)); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(6, getStringBytes()); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - - @Override - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, range_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(2, predefinedIndex_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += CodedOutputStream - .computeEnumSize(3, operation_.getNumber()); - } - { - int dataSize = 0; - for (int i = 0; i < substringIndex_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(substringIndex_.get(i)); - } - size += dataSize; - if (!getSubstringIndexList().isEmpty()) { - size += 1; - size += CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - substringIndexMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < replaceChar_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(replaceChar_.get(i)); - } - size += dataSize; - if (!getReplaceCharList().isEmpty()) { - size += 1; - size += CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - replaceCharMemoizedSerializedSize = dataSize; - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += CodedOutputStream - .computeBytesSize(6, getStringBytes()); - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static Record parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static Record parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static Record parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static Record parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static Record parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static Record parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static Record parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static Record parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static Record parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static Record parseFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(Record prototype) { - return newBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - Record, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) - RecordOrBuilder { - // Construct using JvmProtoBuf.StringTableTypes.Record.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override - public Builder clear() { - super.clear(); - range_ = 1; - bitField0_ = (bitField0_ & ~0x00000001); - predefinedIndex_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - string_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - operation_ = Operation.NONE; - bitField0_ = (bitField0_ & ~0x00000008); - substringIndex_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - replaceChar_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - @Override - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override - public Record getDefaultInstanceForType() { - return Record.getDefaultInstance(); - } - - @Override - public Record build() { - Record result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public Record buildPartial() { - Record result = new 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.string_ = string_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.operation_ = operation_; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - substringIndex_ = java.util.Collections.unmodifiableList(substringIndex_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.substringIndex_ = substringIndex_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - replaceChar_ = java.util.Collections.unmodifiableList(replaceChar_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.replaceChar_ = replaceChar_; - result.bitField0_ = to_bitField0_; - return result; - } - - @Override - public Builder mergeFrom(Record other) { - if (other == Record.getDefaultInstance()) return this; - if (other.hasRange()) { - setRange(other.getRange()); - } - if (other.hasPredefinedIndex()) { - setPredefinedIndex(other.getPredefinedIndex()); - } - if (other.hasString()) { - bitField0_ |= 0x00000004; - string_ = other.string_; - - } - if (other.hasOperation()) { - setOperation(other.getOperation()); - } - if (!other.substringIndex_.isEmpty()) { - if (substringIndex_.isEmpty()) { - substringIndex_ = other.substringIndex_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureSubstringIndexIsMutable(); - substringIndex_.addAll(other.substringIndex_); - } - - } - if (!other.replaceChar_.isEmpty()) { - if (replaceChar_.isEmpty()) { - replaceChar_ = other.replaceChar_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureReplaceCharIsMutable(); - replaceChar_.addAll(other.replaceChar_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Record parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (Record) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - 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
-         * 
- */ - @Override - 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
-         * 
- */ - @Override - 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; - } - - private int predefinedIndex_ ; - /** - * optional int32 predefined_index = 2; - * - *
-         * Index of the predefined constant. If this field is present, the associated string is ignored
-         * 
- */ - @Override - 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
-         * 
- */ - @Override - 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; - } - - private Object string_ = ""; - /** - * optional string string = 6; - * - *
-         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-         * 
- */ - @Override - public boolean hasString() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string string = 6; - * - *
-         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-         * 
- */ - @Override - public String getString() { - Object ref = string_; - if (!(ref instanceof String)) { - ByteString bs = - (ByteString) ref; - String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - string_ = s; - } - return s; - } else { - return (String) ref; - } - } - /** - * optional string string = 6; - * - *
-         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-         * 
- */ - @Override - public ByteString - getStringBytes() { - Object ref = string_; - if (ref instanceof String) { - ByteString b = - ByteString.copyFromUtf8( - (String) ref); - string_ = b; - return b; - } else { - return (ByteString) ref; - } - } - /** - * optional string string = 6; - * - *
-         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-         * 
- */ - public Builder setString( - String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - string_ = value; - - return this; - } - /** - * optional string string = 6; - * - *
-         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-         * 
- */ - public Builder clearString() { - bitField0_ = (bitField0_ & ~0x00000004); - string_ = getDefaultInstance().getString(); - - return this; - } - /** - * optional string string = 6; - * - *
-         * A string which should be used. If this field is present, both the associated string and the predefined string index are ignored
-         * 
- */ - public Builder setStringBytes( - ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - string_ = value; - - return this; - } - - private Operation operation_ = Operation.NONE; - /** - * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; - * - *
-         * Perform a described operation on the string
-         * 
- */ - @Override - public boolean hasOperation() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; - * - *
-         * Perform a described operation on the string
-         * 
- */ - @Override - public Operation getOperation() { - return operation_; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; - * - *
-         * Perform a described operation on the string
-         * 
- */ - public Builder setOperation(Operation value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - operation_ = value; - - return this; - } - /** - * optional .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record.Operation operation = 3 [default = NONE]; - * - *
-         * Perform a described operation on the string
-         * 
- */ - public Builder clearOperation() { - bitField0_ = (bitField0_ & ~0x00000008); - operation_ = Operation.NONE; - - return this; - } - - private java.util.List substringIndex_ = java.util.Collections.emptyList(); - private void ensureSubstringIndexIsMutable() { - if (!((bitField0_ & 0x00000010) == 0x00000010)) { - substringIndex_ = new java.util.ArrayList(substringIndex_); - bitField0_ |= 0x00000010; - } - } - /** - * 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
-         * 
- */ - @Override - 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
-         * 
- */ - @Override - 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
-         * 
- */ - @Override - 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( - Iterable values) { - ensureSubstringIndexIsMutable(); - AbstractMessageLite.Builder.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_ & ~0x00000010); - - return this; - } - - private java.util.List replaceChar_ = java.util.Collections.emptyList(); - private void ensureReplaceCharIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - replaceChar_ = new java.util.ArrayList(replaceChar_); - bitField0_ |= 0x00000020; - } - } - /** - * 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
-         * 
- */ - @Override - 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
-         * 
- */ - @Override - 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
-         * 
- */ - @Override - 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( - Iterable values) { - ensureReplaceCharIsMutable(); - AbstractMessageLite.Builder.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_ & ~0x00000020); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) - } - - static { - defaultInstance = new Record(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record) - } - - public static final int RECORD_FIELD_NUMBER = 1; - private java.util.List record_; - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - @Override - public java.util.List getRecordList() { - return record_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public java.util.List - getRecordOrBuilderList() { - return record_; - } - /** - * repeated .org.jetbrains.kotlin.metadata.jvm.StringTableTypes.Record record = 1; - */ - public RecordOrBuilder getRecordOrBuilder( - int index) { - return record_.get(index); - } - - 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
-     * 
- */ - @Override - public java.util.List - getLocalNameList() { - return localName_; - } - private int localNameMemoizedSerializedSize = -1; - - private void initFields() { - record_ = java.util.Collections.emptyList(); - localName_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(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)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - - @Override - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < record_.size(); i++) { - size += CodedOutputStream - .computeMessageSize(1, record_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < localName_.size(); i++) { - dataSize += CodedOutputStream - .computeInt32SizeNoTag(localName_.get(i)); - } - size += dataSize; - if (!getLocalNameList().isEmpty()) { - size += 1; - size += CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - localNameMemoizedSerializedSize = dataSize; - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static StringTableTypes parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static StringTableTypes parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static StringTableTypes parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static StringTableTypes parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static StringTableTypes parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static StringTableTypes parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static StringTableTypes parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static StringTableTypes parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static StringTableTypes parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static StringTableTypes parseFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - @Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(StringTableTypes prototype) { - return newBuilder().mergeFrom(prototype); - } - @Override - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.StringTableTypes} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - StringTableTypes, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) - StringTableTypesOrBuilder { - // Construct using JvmProtoBuf.StringTableTypes.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override - public Builder clear() { - super.clear(); - record_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - localName_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @Override - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override - public StringTableTypes getDefaultInstanceForType() { - return StringTableTypes.getDefaultInstance(); - } - - @Override - public StringTableTypes build() { - StringTableTypes result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public StringTableTypes buildPartial() { - StringTableTypes result = new StringTableTypes(this); - 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; - } - - @Override - public Builder mergeFrom(StringTableTypes other) { - if (other == 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_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - StringTableTypes parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (StringTableTypes) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - 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.metadata.jvm.StringTableTypes.Record record = 1; - */ - @Override - public java.util.List getRecordList() { - return java.util.Collections.unmodifiableList(record_); - } - - 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
-       * 
- */ - @Override - public java.util.List - getLocalNameList() { - return java.util.Collections.unmodifiableList(localName_); - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) - } - - static { - defaultInstance = new StringTableTypes(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.StringTableTypes) - } - - public interface JvmMethodSignatureOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) - MessageLiteOrBuilder { - - /** - * optional int32 name = 1; - */ - boolean hasName(); - /** - * optional int32 name = 1; - */ - int getName(); - - /** - * optional int32 desc = 2; - * - *
-     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
-     * 
- */ - boolean hasDesc(); - /** - * optional int32 desc = 2; - * - *
-     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
-     * 
- */ - int getDesc(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature} - */ - public static final class JvmMethodSignature extends - GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) - JvmMethodSignatureOrBuilder { - // Use JvmMethodSignature.newBuilder() to construct. - private JvmMethodSignature(GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - @SuppressWarnings("UnusedVariable") - private JvmMethodSignature(boolean noInit) { - - this.unknownFields = ByteString.EMPTY; - } - - private static final JvmMethodSignature defaultInstance; - public static JvmMethodSignature getDefaultInstance() { - return defaultInstance; - } - - @Override - public JvmMethodSignature getDefaultInstanceForType() { - return defaultInstance; - } - - private final ByteString unknownFields; - private JvmMethodSignature( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - initFields(); - ByteString.Output unknownFieldsOutput = - ByteString.newOutput(); - CodedOutputStream unknownFieldsCodedOutput = - CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - name_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - desc_ = input.readInt32(); - break; - } - } - } - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static Parser PARSER = - new AbstractParser() { - @Override - public JvmMethodSignature parsePartialFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return new JvmMethodSignature(input, extensionRegistry); - } - }; - - @Override - public Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private int name_; - /** - * optional int32 name = 1; - */ - @Override - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 name = 1; - */ - @Override - public int getName() { - return name_; - } - - public static final int DESC_FIELD_NUMBER = 2; - private int desc_; - /** - * optional int32 desc = 2; - * - *
-     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
-     * 
- */ - @Override - public boolean hasDesc() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 desc = 2; - * - *
-     * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
-     * 
- */ - @Override - public int getDesc() { - return desc_; - } - - private void initFields() { - name_ = 0; - desc_ = 0; - } - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, name_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, desc_); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - - @Override - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += CodedOutputStream - .computeInt32Size(1, name_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += CodedOutputStream - .computeInt32Size(2, desc_); - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static JvmMethodSignature parseFrom( - ByteString data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static JvmMethodSignature parseFrom( - ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static JvmMethodSignature parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static JvmMethodSignature parseFrom( - byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static JvmMethodSignature parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static JvmMethodSignature parseFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static JvmMethodSignature parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static JvmMethodSignature parseDelimitedFrom( - java.io.InputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static JvmMethodSignature parseFrom( - CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static JvmMethodSignature parseFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - @Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(JvmMethodSignature prototype) { - return newBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature} - */ - public static final class Builder extends - GeneratedMessageLite.Builder< - JvmMethodSignature, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) - JvmMethodSignatureOrBuilder { - // Construct using JvmProtoBuf.JvmMethodSignature.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - @Override public Builder clear() { - super.clear(); - name_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - desc_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @Override public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - @Override - public JvmMethodSignature getDefaultInstanceForType() { - return JvmMethodSignature.getDefaultInstance(); - } - - @Override - public JvmMethodSignature build() { - JvmMethodSignature result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public JvmMethodSignature buildPartial() { - JvmMethodSignature result = new JvmMethodSignature(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.name_ = name_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.desc_ = desc_; - result.bitField0_ = to_bitField0_; - return result; - } - - @Override - public Builder mergeFrom(JvmMethodSignature other) { - if (other == JvmMethodSignature.getDefaultInstance()) return this; - if (other.hasName()) { - setName(other.getName()); - } - if (other.hasDesc()) { - setDesc(other.getDesc()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - JvmMethodSignature parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (InvalidProtocolBufferException e) { - parsedMessage = (JvmMethodSignature) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int name_ ; - /** - * optional int32 name = 1; - */ - @Override - public boolean hasName() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 name = 1; - */ - @Override - public int getName() { - return name_; - } - /** - * optional int32 name = 1; - */ - public Builder setName(int value) { - bitField0_ |= 0x00000001; - name_ = value; - - return this; - } - /** - * optional int32 name = 1; - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000001); - name_ = 0; - - return this; - } - - private int desc_ ; - /** - * optional int32 desc = 2; - * - *
-       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
-       * 
- */ - @Override - public boolean hasDesc() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 desc = 2; - * - *
-       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
-       * 
- */ - @Override - public int getDesc() { - return desc_; - } - /** - * optional int32 desc = 2; - * - *
-       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
-       * 
- */ - public Builder setDesc(int value) { - bitField0_ |= 0x00000002; - desc_ = value; - - return this; - } - /** - * optional int32 desc = 2; - * - *
-       * JVM descriptor of the method, e.g. '(Ljava/util/List;)[Ljava/lang/Object;'
-       * 
- */ - public Builder clearDesc() { - bitField0_ = (bitField0_ & ~0x00000002); - desc_ = 0; - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) - } - - static { - defaultInstance = new JvmMethodSignature(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.metadata.jvm.JvmMethodSignature) - } - - public static final int METHOD_SIGNATURE_FIELD_NUMBER = 100; - /** - * extend .org.jetbrains.kotlin.metadata.Function { ... } - */ - public static final - GeneratedMessageLite.GeneratedExtension< - ProtoBuf.Function, - JvmMethodSignature> methodSignature = GeneratedMessageLite - .newSingularGeneratedExtension( - ProtoBuf.Function.getDefaultInstance(), - JvmMethodSignature.getDefaultInstance(), - JvmMethodSignature.getDefaultInstance(), - null, - 100, - WireFormat.FieldType.MESSAGE, - JvmMethodSignature.class); - - // @@protoc_insertion_point(outer_class_scope) -} \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt deleted file mode 100644 index 2b4f218eda..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/ClassMapperLite.kt +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlin.metadata.jvm.deserialization - -// The purpose of this class is to map Kotlin classes to JVM bytecode desc strings, as KotlinTypeMapper does in the backend. -// It's used as an optimization during serialization/deserialization: if there's no JVM signature for a method/property/constructor, -// it means that the JVM signature should be trivially computable from the Kotlin signature with this class. -// It's not required to support everything in KotlinTypeMapper, but the more it does, the more we save on JVM signatures in proto metadata. -// -// WARNING: improving the behavior of this class MAY BREAK BINARY COMPATIBILITY of code compiled by Kotlin, because it may make -// the new compiler skip writing the signatures it now thinks are trivial, and the old compiler would recreate them incorrectly. -object ClassMapperLite { - // Simply "kotlin", but to avoid being renamed by namespace relocation (e.g., Shadow.relocate gradle plugin) - private val kotlin = listOf('k', 'o', 't', 'l', 'i', 'n').joinToString(separator = "") - // Kotlin ClassId -> JVM desc - // e.g. "kotlin.IntArray" -> "[I" - // "kotlin.String.Companion" -> "Lkotlin/jvm/internal/StringCompanionObject" - // "kotlin/collections/Map.Entry" -> "Ljava/util/Map$Entry" - private val map: Map = mutableMapOf().apply { - val primitives = listOf( - "Boolean", "Z", - "Char", "C", - "Byte", "B", - "Short", "S", - "Int", "I", - "Float", "F", - "Long", "J", - "Double", "D" - ) - - for (i in primitives.indices step 2) { - put("$kotlin/${primitives[i]}", primitives[i + 1]) - put("$kotlin/${primitives[i]}Array", "[${primitives[i + 1]}") - } - - put("$kotlin/Unit", "V") - - fun add(kotlinSimpleName: String, javaInternalName: String) { - put("$kotlin/$kotlinSimpleName", "L$javaInternalName;") - } - - add("Any", "java/lang/Object") - add("Nothing", "java/lang/Void") - add("Annotation", "java/lang/annotation/Annotation") - - for (klass in listOf("String", "CharSequence", "Throwable", "Cloneable", "Number", "Comparable", "Enum")) { - add(klass, "java/lang/$klass") - } - - for (klass in listOf("Iterator", "Collection", "List", "Set", "Map", "ListIterator")) { - add("collections/$klass", "java/util/$klass") - add("collections/Mutable$klass", "java/util/$klass") - } - - add("collections/Iterable", "java/lang/Iterable") - add("collections/MutableIterable", "java/lang/Iterable") - add("collections/Map.Entry", "java/util/Map\$Entry") - add("collections/MutableMap.MutableEntry", "java/util/Map\$Entry") - - for (i in 0..22) { - add("Function$i", "$kotlin/jvm/functions/Function$i") - add("reflect/KFunction$i", "$kotlin/reflect/KFunction") - } - - //Boolean is purposefully omitted from this list, even though it has a Companion Object. - //This assures that an older compiler won't get confused by the new signature, preventing a bug in compatibility. - for (klass in listOf("Char", "Byte", "Short", "Int", "Float", "Long", "Double", "String", "Enum")) { - add("$klass.Companion", "$kotlin/jvm/internal/${klass}CompanionObject") - } - } - - /** - * @param classId the name of the class in the format: "org/foo/bar/Test.Inner" - */ - @JvmStatic - fun mapClass(classId: String): String { - return map[classId] ?: "L${classId.replace('.', '$')};" - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt deleted file mode 100644 index 2d41a6103c..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmMemberSignature.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlin.metadata.jvm.deserialization - -/** - * A signature of JVM method or field - * - * @property name name of method or field - * @property desc JVM descriptor of a method, e.g. `(Ljava/lang/Object;)Z`, or a field type, e.g. `Ljava/lang/String;` - */ -sealed class JvmMemberSignature { - - abstract val name: String - abstract val desc: String - - data class Method(override val name: String, override val desc: String) : JvmMemberSignature() { - override fun asString() = name + desc - } - - data class Field(override val name: String, override val desc: String) : JvmMemberSignature() { - override fun asString() = "$name:$desc" - } - - final override fun toString() = asString() - abstract fun asString(): String -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt deleted file mode 100644 index fe3458c2b4..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlin.metadata.jvm.deserialization - -import retrofit2.kotlin.metadata.deserialization.NameResolver -import retrofit2.kotlin.metadata.jvm.JvmProtoBuf -import retrofit2.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record -import retrofit2.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record.Operation.* - -class JvmNameResolver( - val types: JvmProtoBuf.StringTableTypes, - 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 - // Note that as an optimization, range of each expanded record is equal to the original range, not 1. If correct ranges are needed, - // please use the original record representation in [types.recordList]. - 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 = when { - record.hasString() -> record.string - 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 getQualifiedClassName(index: Int): String = - getString(index) - - override fun isLocalClassName(index: Int): Boolean = - index in localNameIndices - - companion object { - // Simply "kotlin", but to avoid being renamed by namespace relocation (e.g., Shadow.relocate gradle plugin) - private val kotlin = listOf('k', 'o', 't', 'l', 'i', 'n').joinToString(separator = "") - - 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/collections/Iterable", "$kotlin/collections/MutableIterable", - "$kotlin/collections/Collection", "$kotlin/collections/MutableCollection", - "$kotlin/collections/List", "$kotlin/collections/MutableList", - "$kotlin/collections/Set", "$kotlin/collections/MutableSet", - "$kotlin/collections/Map", "$kotlin/collections/MutableMap", - "$kotlin/collections/Map.Entry", "$kotlin/collections/MutableMap.MutableEntry", - - "$kotlin/collections/Iterator", "$kotlin/collections/MutableIterator", - "$kotlin/collections/ListIterator", "$kotlin/collections/MutableListIterator" - ) - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt deleted file mode 100644 index a3f8e5ba6a..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/jvm/deserialization/JvmProtoBufUtil.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlin.metadata.jvm.deserialization - -import retrofit2.kotlin.protobuf.ExtensionRegistryLite -import retrofit2.kotlin.metadata.ProtoBuf -import retrofit2.kotlin.metadata.deserialization.* -import retrofit2.kotlin.metadata.jvm.JvmProtoBuf -import java.io.ByteArrayInputStream -import java.io.InputStream - - -object JvmProtoBufUtil { - val EXTENSION_REGISTRY: ExtensionRegistryLite = ExtensionRegistryLite.newInstance().apply(JvmProtoBuf::registerAllExtensions) - - @JvmStatic - fun readClassDataFrom(data: Array, strings: Array): Pair = - readClassDataFrom(BitEncoding.decodeBytes(data), strings) - - @JvmStatic - fun readClassDataFrom(bytes: ByteArray, strings: Array): Pair { - val input = ByteArrayInputStream(bytes) - return Pair(input.readNameResolver(strings), ProtoBuf.Class.parseFrom(input, EXTENSION_REGISTRY)) - } - - private fun InputStream.readNameResolver(strings: Array): JvmNameResolver = - JvmNameResolver(JvmProtoBuf.StringTableTypes.parseDelimitedFrom(this, EXTENSION_REGISTRY), strings) - - // returns JVM signature in the format: "equals(Ljava/lang/Object;)Z" - fun getJvmMethodSignature( - proto: ProtoBuf.Function, - nameResolver: NameResolver, - typeTable: TypeTable - ): JvmMemberSignature.Method? { - val signature = proto.getExtensionOrNull(JvmProtoBuf.methodSignature) - val name = if (signature != null && signature.hasName()) signature.name else proto.name - val desc = if (signature != null && signature.hasDesc()) { - nameResolver.getString(signature.desc) - } else { - val parameterTypes = listOfNotNull(proto.receiverType(typeTable)) + proto.valueParameterList.map { it.type(typeTable) } - - val parametersDesc = parameterTypes.map { mapTypeDefault(it, nameResolver) ?: return null } - val returnTypeDesc = mapTypeDefault(proto.returnType(typeTable), nameResolver) ?: return null - - parametersDesc.joinToString(separator = "", prefix = "(", postfix = ")") + returnTypeDesc - } - return JvmMemberSignature.Method(nameResolver.getString(name), desc) - } - - private fun mapTypeDefault(type: ProtoBuf.Type, nameResolver: NameResolver): String? { - return if (type.hasClassName()) ClassMapperLite.mapClass(nameResolver.getQualifiedClassName(type.className)) else null - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractMessageLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractMessageLite.java deleted file mode 100644 index 9f8babadad..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractMessageLite.java +++ /dev/null @@ -1,356 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.FilterInputStream; -import java.io.InputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Collection; - -/** - * A partial implementation of the {@link MessageLite} interface which - * implements as many methods of that interface as possible in terms of other - * methods. - * - * @author kenton@google.com Kenton Varda - */ -public abstract class AbstractMessageLite implements MessageLite { - protected int memoizedHashCode = 0; - - @Override - public ByteString toByteString() { - try { - final ByteString.CodedBuilder out = - ByteString.newCodedBuilder(getSerializedSize()); - writeTo(out.getCodedOutput()); - return out.build(); - } catch (IOException e) { - throw new RuntimeException( - "Serializing to a ByteString threw an IOException (should " + - "never happen).", e); - } - } - - @Override public byte[] toByteArray() { - try { - final byte[] result = new byte[getSerializedSize()]; - final CodedOutputStream output = CodedOutputStream.newInstance(result); - writeTo(output); - output.checkNoSpaceLeft(); - return result; - } catch (IOException e) { - throw new RuntimeException( - "Serializing to a byte array threw an IOException " + - "(should never happen).", e); - } - } - - @Override public void writeTo(final OutputStream output) throws IOException { - final int bufferSize = - CodedOutputStream.computePreferredBufferSize(getSerializedSize()); - final CodedOutputStream codedOutput = - CodedOutputStream.newInstance(output, bufferSize); - writeTo(codedOutput); - codedOutput.flush(); - } - - @Override public void writeDelimitedTo(final OutputStream output) throws IOException { - final int serialized = getSerializedSize(); - final int bufferSize = CodedOutputStream.computePreferredBufferSize( - CodedOutputStream.computeRawVarint32Size(serialized) + serialized); - final CodedOutputStream codedOutput = - CodedOutputStream.newInstance(output, bufferSize); - codedOutput.writeRawVarint32(serialized); - writeTo(codedOutput); - codedOutput.flush(); - } - - - /** - * Package private helper method for AbstractParser to create - * UninitializedMessageException. - */ - UninitializedMessageException newUninitializedMessageException() { - return new UninitializedMessageException(this); - } - - protected static void checkByteStringIsUtf8(ByteString byteString) - throws IllegalArgumentException { - if (!byteString.isValidUtf8()) { - throw new IllegalArgumentException("Byte string is not UTF-8."); - } - } - - /** - * A partial implementation of the {@link Message.Builder} interface which - * implements as many methods of that interface as possible in terms of - * other methods. - */ - @SuppressWarnings("unchecked") - public static abstract class Builder - implements MessageLite.Builder { - // The compiler produces an error if this is not declared explicitly. - @Override - public abstract BuilderType clone(); - - @Override public BuilderType mergeFrom(final CodedInputStream input) - throws IOException { - return mergeFrom(input, ExtensionRegistryLite.getEmptyRegistry()); - } - - // Re-defined here for return type covariance. - @Override public abstract BuilderType mergeFrom( - final CodedInputStream input, - final ExtensionRegistryLite extensionRegistry) - throws IOException; - - @Override public BuilderType mergeFrom(final ByteString data) - throws InvalidProtocolBufferException { - try { - final CodedInputStream input = data.newCodedInput(); - mergeFrom(input); - input.checkLastTagWas(0); - return (BuilderType) this; - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "Reading from a ByteString threw an IOException (should " + - "never happen).", e); - } - } - - @Override public BuilderType mergeFrom( - final ByteString data, - final ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - try { - final CodedInputStream input = data.newCodedInput(); - mergeFrom(input, extensionRegistry); - input.checkLastTagWas(0); - return (BuilderType) this; - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "Reading from a ByteString threw an IOException (should " + - "never happen).", e); - } - } - - @Override public BuilderType mergeFrom(final byte[] data) - throws InvalidProtocolBufferException { - return mergeFrom(data, 0, data.length); - } - - @Override public BuilderType mergeFrom(final byte[] data, final int off, - final int len) - throws InvalidProtocolBufferException { - try { - final CodedInputStream input = - CodedInputStream.newInstance(data, off, len); - mergeFrom(input); - input.checkLastTagWas(0); - return (BuilderType) this; - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "Reading from a byte array threw an IOException (should " + - "never happen).", e); - } - } - - @Override public BuilderType mergeFrom( - final byte[] data, - final ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return mergeFrom(data, 0, data.length, extensionRegistry); - } - - @Override public BuilderType mergeFrom( - final byte[] data, final int off, final int len, - final ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - try { - final CodedInputStream input = - CodedInputStream.newInstance(data, off, len); - mergeFrom(input, extensionRegistry); - input.checkLastTagWas(0); - return (BuilderType) this; - } catch (InvalidProtocolBufferException e) { - throw e; - } catch (IOException e) { - throw new RuntimeException( - "Reading from a byte array threw an IOException (should " + - "never happen).", e); - } - } - - @Override public BuilderType mergeFrom(final InputStream input) throws IOException { - final CodedInputStream codedInput = CodedInputStream.newInstance(input); - mergeFrom(codedInput); - codedInput.checkLastTagWas(0); - return (BuilderType) this; - } - - @Override public BuilderType mergeFrom( - final InputStream input, - final ExtensionRegistryLite extensionRegistry) - throws IOException { - final CodedInputStream codedInput = CodedInputStream.newInstance(input); - mergeFrom(codedInput, extensionRegistry); - codedInput.checkLastTagWas(0); - return (BuilderType) this; - } - - /** - * An InputStream implementations which reads from some other InputStream - * but is limited to a particular number of bytes. Used by - * mergeDelimitedFrom(). This is intentionally package-private so that - * UnknownFieldSet can share it. - */ - static final class LimitedInputStream extends FilterInputStream { - private int limit; - - LimitedInputStream(InputStream in, int limit) { - super(in); - this.limit = limit; - } - - @Override - public int available() throws IOException { - return Math.min(super.available(), limit); - } - - @Override - public int read() throws IOException { - if (limit <= 0) { - return -1; - } - final int result = super.read(); - if (result >= 0) { - --limit; - } - return result; - } - - @Override - public int read(final byte[] b, final int off, int len) - throws IOException { - if (limit <= 0) { - return -1; - } - len = Math.min(len, limit); - final int result = super.read(b, off, len); - if (result >= 0) { - limit -= result; - } - return result; - } - - @Override - public long skip(final long n) throws IOException { - final long result = super.skip(Math.min(n, limit)); - if (result >= 0) { - limit -= result; - } - return result; - } - } - - @Override public boolean mergeDelimitedFrom( - final InputStream input, - final ExtensionRegistryLite extensionRegistry) - throws IOException { - final int firstByte = input.read(); - if (firstByte == -1) { - return false; - } - final int size = CodedInputStream.readRawVarint32(firstByte, input); - final InputStream limitedInput = new LimitedInputStream(input, size); - mergeFrom(limitedInput, extensionRegistry); - return true; - } - - @Override public boolean mergeDelimitedFrom(final InputStream input) - throws IOException { - return mergeDelimitedFrom(input, - ExtensionRegistryLite.getEmptyRegistry()); - } - - /** - * Construct an UninitializedMessageException reporting missing fields in - * the given message. - */ - protected static UninitializedMessageException - newUninitializedMessageException(MessageLite message) { - return new UninitializedMessageException(message); - } - - /** - * Adds the {@code values} to the {@code list}. This is a helper method - * used by generated code. Users should ignore it. - * - * @throws NullPointerException if any of the elements of {@code values} is - * null. When that happens, some elements of {@code values} may have already - * been added to the result {@code list}. - */ - protected static void addAll(final Iterable values, - final Collection list) { - if (values instanceof LazyStringList) { - // For StringOrByteStringLists, check the underlying elements to avoid - // forcing conversions of ByteStrings to Strings. - checkForNullValues(((LazyStringList) values).getUnderlyingElements()); - list.addAll((Collection) values); - } else if (values instanceof Collection) { - checkForNullValues(values); - list.addAll((Collection) values); - } else { - for (final T value : values) { - if (value == null) { - throw new NullPointerException(); - } - list.add(value); - } - } - } - - private static void checkForNullValues(final Iterable values) { - for (final Object value : values) { - if (value == null) { - throw new NullPointerException(); - } - } - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractParser.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractParser.java deleted file mode 100644 index 957b5df04f..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/AbstractParser.java +++ /dev/null @@ -1,243 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import retrofit2.kotlin.protobuf.AbstractMessageLite.Builder.LimitedInputStream; - -import java.io.IOException; -import java.io.InputStream; - -/** - * A partial implementation of the {@link Parser} interface which implements - * as many methods of that interface as possible in terms of other methods. - * - * Note: This class implements all the convenience methods in the - * {@link Parser} interface. See {@link Parser} for related javadocs. - * Subclasses need to implement - * {@link Parser#parsePartialFrom(CodedInputStream, ExtensionRegistryLite)} - * - * @author liujisi@google.com (Pherl Liu) - */ -public abstract class AbstractParser - implements Parser { - /** - * Creates an UninitializedMessageException for MessageType. - */ - private UninitializedMessageException - newUninitializedMessageException(MessageType message) { - if (message instanceof AbstractMessageLite) { - return ((AbstractMessageLite) message).newUninitializedMessageException(); - } - return new UninitializedMessageException(message); - } - - /** - * Helper method to check if message is initialized. - * - * @throws InvalidProtocolBufferException if it is not initialized. - * @return The message to check. - */ - private MessageType checkMessageInitialized(MessageType message) - throws InvalidProtocolBufferException { - if (message != null && !message.isInitialized()) { - throw newUninitializedMessageException(message) - .asInvalidProtocolBufferException() - .setUnfinishedMessage(message); - } - return message; - } - - private static final ExtensionRegistryLite EMPTY_REGISTRY - = ExtensionRegistryLite.getEmptyRegistry(); - - public MessageType parsePartialFrom(CodedInputStream input) - throws InvalidProtocolBufferException { - return parsePartialFrom(input, EMPTY_REGISTRY); - } - - public MessageType parseFrom(CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return checkMessageInitialized( - parsePartialFrom(input, extensionRegistry)); - } - - public MessageType parseFrom(CodedInputStream input) - throws InvalidProtocolBufferException { - return parseFrom(input, EMPTY_REGISTRY); - } - - public MessageType parsePartialFrom(ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - MessageType message; - try { - CodedInputStream input = data.newCodedInput(); - message = parsePartialFrom(input, extensionRegistry); - try { - input.checkLastTagWas(0); - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(message); - } - return message; - } catch (InvalidProtocolBufferException e) { - throw e; - } - } - - public MessageType parsePartialFrom(ByteString data) - throws InvalidProtocolBufferException { - return parsePartialFrom(data, EMPTY_REGISTRY); - } - - public MessageType parseFrom(ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return checkMessageInitialized(parsePartialFrom(data, extensionRegistry)); - } - - public MessageType parseFrom(ByteString data) - throws InvalidProtocolBufferException { - return parseFrom(data, EMPTY_REGISTRY); - } - - public MessageType parsePartialFrom(byte[] data, int off, int len, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - try { - CodedInputStream input = CodedInputStream.newInstance(data, off, len); - MessageType message = parsePartialFrom(input, extensionRegistry); - try { - input.checkLastTagWas(0); - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(message); - } - return message; - } catch (InvalidProtocolBufferException e) { - throw e; - } - } - - public MessageType parsePartialFrom(byte[] data, int off, int len) - throws InvalidProtocolBufferException { - return parsePartialFrom(data, off, len, EMPTY_REGISTRY); - } - - public MessageType parsePartialFrom(byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return parsePartialFrom(data, 0, data.length, extensionRegistry); - } - - public MessageType parsePartialFrom(byte[] data) - throws InvalidProtocolBufferException { - return parsePartialFrom(data, 0, data.length, EMPTY_REGISTRY); - } - - public MessageType parseFrom(byte[] data, int off, int len, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return checkMessageInitialized( - parsePartialFrom(data, off, len, extensionRegistry)); - } - - public MessageType parseFrom(byte[] data, int off, int len) - throws InvalidProtocolBufferException { - return parseFrom(data, off, len, EMPTY_REGISTRY); - } - - public MessageType parseFrom(byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return parseFrom(data, 0, data.length, extensionRegistry); - } - - public MessageType parseFrom(byte[] data) - throws InvalidProtocolBufferException { - return parseFrom(data, EMPTY_REGISTRY); - } - - public MessageType parsePartialFrom(InputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - CodedInputStream codedInput = CodedInputStream.newInstance(input); - MessageType message = parsePartialFrom(codedInput, extensionRegistry); - try { - codedInput.checkLastTagWas(0); - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(message); - } - return message; - } - - public MessageType parseFrom(InputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return checkMessageInitialized( - parsePartialFrom(input, extensionRegistry)); - } - - public MessageType parseFrom(InputStream input) - throws InvalidProtocolBufferException { - return parseFrom(input, EMPTY_REGISTRY); - } - - public MessageType parsePartialDelimitedFrom( - InputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - int size; - try { - int firstByte = input.read(); - if (firstByte == -1) { - return null; - } - size = CodedInputStream.readRawVarint32(firstByte, input); - } catch (IOException e) { - throw new InvalidProtocolBufferException(e.getMessage()); - } - InputStream limitedInput = new LimitedInputStream(input, size); - return parsePartialFrom(limitedInput, extensionRegistry); - } - - public MessageType parseDelimitedFrom( - InputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - return checkMessageInitialized( - parsePartialDelimitedFrom(input, extensionRegistry)); - } - - public MessageType parseDelimitedFrom(InputStream input) - throws InvalidProtocolBufferException { - return parseDelimitedFrom(input, EMPTY_REGISTRY); - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/BoundedByteString.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/BoundedByteString.java deleted file mode 100644 index 114d1672dc..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/BoundedByteString.java +++ /dev/null @@ -1,163 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.NoSuchElementException; - -/** - * This class is used to represent the substring of a {@link ByteString} over a - * single byte array. In terms of the public API of {@link ByteString}, you end - * up here by calling {@link ByteString#copyFrom(byte[])} followed by {@link - * ByteString#substring(int, int)}. - * - *

This class contains most of the overhead involved in creating a substring - * from a {@link LiteralByteString}. The overhead involves some range-checking - * and two extra fields. - * - * @author carlanton@google.com (Carl Haverl) - */ -class BoundedByteString extends LiteralByteString { - - private final int bytesOffset; - private final int bytesLength; - - /** - * Creates a {@code BoundedByteString} backed by the sub-range of given array, - * without copying. - * - * @param bytes array to wrap - * @param offset index to first byte to use in bytes - * @param length number of bytes to use from bytes - * @throws IllegalArgumentException if {@code offset < 0}, {@code length < 0}, - * or if {@code offset + length > - * bytes.length}. - */ - BoundedByteString(byte[] bytes, int offset, int length) { - super(bytes); - if (offset < 0) { - throw new IllegalArgumentException("Offset too small: " + offset); - } - if (length < 0) { - throw new IllegalArgumentException("Length too small: " + offset); - } - if ((long) offset + length > bytes.length) { - throw new IllegalArgumentException( - "Offset+Length too large: " + offset + "+" + length); - } - - this.bytesOffset = offset; - this.bytesLength = length; - } - - /** - * Gets the byte at the given index. - * Throws {@link ArrayIndexOutOfBoundsException} - * for backwards-compatibility reasons although it would more properly be - * {@link IndexOutOfBoundsException}. - * - * @param index index of byte - * @return the value - * @throws ArrayIndexOutOfBoundsException {@code index} is < 0 or >= size - */ - @Override - public byte byteAt(int index) { - // We must check the index ourselves as we cannot rely on Java array index - // checking for substrings. - if (index < 0) { - throw new ArrayIndexOutOfBoundsException("Index too small: " + index); - } - if (index >= size()) { - throw new ArrayIndexOutOfBoundsException( - "Index too large: " + index + ", " + size()); - } - - return bytes[bytesOffset + index]; - } - - @Override - public int size() { - return bytesLength; - } - - @Override - protected int getOffsetIntoBytes() { - return bytesOffset; - } - - // ================================================================= - // ByteString -> byte[] - - @Override - protected void copyToInternal(byte[] target, int sourceOffset, - int targetOffset, int numberToCopy) { - System.arraycopy(bytes, getOffsetIntoBytes() + sourceOffset, target, - targetOffset, numberToCopy); - } - - // ================================================================= - // ByteIterator - - @Override - public ByteIterator iterator() { - return new BoundedByteIterator(); - } - - private class BoundedByteIterator implements ByteIterator { - - private int position; - private final int limit; - - private BoundedByteIterator() { - position = getOffsetIntoBytes(); - limit = position + size(); - } - - public boolean hasNext() { - return (position < limit); - } - - public Byte next() { - // Boxing calls Byte.valueOf(byte), which does not instantiate. - return nextByte(); - } - - public byte nextByte() { - if (position >= limit) { - throw new NoSuchElementException(); - } - return bytes[position++]; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/ByteString.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ByteString.java deleted file mode 100644 index 570aa04fd7..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/ByteString.java +++ /dev/null @@ -1,1022 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * Immutable sequence of bytes. Substring is supported by sharing the reference - * to the immutable underlying bytes, as with {@link String}. Concatenation is - * likewise supported without copying (long strings) by building a tree of - * pieces in {@link RopeByteString}. - *

- * Like {@link String}, the contents of a {@link ByteString} can never be - * observed to change, not even in the presence of a data race or incorrect - * API usage in the client code. - * - * @author crazybob@google.com Bob Lee - * @author kenton@google.com Kenton Varda - * @author carlanton@google.com Carl Haverl - * @author martinrb@google.com Martin Buchholz - */ -public abstract class ByteString implements Iterable { - - /** - * When two strings to be concatenated have a combined length shorter than - * this, we just copy their bytes on {@link #concat(ByteString)}. - * The trade-off is copy size versus the overhead of creating tree nodes - * in {@link RopeByteString}. - */ - static final int CONCATENATE_BY_COPY_SIZE = 128; - - /** - * When copying an InputStream into a ByteString with .readFrom(), - * the chunks in the underlying rope start at 256 bytes, but double - * each iteration up to 8192 bytes. - */ - static final int MIN_READ_FROM_CHUNK_SIZE = 0x100; // 256b - static final int MAX_READ_FROM_CHUNK_SIZE = 0x2000; // 8k - - /** - * Empty {@code ByteString}. - */ - public static final ByteString EMPTY = new LiteralByteString(new byte[0]); - - // This constructor is here to prevent subclassing outside of this package, - ByteString() {} - - /** - * Gets the byte at the given index. This method should be used only for - * random access to individual bytes. To access bytes sequentially, use the - * {@link ByteIterator} returned by {@link #iterator()}, and call {@link - * #substring(int, int)} first if necessary. - * - * @param index index of byte - * @return the value - * @throws ArrayIndexOutOfBoundsException {@code index} is < 0 or >= size - */ - public abstract byte byteAt(int index); - - /** - * Return a {@link ByteString.ByteIterator} over the bytes in the ByteString. - * To avoid auto-boxing, you may get the iterator manually and call - * {@link ByteIterator#nextByte()}. - * - * @return the iterator - */ - public abstract ByteIterator iterator(); - - /** - * This interface extends {@code Iterator}, so that we can return an - * unboxed {@code byte}. - */ - public interface ByteIterator extends Iterator { - /** - * An alternative to {@link Iterator#next()} that returns an - * unboxed primitive {@code byte}. - * - * @return the next {@code byte} in the iteration - * @throws NoSuchElementException if the iteration has no more elements - */ - byte nextByte(); - } - - /** - * Gets the number of bytes. - * - * @return size in bytes - */ - public abstract int size(); - - /** - * Returns {@code true} if the size is {@code 0}, {@code false} otherwise. - * - * @return true if this is zero bytes long - */ - public boolean isEmpty() { - return size() == 0; - } - - // ================================================================= - // ByteString -> substring - - /** - * Return the substring from {@code beginIndex}, inclusive, to the end of the - * string. - * - * @param beginIndex start at this index - * @return substring sharing underlying data - * @throws IndexOutOfBoundsException if {@code beginIndex < 0} or - * {@code beginIndex > size()}. - */ - public ByteString substring(int beginIndex) { - return substring(beginIndex, size()); - } - - /** - * Return the substring from {@code beginIndex}, inclusive, to {@code - * endIndex}, exclusive. - * - * @param beginIndex start at this index - * @param endIndex the last character is the one before this index - * @return substring sharing underlying data - * @throws IndexOutOfBoundsException if {@code beginIndex < 0}, - * {@code endIndex > size()}, or {@code beginIndex > endIndex}. - */ - public abstract ByteString substring(int beginIndex, int endIndex); - - /** - * Tests if this bytestring starts with the specified prefix. - * Similar to {@link String#startsWith(String)} - * - * @param prefix the prefix. - * @return true if the byte sequence represented by the - * argument is a prefix of the byte sequence represented by - * this string; false otherwise. - */ - public boolean startsWith(ByteString prefix) { - return size() >= prefix.size() && - substring(0, prefix.size()).equals(prefix); - } - - /** - * Tests if this bytestring ends with the specified suffix. - * Similar to {@link String#endsWith(String)} - * - * @param suffix the suffix. - * @return true if the byte sequence represented by the - * argument is a suffix of the byte sequence represented by - * this string; false otherwise. - */ - public boolean endsWith(ByteString suffix) { - return size() >= suffix.size() && - substring(size() - suffix.size()).equals(suffix); - } - - // ================================================================= - // byte[] -> ByteString - - /** - * Copies the given bytes into a {@code ByteString}. - * - * @param bytes source array - * @param offset offset in source array - * @param size number of bytes to copy - * @return new {@code ByteString} - */ - public static ByteString copyFrom(byte[] bytes, int offset, int size) { - byte[] copy = new byte[size]; - System.arraycopy(bytes, offset, copy, 0, size); - return new LiteralByteString(copy); - } - - /** - * Copies the given bytes into a {@code ByteString}. - * - * @param bytes to copy - * @return new {@code ByteString} - */ - public static ByteString copyFrom(byte[] bytes) { - return copyFrom(bytes, 0, bytes.length); - } - - /** - * Copies the next {@code size} bytes from a {@code java.nio.ByteBuffer} into - * a {@code ByteString}. - * - * @param bytes source buffer - * @param size number of bytes to copy - * @return new {@code ByteString} - */ - public static ByteString copyFrom(ByteBuffer bytes, int size) { - byte[] copy = new byte[size]; - bytes.get(copy); - return new LiteralByteString(copy); - } - - /** - * Copies the remaining bytes from a {@code java.nio.ByteBuffer} into - * a {@code ByteString}. - * - * @param bytes sourceBuffer - * @return new {@code ByteString} - */ - public static ByteString copyFrom(ByteBuffer bytes) { - return copyFrom(bytes, bytes.remaining()); - } - - /** - * Encodes {@code text} into a sequence of bytes using the named charset - * and returns the result as a {@code ByteString}. - * - * @param text source string - * @param charsetName encoding to use - * @return new {@code ByteString} - * @throws UnsupportedEncodingException if the encoding isn't found - */ - public static ByteString copyFrom(String text, String charsetName) - throws UnsupportedEncodingException { - return new LiteralByteString(text.getBytes(charsetName)); - } - - /** - * Encodes {@code text} into a sequence of UTF-8 bytes and returns the - * result as a {@code ByteString}. - * - * @param text source string - * @return new {@code ByteString} - */ - public static ByteString copyFromUtf8(String text) { - try { - return new LiteralByteString(text.getBytes("UTF-8")); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("UTF-8 not supported?", e); - } - } - - // ================================================================= - // InputStream -> ByteString - - /** - * Completely reads the given stream's bytes into a - * {@code ByteString}, blocking if necessary until all bytes are - * read through to the end of the stream. - * - * Performance notes: The returned {@code ByteString} is an - * immutable tree of byte arrays ("chunks") of the stream data. The - * first chunk is small, with subsequent chunks each being double - * the size, up to 8K. If the caller knows the precise length of - * the stream and wishes to avoid all unnecessary copies and - * allocations, consider using the two-argument version of this - * method, below. - * - * @param streamToDrain The source stream, which is read completely - * but not closed. - * @return A new {@code ByteString} which is made up of chunks of - * various sizes, depending on the behavior of the underlying - * stream. - * @throws IOException IOException is thrown if there is a problem - * reading the underlying stream. - */ - public static ByteString readFrom(InputStream streamToDrain) - throws IOException { - return readFrom( - streamToDrain, MIN_READ_FROM_CHUNK_SIZE, MAX_READ_FROM_CHUNK_SIZE); - } - - /** - * Completely reads the given stream's bytes into a - * {@code ByteString}, blocking if necessary until all bytes are - * read through to the end of the stream. - * - * Performance notes: The returned {@code ByteString} is an - * immutable tree of byte arrays ("chunks") of the stream data. The - * chunkSize parameter sets the size of these byte arrays. In - * particular, if the chunkSize is precisely the same as the length - * of the stream, unnecessary allocations and copies will be - * avoided. Otherwise, the chunks will be of the given size, except - * for the last chunk, which will be resized (via a reallocation and - * copy) to contain the remainder of the stream. - * - * @param streamToDrain The source stream, which is read completely - * but not closed. - * @param chunkSize The size of the chunks in which to read the - * stream. - * @return A new {@code ByteString} which is made up of chunks of - * the given size. - * @throws IOException IOException is thrown if there is a problem - * reading the underlying stream. - */ - public static ByteString readFrom(InputStream streamToDrain, int chunkSize) - throws IOException { - return readFrom(streamToDrain, chunkSize, chunkSize); - } - - // Helper method that takes the chunk size range as a parameter. - public static ByteString readFrom(InputStream streamToDrain, int minChunkSize, - int maxChunkSize) throws IOException { - Collection results = new ArrayList(); - - // copy the inbound bytes into a list of chunks; the chunk size - // grows exponentially to support both short and long streams. - int chunkSize = minChunkSize; - while (true) { - ByteString chunk = readChunk(streamToDrain, chunkSize); - if (chunk == null) { - break; - } - results.add(chunk); - chunkSize = Math.min(chunkSize * 2, maxChunkSize); - } - - return ByteString.copyFrom(results); - } - - /** - * Blocks until a chunk of the given size can be made from the - * stream, or EOF is reached. Calls read() repeatedly in case the - * given stream implementation doesn't completely fill the given - * buffer in one read() call. - * - * @return A chunk of the desired size, or else a chunk as large as - * was available when end of stream was reached. Returns null if the - * given stream had no more data in it. - */ - private static ByteString readChunk(InputStream in, final int chunkSize) - throws IOException { - final byte[] buf = new byte[chunkSize]; - int bytesRead = 0; - while (bytesRead < chunkSize) { - final int count = in.read(buf, bytesRead, chunkSize - bytesRead); - if (count == -1) { - break; - } - bytesRead += count; - } - - if (bytesRead == 0) { - return null; - } else { - return ByteString.copyFrom(buf, 0, bytesRead); - } - } - - // ================================================================= - // Multiple ByteStrings -> One ByteString - - /** - * Concatenate the given {@code ByteString} to this one. Short concatenations, - * of total size smaller than {@link ByteString#CONCATENATE_BY_COPY_SIZE}, are - * produced by copying the underlying bytes (as per Rope.java, - * BAP95 . In general, the concatenate involves no copying. - * - * @param other string to concatenate - * @return a new {@code ByteString} instance - */ - public ByteString concat(ByteString other) { - int thisSize = size(); - int otherSize = other.size(); - if ((long) thisSize + otherSize >= Integer.MAX_VALUE) { - throw new IllegalArgumentException("ByteString would be too long: " + - thisSize + "+" + otherSize); - } - - return RopeByteString.concatenate(this, other); - } - - /** - * Concatenates all byte strings in the iterable and returns the result. - * This is designed to run in O(list size), not O(total bytes). - * - *

The returned {@code ByteString} is not necessarily a unique object. - * If the list is empty, the returned object is the singleton empty - * {@code ByteString}. If the list has only one element, that - * {@code ByteString} will be returned without copying. - * - * @param byteStrings strings to be concatenated - * @return new {@code ByteString} - */ - public static ByteString copyFrom(Iterable byteStrings) { - Collection collection; - if (!(byteStrings instanceof Collection)) { - collection = new ArrayList(); - for (ByteString byteString : byteStrings) { - collection.add(byteString); - } - } else { - collection = (Collection) byteStrings; - } - ByteString result; - if (collection.isEmpty()) { - result = EMPTY; - } else { - result = balancedConcat(collection.iterator(), collection.size()); - } - return result; - } - - // Internal function used by copyFrom(Iterable). - // Create a balanced concatenation of the next "length" elements from the - // iterable. - private static ByteString balancedConcat(Iterator iterator, - int length) { - assert length >= 1; - ByteString result; - if (length == 1) { - result = iterator.next(); - } else { - int halfLength = length >>> 1; - ByteString left = balancedConcat(iterator, halfLength); - ByteString right = balancedConcat(iterator, length - halfLength); - result = left.concat(right); - } - return result; - } - - // ================================================================= - // ByteString -> byte[] - - /** - * Copies bytes into a buffer at the given offset. - * - * @param target buffer to copy into - * @param offset in the target buffer - * @throws IndexOutOfBoundsException if the offset is negative or too large - */ - public void copyTo(byte[] target, int offset) { - copyTo(target, 0, offset, size()); - } - - /** - * Copies bytes into a buffer. - * - * @param target buffer to copy into - * @param sourceOffset offset within these bytes - * @param targetOffset offset within the target buffer - * @param numberToCopy number of bytes to copy - * @throws IndexOutOfBoundsException if an offset or size is negative or too - * large - */ - public void copyTo(byte[] target, int sourceOffset, int targetOffset, - int numberToCopy) { - if (sourceOffset < 0) { - throw new IndexOutOfBoundsException("Source offset < 0: " + sourceOffset); - } - if (targetOffset < 0) { - throw new IndexOutOfBoundsException("Target offset < 0: " + targetOffset); - } - if (numberToCopy < 0) { - throw new IndexOutOfBoundsException("Length < 0: " + numberToCopy); - } - if (sourceOffset + numberToCopy > size()) { - throw new IndexOutOfBoundsException( - "Source end offset < 0: " + (sourceOffset + numberToCopy)); - } - if (targetOffset + numberToCopy > target.length) { - throw new IndexOutOfBoundsException( - "Target end offset < 0: " + (targetOffset + numberToCopy)); - } - if (numberToCopy > 0) { - copyToInternal(target, sourceOffset, targetOffset, numberToCopy); - } - } - - /** - * Internal (package private) implementation of - * @link{#copyTo(byte[],int,int,int}. - * It assumes that all error checking has already been performed and that - * @code{numberToCopy > 0}. - */ - protected abstract void copyToInternal(byte[] target, int sourceOffset, - int targetOffset, int numberToCopy); - - /** - * Copies bytes into a ByteBuffer. - * - * @param target ByteBuffer to copy into. - * @throws java.nio.ReadOnlyBufferException if the {@code target} is read-only - * @throws java.nio.BufferOverflowException if the {@code target}'s - * remaining() space is not large enough to hold the data. - */ - public abstract void copyTo(ByteBuffer target); - - /** - * Copies bytes to a {@code byte[]}. - * - * @return copied bytes - */ - public byte[] toByteArray() { - int size = size(); - if (size == 0) { - return Internal.EMPTY_BYTE_ARRAY; - } - byte[] result = new byte[size]; - copyToInternal(result, 0, 0, size); - return result; - } - - /** - * Writes the complete contents of this byte string to - * the specified output stream argument. - * - * @param out the output stream to which to write the data. - * @throws IOException if an I/O error occurs. - */ - public abstract void writeTo(OutputStream out) throws IOException; - - /** - * Writes a specified part of this byte string to an output stream. - * - * @param out the output stream to which to write the data. - * @param sourceOffset offset within these bytes - * @param numberToWrite number of bytes to write - * @throws IOException if an I/O error occurs. - * @throws IndexOutOfBoundsException if an offset or size is negative or too - * large - */ - void writeTo(OutputStream out, int sourceOffset, int numberToWrite) - throws IOException { - if (sourceOffset < 0) { - throw new IndexOutOfBoundsException("Source offset < 0: " + sourceOffset); - } - if (numberToWrite < 0) { - throw new IndexOutOfBoundsException("Length < 0: " + numberToWrite); - } - if (sourceOffset + numberToWrite > size()) { - throw new IndexOutOfBoundsException( - "Source end offset exceeded: " + (sourceOffset + numberToWrite)); - } - if (numberToWrite > 0) { - writeToInternal(out, sourceOffset, numberToWrite); - } - - } - - /** - * Internal version of {@link #writeTo(OutputStream,int,int)} that assumes - * all error checking has already been done. - */ - abstract void writeToInternal(OutputStream out, int sourceOffset, - int numberToWrite) throws IOException; - - /** - * Constructs a read-only {@code java.nio.ByteBuffer} whose content - * is equal to the contents of this byte string. - * The result uses the same backing array as the byte string, if possible. - * - * @return wrapped bytes - */ - public abstract ByteBuffer asReadOnlyByteBuffer(); - - /** - * Constructs a list of read-only {@code java.nio.ByteBuffer} objects - * such that the concatenation of their contents is equal to the contents - * of this byte string. The result uses the same backing arrays as the - * byte string. - *

- * By returning a list, implementations of this method may be able to avoid - * copying even when there are multiple backing arrays. - * - * @return a list of wrapped bytes - */ - public abstract List asReadOnlyByteBufferList(); - - /** - * Constructs a new {@code String} by decoding the bytes using the - * specified charset. - * - * @param charsetName encode using this charset - * @return new string - * @throws UnsupportedEncodingException if charset isn't recognized - */ - public abstract String toString(String charsetName) - throws UnsupportedEncodingException; - - // ================================================================= - // UTF-8 decoding - - /** - * Constructs a new {@code String} by decoding the bytes as UTF-8. - * - * @return new string using UTF-8 encoding - */ - public String toStringUtf8() { - try { - return toString("UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("UTF-8 not supported?", e); - } - } - - /** - * Tells whether this {@code ByteString} represents a well-formed UTF-8 - * byte sequence, such that the original bytes can be converted to a - * String object and then round tripped back to bytes without loss. - * - *

More precisely, returns {@code true} whenever:

 {@code
-   * Arrays.equals(byteString.toByteArray(),
-   *     new String(byteString.toByteArray(), "UTF-8").getBytes("UTF-8"))
-   * }
- * - *

This method returns {@code false} for "overlong" byte sequences, - * as well as for 3-byte sequences that would map to a surrogate - * character, in accordance with the restricted definition of UTF-8 - * introduced in Unicode 3.1. Note that the UTF-8 decoder included in - * Oracle's JDK has been modified to also reject "overlong" byte - * sequences, but (as of 2011) still accepts 3-byte surrogate - * character byte sequences. - * - *

See the Unicode Standard,
- * Table 3-6. UTF-8 Bit Distribution,
- * Table 3-7. Well Formed UTF-8 Byte Sequences. - * - * @return whether the bytes in this {@code ByteString} are a - * well-formed UTF-8 byte sequence - */ - public abstract boolean isValidUtf8(); - - /** - * Tells whether the given byte sequence is a well-formed, malformed, or - * incomplete UTF-8 byte sequence. This method accepts and returns a partial - * state result, allowing the bytes for a complete UTF-8 byte sequence to be - * composed from multiple {@code ByteString} segments. - * - * @param state either {@code 0} (if this is the initial decoding operation) - * or the value returned from a call to a partial decoding method for the - * previous bytes - * @param offset offset of the first byte to check - * @param length number of bytes to check - * - * @return {@code -1} if the partial byte sequence is definitely malformed, - * {@code 0} if it is well-formed (no additional input needed), or, if the - * byte sequence is "incomplete", i.e. apparently terminated in the middle of - * a character, an opaque integer "state" value containing enough information - * to decode the character when passed to a subsequent invocation of a - * partial decoding method. - */ - protected abstract int partialIsValidUtf8(int state, int offset, int length); - - // ================================================================= - // equals() and hashCode() - - @Override - public abstract boolean equals(Object o); - - /** - * Return a non-zero hashCode depending only on the sequence of bytes - * in this ByteString. - * - * @return hashCode value for this object - */ - @Override - public abstract int hashCode(); - - // ================================================================= - // Input stream - - /** - * Creates an {@code InputStream} which can be used to read the bytes. - *

- * The {@link InputStream} returned by this method is guaranteed to be - * completely non-blocking. The method {@link InputStream#available()} - * returns the number of bytes remaining in the stream. The methods - * {@link InputStream#read(byte[]), {@link InputStream#read(byte[],int,int)} - * and {@link InputStream#skip(long)} will read/skip as many bytes as are - * available. - *

- * The methods in the returned {@link InputStream} might not be - * thread safe. - * - * @return an input stream that returns the bytes of this byte string. - */ - public abstract InputStream newInput(); - - /** - * Creates a {@link CodedInputStream} which can be used to read the bytes. - * Using this is often more efficient than creating a {@link CodedInputStream} - * that wraps the result of {@link #newInput()}. - * - * @return stream based on wrapped data - */ - public abstract CodedInputStream newCodedInput(); - - // ================================================================= - // Output stream - - /** - * Creates a new {@link Output} with the given initial capacity. Call {@link - * Output#toByteString()} to create the {@code ByteString} instance. - *

- * A {@link ByteString.Output} offers the same functionality as a - * {@link ByteArrayOutputStream}, except that it returns a {@link ByteString} - * rather than a {@code byte} array. - * - * @param initialCapacity estimate of number of bytes to be written - * @return {@code OutputStream} for building a {@code ByteString} - */ - public static Output newOutput(int initialCapacity) { - return new Output(initialCapacity); - } - - /** - * Creates a new {@link Output}. Call {@link Output#toByteString()} to create - * the {@code ByteString} instance. - *

- * A {@link ByteString.Output} offers the same functionality as a - * {@link ByteArrayOutputStream}, except that it returns a {@link ByteString} - * rather than a {@code byte array}. - * - * @return {@code OutputStream} for building a {@code ByteString} - */ - public static Output newOutput() { - return new Output(CONCATENATE_BY_COPY_SIZE); - } - - /** - * Outputs to a {@code ByteString} instance. Call {@link #toByteString()} to - * create the {@code ByteString} instance. - */ - public static final class Output extends OutputStream { - // Implementation note. - // The public methods of this class must be synchronized. ByteStrings - // are guaranteed to be immutable. Without some sort of locking, it could - // be possible for one thread to call toByteSring(), while another thread - // is still modifying the underlying byte array. - - private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; - // argument passed by user, indicating initial capacity. - private final int initialCapacity; - // ByteStrings to be concatenated to create the result - private final ArrayList flushedBuffers; - // Total number of bytes in the ByteStrings of flushedBuffers - private int flushedBuffersTotalBytes; - // Current buffer to which we are writing - private byte[] buffer; - // Location in buffer[] to which we write the next byte. - private int bufferPos; - - /** - * Creates a new ByteString output stream with the specified - * initial capacity. - * - * @param initialCapacity the initial capacity of the output stream. - */ - Output(int initialCapacity) { - if (initialCapacity < 0) { - throw new IllegalArgumentException("Buffer size < 0"); - } - this.initialCapacity = initialCapacity; - this.flushedBuffers = new ArrayList(); - this.buffer = new byte[initialCapacity]; - } - - @Override - public synchronized void write(int b) { - if (bufferPos == buffer.length) { - flushFullBuffer(1); - } - buffer[bufferPos++] = (byte)b; - } - - @Override - public synchronized void write(byte[] b, int offset, int length) { - if (length <= buffer.length - bufferPos) { - // The bytes can fit into the current buffer. - System.arraycopy(b, offset, buffer, bufferPos, length); - bufferPos += length; - } else { - // Use up the current buffer - int copySize = buffer.length - bufferPos; - System.arraycopy(b, offset, buffer, bufferPos, copySize); - offset += copySize; - length -= copySize; - // Flush the buffer, and get a new buffer at least big enough to cover - // what we still need to output - flushFullBuffer(length); - System.arraycopy(b, offset, buffer, 0 /* count */, length); - bufferPos = length; - } - } - - /** - * Creates a byte string. Its size is the current size of this output - * stream and its output has been copied to it. - * - * @return the current contents of this output stream, as a byte string. - */ - public synchronized ByteString toByteString() { - flushLastBuffer(); - return ByteString.copyFrom(flushedBuffers); - } - - /** - * Implement java.util.Arrays.copyOf() for jdk 1.5. - */ - private byte[] copyArray(byte[] buffer, int length) { - byte[] result = new byte[length]; - System.arraycopy(buffer, 0, result, 0, Math.min(buffer.length, length)); - return result; - } - - /** - * Writes the complete contents of this byte array output stream to - * the specified output stream argument. - * - * @param out the output stream to which to write the data. - * @throws IOException if an I/O error occurs. - */ - public void writeTo(OutputStream out) throws IOException { - ByteString[] cachedFlushBuffers; - byte[] cachedBuffer; - int cachedBufferPos; - synchronized (this) { - // Copy the information we need into local variables so as to hold - // the lock for as short a time as possible. - cachedFlushBuffers = - flushedBuffers.toArray(new ByteString[flushedBuffers.size()]); - cachedBuffer = buffer; - cachedBufferPos = bufferPos; - } - for (ByteString byteString : cachedFlushBuffers) { - byteString.writeTo(out); - } - - out.write(copyArray(cachedBuffer, cachedBufferPos)); - } - - /** - * Returns the current size of the output stream. - * - * @return the current size of the output stream - */ - public synchronized int size() { - return flushedBuffersTotalBytes + bufferPos; - } - - /** - * Resets this stream, so that all currently accumulated output in the - * output stream is discarded. The output stream can be used again, - * reusing the already allocated buffer space. - */ - public synchronized void reset() { - flushedBuffers.clear(); - flushedBuffersTotalBytes = 0; - bufferPos = 0; - } - - @Override - public String toString() { - return String.format("", - Integer.toHexString(System.identityHashCode(this)), size()); - } - - /** - * Internal function used by writers. The current buffer is full, and the - * writer needs a new buffer whose size is at least the specified minimum - * size. - */ - private void flushFullBuffer(int minSize) { - flushedBuffers.add(new LiteralByteString(buffer)); - flushedBuffersTotalBytes += buffer.length; - // We want to increase our total capacity by 50%, but as a minimum, - // the new buffer should also at least be >= minSize and - // >= initial Capacity. - int newSize = Math.max(initialCapacity, - Math.max(minSize, flushedBuffersTotalBytes >>> 1)); - buffer = new byte[newSize]; - bufferPos = 0; - } - - /** - * Internal function used by {@link #toByteString()}. The current buffer may - * or may not be full, but it needs to be flushed. - */ - private void flushLastBuffer() { - if (bufferPos < buffer.length) { - if (bufferPos > 0) { - byte[] bufferCopy = copyArray(buffer, bufferPos); - flushedBuffers.add(new LiteralByteString(bufferCopy)); - } - // We reuse this buffer for further writes. - } else { - // Buffer is completely full. Huzzah. - flushedBuffers.add(new LiteralByteString(buffer)); - // 99% of the time, we're not going to use this OutputStream again. - // We set buffer to an empty byte stream so that we're handling this - // case without wasting space. In the rare case that more writes - // *do* occur, this empty buffer will be flushed and an appropriately - // sized new buffer will be created. - buffer = EMPTY_BYTE_ARRAY; - } - flushedBuffersTotalBytes += bufferPos; - bufferPos = 0; - } - } - - /** - * Constructs a new {@code ByteString} builder, which allows you to - * efficiently construct a {@code ByteString} by writing to a {@link - * CodedOutputStream}. Using this is much more efficient than calling {@code - * newOutput()} and wrapping that in a {@code CodedOutputStream}. - * - *

This is package-private because it's a somewhat confusing interface. - * Users can call {@link Message#toByteString()} instead of calling this - * directly. - * - * @param size The target byte size of the {@code ByteString}. You must write - * exactly this many bytes before building the result. - * @return the builder - */ - static CodedBuilder newCodedBuilder(int size) { - return new CodedBuilder(size); - } - - /** See {@link ByteString#newCodedBuilder(int)}. */ - static final class CodedBuilder { - private final CodedOutputStream output; - private final byte[] buffer; - - private CodedBuilder(int size) { - buffer = new byte[size]; - output = CodedOutputStream.newInstance(buffer); - } - - public ByteString build() { - output.checkNoSpaceLeft(); - - // We can be confident that the CodedOutputStream will not modify the - // underlying bytes anymore because it already wrote all of them. So, - // no need to make a copy. - return new LiteralByteString(buffer); - } - - public CodedOutputStream getCodedOutput() { - return output; - } - } - - // ================================================================= - // Methods {@link RopeByteString} needs on instances, which aren't part of the - // public API. - - /** - * Return the depth of the tree representing this {@code ByteString}, if any, - * whose root is this node. If this is a leaf node, return 0. - * - * @return tree depth or zero - */ - protected abstract int getTreeDepth(); - - /** - * Return {@code true} if this ByteString is literal (a leaf node) or a - * flat-enough tree in the sense of {@link RopeByteString}. - * - * @return true if the tree is flat enough - */ - protected abstract boolean isBalanced(); - - /** - * Return the cached hash code if available. - * - * @return value of cached hash code or 0 if not computed yet - */ - protected abstract int peekCachedHashCode(); - - /** - * Compute the hash across the value bytes starting with the given hash, and - * return the result. This is used to compute the hash across strings - * represented as a set of pieces by allowing the hash computation to be - * continued from piece to piece. - * - * @param h starting hash value - * @param offset offset into this value to start looking at data values - * @param length number of data values to include in the hash computation - * @return ending hash value - */ - protected abstract int partialHash(int h, int offset, int length); - - @Override - public String toString() { - return String.format("", - Integer.toHexString(System.identityHashCode(this)), size()); - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedInputStream.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedInputStream.java deleted file mode 100644 index 32b608daa1..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedInputStream.java +++ /dev/null @@ -1,1311 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * Reads and decodes protocol message fields. - * - * This class contains two kinds of methods: methods that read specific - * protocol message constructs and field types (e.g. {@link #readTag()} and - * {@link #readInt32()}) and methods that read low-level values (e.g. - * {@link #readRawVarint32()} and {@link #readRawBytes}). If you are reading - * encoded protocol messages, you should use the former methods, but if you are - * reading some other format of your own design, use the latter. - * - * @author kenton@google.com Kenton Varda - */ -public final class CodedInputStream { - /** - * Create a new CodedInputStream wrapping the given InputStream. - */ - public static CodedInputStream newInstance(final InputStream input) { - return new CodedInputStream(input); - } - - /** - * Create a new CodedInputStream wrapping the given byte array. - */ - public static CodedInputStream newInstance(final byte[] buf) { - return newInstance(buf, 0, buf.length); - } - - /** - * Create a new CodedInputStream wrapping the given byte array slice. - */ - public static CodedInputStream newInstance(final byte[] buf, final int off, - final int len) { - CodedInputStream result = new CodedInputStream(buf, off, len); - try { - // Some uses of CodedInputStream can be more efficient if they know - // exactly how many bytes are available. By pushing the end point of the - // buffer as a limit, we allow them to get this information via - // getBytesUntilLimit(). Pushing a limit that we know is at the end of - // the stream can never hurt, since we can never past that point anyway. - result.pushLimit(len); - } catch (InvalidProtocolBufferException ex) { - // The only reason pushLimit() might throw an exception here is if len - // is negative. Normally pushLimit()'s parameter comes directly off the - // wire, so it's important to catch exceptions in case of corrupt or - // malicious data. However, in this case, we expect that len is not a - // user-supplied value, so we can assume that it being negative indicates - // a programming error. Therefore, throwing an unchecked exception is - // appropriate. - throw new IllegalArgumentException(ex); - } - return result; - } - - /** - * Create a new CodedInputStream wrapping the given ByteBuffer. The data - * starting from the ByteBuffer's current position to its limit will be read. - * The returned CodedInputStream may or may not share the underlying data - * in the ByteBuffer, therefore the ByteBuffer cannot be changed while the - * CodedInputStream is in use. - * Note that the ByteBuffer's position won't be changed by this function. - * Concurrent calls with the same ByteBuffer object are safe if no other - * thread is trying to alter the ByteBuffer's status. - */ - public static CodedInputStream newInstance(ByteBuffer buf) { - if (buf.hasArray()) { - return newInstance(buf.array(), buf.arrayOffset() + buf.position(), - buf.remaining()); - } else { - ByteBuffer temp = buf.duplicate(); - byte[] buffer = new byte[temp.remaining()]; - temp.get(buffer); - return newInstance(buffer); - } - } - - /** - * Create a new CodedInputStream wrapping a LiteralByteString. - */ - static CodedInputStream newInstance(LiteralByteString byteString) { - CodedInputStream result = new CodedInputStream(byteString); - try { - // Some uses of CodedInputStream can be more efficient if they know - // exactly how many bytes are available. By pushing the end point of the - // buffer as a limit, we allow them to get this information via - // getBytesUntilLimit(). Pushing a limit that we know is at the end of - // the stream can never hurt, since we can never past that point anyway. - result.pushLimit(byteString.size()); - } catch (InvalidProtocolBufferException ex) { - // The only reason pushLimit() might throw an exception here is if len - // is negative. Normally pushLimit()'s parameter comes directly off the - // wire, so it's important to catch exceptions in case of corrupt or - // malicious data. However, in this case, we expect that len is not a - // user-supplied value, so we can assume that it being negative indicates - // a programming error. Therefore, throwing an unchecked exception is - // appropriate. - throw new IllegalArgumentException(ex); - } - return result; - } - - // ----------------------------------------------------------------- - - /** - * Attempt to read a field tag, returning zero if we have reached EOF. - * Protocol message parsers use this to read tags, since a protocol message - * may legally end wherever a tag occurs, and zero is not a valid tag number. - */ - public int readTag() throws IOException { - if (isAtEnd()) { - lastTag = 0; - return 0; - } - - lastTag = readRawVarint32(); - if (WireFormat.getTagFieldNumber(lastTag) == 0) { - // If we actually read zero (or any tag number corresponding to field - // number zero), that's not a valid tag. - throw InvalidProtocolBufferException.invalidTag(); - } - return lastTag; - } - - /** - * Verifies that the last call to readTag() returned the given tag value. - * This is used to verify that a nested group ended with the correct - * end tag. - * - * @throws InvalidProtocolBufferException {@code value} does not match the - * last tag. - */ - public void checkLastTagWas(final int value) - throws InvalidProtocolBufferException { - if (lastTag != value) { - throw InvalidProtocolBufferException.invalidEndTag(); - } - } - - public int getLastTag() { - return lastTag; - } - - /** - * Reads and discards a single field, given its tag value. - * - * @return {@code false} if the tag is an endgroup tag, in which case - * nothing is skipped. Otherwise, returns {@code true}. - */ - public boolean skipField(final int tag) throws IOException { - switch (WireFormat.getTagWireType(tag)) { - case WireFormat.WIRETYPE_VARINT: - skipRawVarint(); - return true; - case WireFormat.WIRETYPE_FIXED64: - skipRawBytes(8); - return true; - case WireFormat.WIRETYPE_LENGTH_DELIMITED: - skipRawBytes(readRawVarint32()); - return true; - case WireFormat.WIRETYPE_START_GROUP: - skipMessage(); - checkLastTagWas( - WireFormat.makeTag(WireFormat.getTagFieldNumber(tag), - WireFormat.WIRETYPE_END_GROUP)); - return true; - case WireFormat.WIRETYPE_END_GROUP: - return false; - case WireFormat.WIRETYPE_FIXED32: - skipRawBytes(4); - return true; - default: - throw InvalidProtocolBufferException.invalidWireType(); - } - } - - /** - * Reads a single field and writes it to output in wire format, - * given its tag value. - * - * @return {@code false} if the tag is an endgroup tag, in which case - * nothing is skipped. Otherwise, returns {@code true}. - */ - public boolean skipField(final int tag, final CodedOutputStream output) - throws IOException { - switch (WireFormat.getTagWireType(tag)) { - case WireFormat.WIRETYPE_VARINT: { - long value = readInt64(); - output.writeRawVarint32(tag); - output.writeUInt64NoTag(value); - return true; - } - case WireFormat.WIRETYPE_FIXED64: { - long value = readRawLittleEndian64(); - output.writeRawVarint32(tag); - output.writeFixed64NoTag(value); - return true; - } - case WireFormat.WIRETYPE_LENGTH_DELIMITED: { - ByteString value = readBytes(); - output.writeRawVarint32(tag); - output.writeBytesNoTag(value); - return true; - } - case WireFormat.WIRETYPE_START_GROUP: { - output.writeRawVarint32(tag); - skipMessage(output); - int endtag = WireFormat.makeTag(WireFormat.getTagFieldNumber(tag), - WireFormat.WIRETYPE_END_GROUP); - checkLastTagWas(endtag); - output.writeRawVarint32(endtag); - return true; - } - case WireFormat.WIRETYPE_END_GROUP: { - return false; - } - case WireFormat.WIRETYPE_FIXED32: { - int value = readRawLittleEndian32(); - output.writeRawVarint32(tag); - output.writeFixed32NoTag(value); - return true; - } - default: - throw InvalidProtocolBufferException.invalidWireType(); - } - } - - /** - * Reads and discards an entire message. This will read either until EOF - * or until an endgroup tag, whichever comes first. - */ - public void skipMessage() throws IOException { - while (true) { - final int tag = readTag(); - if (tag == 0 || !skipField(tag)) { - return; - } - } - } - - /** - * Reads an entire message and writes it to output in wire format. - * This will read either until EOF or until an endgroup tag, - * whichever comes first. - */ - public void skipMessage(CodedOutputStream output) throws IOException { - while (true) { - final int tag = readTag(); - if (tag == 0 || !skipField(tag, output)) { - return; - } - } - } - - /** - * Collects the bytes skipped and returns the data in a ByteBuffer. - */ - private class SkippedDataSink implements RefillCallback { - private int lastPos = bufferPos; - private ByteArrayOutputStream byteArrayStream; - - @Override - public void onRefill() { - if (byteArrayStream == null) { - byteArrayStream = new ByteArrayOutputStream(); - } - byteArrayStream.write(buffer, lastPos, bufferPos - lastPos); - lastPos = 0; - } - - /** - * Gets skipped data in a ByteBuffer. This method should only be - * called once. - */ - ByteBuffer getSkippedData() { - if (byteArrayStream == null) { - return ByteBuffer.wrap(buffer, lastPos, bufferPos - lastPos); - } else { - byteArrayStream.write(buffer, lastPos, bufferPos); - return ByteBuffer.wrap(byteArrayStream.toByteArray()); - } - } - } - - - // ----------------------------------------------------------------- - - /** Read a {@code double} field value from the stream. */ - public double readDouble() throws IOException { - return Double.longBitsToDouble(readRawLittleEndian64()); - } - - /** Read a {@code float} field value from the stream. */ - public float readFloat() throws IOException { - return Float.intBitsToFloat(readRawLittleEndian32()); - } - - /** Read a {@code uint64} field value from the stream. */ - public long readUInt64() throws IOException { - return readRawVarint64(); - } - - /** Read an {@code int64} field value from the stream. */ - public long readInt64() throws IOException { - return readRawVarint64(); - } - - /** Read an {@code int32} field value from the stream. */ - public int readInt32() throws IOException { - return readRawVarint32(); - } - - /** Read a {@code fixed64} field value from the stream. */ - public long readFixed64() throws IOException { - return readRawLittleEndian64(); - } - - /** Read a {@code fixed32} field value from the stream. */ - public int readFixed32() throws IOException { - return readRawLittleEndian32(); - } - - /** Read a {@code bool} field value from the stream. */ - public boolean readBool() throws IOException { - return readRawVarint64() != 0; - } - - /** - * Read a {@code string} field value from the stream. - * If the stream contains malformed UTF-8, - * replace the offending bytes with the standard UTF-8 replacement character. - */ - public String readString() throws IOException { - final int size = readRawVarint32(); - if (size <= (bufferSize - bufferPos) && size > 0) { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - final String result = new String(buffer, bufferPos, size, "UTF-8"); - bufferPos += size; - return result; - } else if (size == 0) { - return ""; - } else { - // Slow path: Build a byte array first then copy it. - return new String(readRawBytesSlowPath(size), "UTF-8"); - } - } - - /** - * Read a {@code string} field value from the stream. - * If the stream contains malformed UTF-8, - * throw exception {@link InvalidProtocolBufferException}. - */ - public String readStringRequireUtf8() throws IOException { - final int size = readRawVarint32(); - final byte[] bytes; - int pos = bufferPos; - if (size <= (bufferSize - pos) && size > 0) { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - bytes = buffer; - bufferPos = pos + size; - } else if (size == 0) { - return ""; - } else { - // Slow path: Build a byte array first then copy it. - bytes = readRawBytesSlowPath(size); - pos = 0; - } - // TODO(martinrb): We could save a pass by validating while decoding. - if (!Utf8.isValidUtf8(bytes, pos, pos + size)) { - throw InvalidProtocolBufferException.invalidUtf8(); - } - return new String(bytes, pos, size, "UTF-8"); - } - - /** Read a {@code group} field value from the stream. */ - public void readGroup(final int fieldNumber, - final MessageLite.Builder builder, - final ExtensionRegistryLite extensionRegistry) - throws IOException { - if (recursionDepth >= recursionLimit) { - throw InvalidProtocolBufferException.recursionLimitExceeded(); - } - ++recursionDepth; - builder.mergeFrom(this, extensionRegistry); - checkLastTagWas( - WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); - --recursionDepth; - } - - - /** Read a {@code group} field value from the stream. */ - public T readGroup( - final int fieldNumber, - final Parser parser, - final ExtensionRegistryLite extensionRegistry) - throws IOException { - if (recursionDepth >= recursionLimit) { - throw InvalidProtocolBufferException.recursionLimitExceeded(); - } - ++recursionDepth; - T result = parser.parsePartialFrom(this, extensionRegistry); - checkLastTagWas( - WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP)); - --recursionDepth; - return result; - } - - /** - * Reads a {@code group} field value from the stream and merges it into the - * given {@link UnknownFieldSet}. - * - * @deprecated UnknownFieldSet.Builder now implements MessageLite.Builder, so - * you can just call {@link #readGroup}. - */ - @Deprecated - public void readUnknownGroup(final int fieldNumber, - final MessageLite.Builder builder) - throws IOException { - // We know that UnknownFieldSet will ignore any ExtensionRegistry so it - // is safe to pass null here. (We can't call - // ExtensionRegistry.getEmptyRegistry() because that would make this - // class depend on ExtensionRegistry, which is not part of the lite - // library.) - readGroup(fieldNumber, builder, null); - } - - /** Read an embedded message field value from the stream. */ - public void readMessage(final MessageLite.Builder builder, - final ExtensionRegistryLite extensionRegistry) - throws IOException { - final int length = readRawVarint32(); - if (recursionDepth >= recursionLimit) { - throw InvalidProtocolBufferException.recursionLimitExceeded(); - } - final int oldLimit = pushLimit(length); - ++recursionDepth; - builder.mergeFrom(this, extensionRegistry); - checkLastTagWas(0); - --recursionDepth; - popLimit(oldLimit); - } - - - /** Read an embedded message field value from the stream. */ - public T readMessage( - final Parser parser, - final ExtensionRegistryLite extensionRegistry) - throws IOException { - int length = readRawVarint32(); - if (recursionDepth >= recursionLimit) { - throw InvalidProtocolBufferException.recursionLimitExceeded(); - } - final int oldLimit = pushLimit(length); - ++recursionDepth; - T result = parser.parsePartialFrom(this, extensionRegistry); - checkLastTagWas(0); - --recursionDepth; - popLimit(oldLimit); - return result; - } - - /** Read a {@code bytes} field value from the stream. */ - public ByteString readBytes() throws IOException { - final int size = readRawVarint32(); - if (size <= (bufferSize - bufferPos) && size > 0) { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - final ByteString result = bufferIsImmutable && enableAliasing - ? new BoundedByteString(buffer, bufferPos, size) - : ByteString.copyFrom(buffer, bufferPos, size); - bufferPos += size; - return result; - } else if (size == 0) { - return ByteString.EMPTY; - } else { - // Slow path: Build a byte array first then copy it. - return new LiteralByteString(readRawBytesSlowPath(size)); - } - } - - /** Read a {@code bytes} field value from the stream. */ - public byte[] readByteArray() throws IOException { - final int size = readRawVarint32(); - if (size <= (bufferSize - bufferPos) && size > 0) { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - final byte[] result = - Arrays.copyOfRange(buffer, bufferPos, bufferPos + size); - bufferPos += size; - return result; - } else { - // Slow path: Build a byte array first then copy it. - return readRawBytesSlowPath(size); - } - } - - /** Read a {@code bytes} field value from the stream. */ - public ByteBuffer readByteBuffer() throws IOException { - final int size = readRawVarint32(); - if (size <= (bufferSize - bufferPos) && size > 0) { - // Fast path: We already have the bytes in a contiguous buffer. - // When aliasing is enabled, we can return a ByteBuffer pointing directly - // into the underlying byte array without copy if the CodedInputStream is - // constructed from a byte array. If aliasing is disabled or the input is - // from an InputStream or ByteString, we have to make a copy of the bytes. - ByteBuffer result = input == null && !bufferIsImmutable && enableAliasing - ? ByteBuffer.wrap(buffer, bufferPos, size).slice() - : ByteBuffer.wrap(Arrays.copyOfRange( - buffer, bufferPos, bufferPos + size)); - bufferPos += size; - return result; - } else if (size == 0) { - return Internal.EMPTY_BYTE_BUFFER; - } else { - // Slow path: Build a byte array first then copy it. - return ByteBuffer.wrap(readRawBytesSlowPath(size)); - } - } - - /** Read a {@code uint32} field value from the stream. */ - public int readUInt32() throws IOException { - return readRawVarint32(); - } - - /** - * Read an enum field value from the stream. Caller is responsible - * for converting the numeric value to an actual enum. - */ - public int readEnum() throws IOException { - return readRawVarint32(); - } - - /** Read an {@code sfixed32} field value from the stream. */ - public int readSFixed32() throws IOException { - return readRawLittleEndian32(); - } - - /** Read an {@code sfixed64} field value from the stream. */ - public long readSFixed64() throws IOException { - return readRawLittleEndian64(); - } - - /** Read an {@code sint32} field value from the stream. */ - public int readSInt32() throws IOException { - return decodeZigZag32(readRawVarint32()); - } - - /** Read an {@code sint64} field value from the stream. */ - public long readSInt64() throws IOException { - return decodeZigZag64(readRawVarint64()); - } - - // ================================================================= - - /** - * Read a raw Varint from the stream. If larger than 32 bits, discard the - * upper bits. - */ - public int readRawVarint32() throws IOException { - // See implementation notes for readRawVarint64 - fastpath: { - int pos = bufferPos; - - if (bufferSize == pos) { - break fastpath; - } - - final byte[] buffer = this.buffer; - int x; - if ((x = buffer[pos++]) >= 0) { - bufferPos = pos; - return x; - } else if (bufferSize - pos < 9) { - break fastpath; - } else if ((x ^= (buffer[pos++] << 7)) < 0L) { - x ^= (~0L << 7); - } else if ((x ^= (buffer[pos++] << 14)) >= 0L) { - x ^= (~0L << 7) ^ (~0L << 14); - } else if ((x ^= (buffer[pos++] << 21)) < 0L) { - x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21); - } else { - int y = buffer[pos++]; - x ^= y << 28; - x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28); - if (y < 0 && - buffer[pos++] < 0 && - buffer[pos++] < 0 && - buffer[pos++] < 0 && - buffer[pos++] < 0 && - buffer[pos++] < 0) { - break fastpath; // Will throw malformedVarint() - } - } - bufferPos = pos; - return x; - } - return (int) readRawVarint64SlowPath(); - } - - private void skipRawVarint() throws IOException { - if (bufferSize - bufferPos >= 10) { - final byte[] buffer = this.buffer; - int pos = bufferPos; - for (int i = 0; i < 10; i++) { - if (buffer[pos++] >= 0) { - bufferPos = pos; - return; - } - } - } - skipRawVarintSlowPath(); - } - - private void skipRawVarintSlowPath() throws IOException { - for (int i = 0; i < 10; i++) { - if (readRawByte() >= 0) { - return; - } - } - throw InvalidProtocolBufferException.malformedVarint(); - } - - /** - * Reads a varint from the input one byte at a time, so that it does not - * read any bytes after the end of the varint. If you simply wrapped the - * stream in a CodedInputStream and used {@link #readRawVarint32(InputStream)} - * then you would probably end up reading past the end of the varint since - * CodedInputStream buffers its input. - */ - static int readRawVarint32(final InputStream input) throws IOException { - final int firstByte = input.read(); - if (firstByte == -1) { - throw InvalidProtocolBufferException.truncatedMessage(); - } - return readRawVarint32(firstByte, input); - } - - /** - * Like {@link #readRawVarint32(InputStream)}, but expects that the caller - * has already read one byte. This allows the caller to determine if EOF - * has been reached before attempting to read. - */ - public static int readRawVarint32( - final int firstByte, final InputStream input) throws IOException { - if ((firstByte & 0x80) == 0) { - return firstByte; - } - - int result = firstByte & 0x7f; - int offset = 7; - for (; offset < 32; offset += 7) { - final int b = input.read(); - if (b == -1) { - throw InvalidProtocolBufferException.truncatedMessage(); - } - result |= (b & 0x7f) << offset; - if ((b & 0x80) == 0) { - return result; - } - } - // Keep reading up to 64 bits. - for (; offset < 64; offset += 7) { - final int b = input.read(); - if (b == -1) { - throw InvalidProtocolBufferException.truncatedMessage(); - } - if ((b & 0x80) == 0) { - return result; - } - } - throw InvalidProtocolBufferException.malformedVarint(); - } - - /** Read a raw Varint from the stream. */ - public long readRawVarint64() throws IOException { - // Implementation notes: - // - // Optimized for one-byte values, expected to be common. - // The particular code below was selected from various candidates - // empirically, by winning VarintBenchmark. - // - // Sign extension of (signed) Java bytes is usually a nuisance, but - // we exploit it here to more easily obtain the sign of bytes read. - // Instead of cleaning up the sign extension bits by masking eagerly, - // we delay until we find the final (positive) byte, when we clear all - // accumulated bits with one xor. We depend on javac to constant fold. - fastpath: { - int pos = bufferPos; - - if (bufferSize == pos) { - break fastpath; - } - - final byte[] buffer = this.buffer; - long x; - int y; - if ((y = buffer[pos++]) >= 0) { - bufferPos = pos; - return y; - } else if (bufferSize - pos < 9) { - break fastpath; - } else if ((x = y ^ (buffer[pos++] << 7)) < 0L) { - x ^= (~0L << 7); - } else if ((x ^= (buffer[pos++] << 14)) >= 0L) { - x ^= (~0L << 7) ^ (~0L << 14); - } else if ((x ^= (buffer[pos++] << 21)) < 0L) { - x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21); - } else if ((x ^= ((long) buffer[pos++] << 28)) >= 0L) { - x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28); - } else if ((x ^= ((long) buffer[pos++] << 35)) < 0L) { - x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35); - } else if ((x ^= ((long) buffer[pos++] << 42)) >= 0L) { - x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42); - } else if ((x ^= ((long) buffer[pos++] << 49)) < 0L) { - x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42) - ^ (~0L << 49); - } else { - x ^= ((long) buffer[pos++] << 56); - x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42) - ^ (~0L << 49) ^ (~0L << 56); - if (x < 0L) { - if (buffer[pos++] < 0L) { - break fastpath; // Will throw malformedVarint() - } - } - } - bufferPos = pos; - return x; - } - return readRawVarint64SlowPath(); - } - - /** Variant of readRawVarint64 for when uncomfortably close to the limit. */ - /* Visible for testing */ - long readRawVarint64SlowPath() throws IOException { - long result = 0; - for (int shift = 0; shift < 64; shift += 7) { - final byte b = readRawByte(); - result |= (long) (b & 0x7F) << shift; - if ((b & 0x80) == 0) { - return result; - } - } - throw InvalidProtocolBufferException.malformedVarint(); - } - - /** Read a 32-bit little-endian integer from the stream. */ - public int readRawLittleEndian32() throws IOException { - int pos = bufferPos; - - // hand-inlined ensureAvailable(4); - if (bufferSize - pos < 4) { - refillBuffer(4); - pos = bufferPos; - } - - final byte[] buffer = this.buffer; - bufferPos = pos + 4; - return (((buffer[pos] & 0xff)) | - ((buffer[pos + 1] & 0xff) << 8) | - ((buffer[pos + 2] & 0xff) << 16) | - ((buffer[pos + 3] & 0xff) << 24)); - } - - /** Read a 64-bit little-endian integer from the stream. */ - public long readRawLittleEndian64() throws IOException { - int pos = bufferPos; - - // hand-inlined ensureAvailable(8); - if (bufferSize - pos < 8) { - refillBuffer(8); - pos = bufferPos; - } - - final byte[] buffer = this.buffer; - bufferPos = pos + 8; - return ((((long) buffer[pos] & 0xffL)) | - (((long) buffer[pos + 1] & 0xffL) << 8) | - (((long) buffer[pos + 2] & 0xffL) << 16) | - (((long) buffer[pos + 3] & 0xffL) << 24) | - (((long) buffer[pos + 4] & 0xffL) << 32) | - (((long) buffer[pos + 5] & 0xffL) << 40) | - (((long) buffer[pos + 6] & 0xffL) << 48) | - (((long) buffer[pos + 7] & 0xffL) << 56)); - } - - /** - * Decode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n An unsigned 32-bit integer, stored in a signed int because - * Java has no explicit unsigned support. - * @return A signed 32-bit integer. - */ - public static int decodeZigZag32(final int n) { - return (n >>> 1) ^ -(n & 1); - } - - /** - * Decode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n An unsigned 64-bit integer, stored in a signed int because - * Java has no explicit unsigned support. - * @return A signed 64-bit integer. - */ - public static long decodeZigZag64(final long n) { - return (n >>> 1) ^ -(n & 1); - } - - // ----------------------------------------------------------------- - - private final byte[] buffer; - private final boolean bufferIsImmutable; - private int bufferSize; - private int bufferSizeAfterLimit; - private int bufferPos; - private final InputStream input; - private int lastTag; - private boolean enableAliasing = false; - - /** - * The total number of bytes read before the current buffer. The total - * bytes read up to the current position can be computed as - * {@code totalBytesRetired + bufferPos}. This value may be negative if - * reading started in the middle of the current buffer (e.g. if the - * constructor that takes a byte array and an offset was used). - */ - private int totalBytesRetired; - - /** The absolute position of the end of the current message. */ - private int currentLimit = Integer.MAX_VALUE; - - /** See setRecursionLimit() */ - private int recursionDepth; - private int recursionLimit = DEFAULT_RECURSION_LIMIT; - - /** See setSizeLimit() */ - private int sizeLimit = DEFAULT_SIZE_LIMIT; - - private static final int DEFAULT_RECURSION_LIMIT = 64; - private static final int DEFAULT_SIZE_LIMIT = 64 << 20; // 64MB - private static final int BUFFER_SIZE = 4096; - - private CodedInputStream(final byte[] buffer, final int off, final int len) { - this.buffer = buffer; - bufferSize = off + len; - bufferPos = off; - totalBytesRetired = -off; - input = null; - bufferIsImmutable = false; - } - - private CodedInputStream(final InputStream input) { - buffer = new byte[BUFFER_SIZE]; - bufferSize = 0; - bufferPos = 0; - totalBytesRetired = 0; - this.input = input; - bufferIsImmutable = false; - } - - private CodedInputStream(final LiteralByteString byteString) { - buffer = byteString.bytes; - bufferPos = byteString.getOffsetIntoBytes(); - bufferSize = bufferPos + byteString.size(); - totalBytesRetired = -bufferPos; - input = null; - bufferIsImmutable = true; - } - - public void enableAliasing(boolean enabled) { - this.enableAliasing = enabled; - } - - /** - * Set the maximum message recursion depth. In order to prevent malicious - * messages from causing stack overflows, {@code CodedInputStream} limits - * how deeply messages may be nested. The default limit is 64. - * - * @return the old limit. - */ - public int setRecursionLimit(final int limit) { - if (limit < 0) { - throw new IllegalArgumentException( - "Recursion limit cannot be negative: " + limit); - } - final int oldLimit = recursionLimit; - recursionLimit = limit; - return oldLimit; - } - - /** - * Set the maximum message size. In order to prevent malicious - * messages from exhausting memory or causing integer overflows, - * {@code CodedInputStream} limits how large a message may be. - * The default limit is 64MB. You should set this limit as small - * as you can without harming your app's functionality. Note that - * size limits only apply when reading from an {@code InputStream}, not - * when constructed around a raw byte array (nor with - * {@link ByteString#newCodedInput}). - *

- * If you want to read several messages from a single CodedInputStream, you - * could call {@link #resetSizeCounter()} after each one to avoid hitting the - * size limit. - * - * @return the old limit. - */ - public int setSizeLimit(final int limit) { - if (limit < 0) { - throw new IllegalArgumentException( - "Size limit cannot be negative: " + limit); - } - final int oldLimit = sizeLimit; - sizeLimit = limit; - return oldLimit; - } - - /** - * Resets the current size counter to zero (see {@link #setSizeLimit(int)}). - */ - public void resetSizeCounter() { - totalBytesRetired = -bufferPos; - } - - /** - * Sets {@code currentLimit} to (current position) + {@code byteLimit}. This - * is called when descending into a length-delimited embedded message. - * - *

Note that {@code pushLimit()} does NOT affect how many bytes the - * {@code CodedInputStream} reads from an underlying {@code InputStream} when - * refreshing its buffer. If you need to prevent reading past a certain - * point in the underlying {@code InputStream} (e.g. because you expect it to - * contain more data after the end of the message which you need to handle - * differently) then you must place a wrapper around your {@code InputStream} - * which limits the amount of data that can be read from it. - * - * @return the old limit. - */ - public int pushLimit(int byteLimit) throws InvalidProtocolBufferException { - if (byteLimit < 0) { - throw InvalidProtocolBufferException.negativeSize(); - } - byteLimit += totalBytesRetired + bufferPos; - final int oldLimit = currentLimit; - if (byteLimit > oldLimit) { - throw InvalidProtocolBufferException.truncatedMessage(); - } - currentLimit = byteLimit; - - recomputeBufferSizeAfterLimit(); - - return oldLimit; - } - - private void recomputeBufferSizeAfterLimit() { - bufferSize += bufferSizeAfterLimit; - final int bufferEnd = totalBytesRetired + bufferSize; - if (bufferEnd > currentLimit) { - // Limit is in current buffer. - bufferSizeAfterLimit = bufferEnd - currentLimit; - bufferSize -= bufferSizeAfterLimit; - } else { - bufferSizeAfterLimit = 0; - } - } - - /** - * Discards the current limit, returning to the previous limit. - * - * @param oldLimit The old limit, as returned by {@code pushLimit}. - */ - public void popLimit(final int oldLimit) { - currentLimit = oldLimit; - recomputeBufferSizeAfterLimit(); - } - - /** - * Returns the number of bytes to be read before the current limit. - * If no limit is set, returns -1. - */ - public int getBytesUntilLimit() { - if (currentLimit == Integer.MAX_VALUE) { - return -1; - } - - final int currentAbsolutePosition = totalBytesRetired + bufferPos; - return currentLimit - currentAbsolutePosition; - } - - /** - * Returns true if the stream has reached the end of the input. This is the - * case if either the end of the underlying input source has been reached or - * if the stream has reached a limit created using {@link #pushLimit(int)}. - */ - public boolean isAtEnd() throws IOException { - return bufferPos == bufferSize && !tryRefillBuffer(1); - } - - /** - * The total bytes read up to the current position. Calling - * {@link #resetSizeCounter()} resets this value to zero. - */ - public int getTotalBytesRead() { - return totalBytesRetired + bufferPos; - } - - private interface RefillCallback { - void onRefill(); - } - - private RefillCallback refillCallback = null; - - /** - * Ensures that at least {@code n} bytes are available in the buffer, reading - * more bytes from the input if necessary to make it so. Caller must ensure - * that the requested space is less than BUFFER_SIZE. - * - * @throws InvalidProtocolBufferException The end of the stream or the current - * limit was reached. - */ - private void ensureAvailable(int n) throws IOException { - if (bufferSize - bufferPos < n) { - refillBuffer(n); - } - } - - /** - * Reads more bytes from the input, making at least {@code n} bytes available - * in the buffer. Caller must ensure that the requested space is not yet - * available, and that the requested space is less than BUFFER_SIZE. - * - * @throws InvalidProtocolBufferException The end of the stream or the current - * limit was reached. - */ - private void refillBuffer(int n) throws IOException { - if (!tryRefillBuffer(n)) { - throw InvalidProtocolBufferException.truncatedMessage(); - } - } - - /** - * Tries to read more bytes from the input, making at least {@code n} bytes - * available in the buffer. Caller must ensure that the requested space is - * not yet available, and that the requested space is less than BUFFER_SIZE. - * - * @return {@code true} if the bytes could be made available; {@code false} - * if the end of the stream or the current limit was reached. - */ - private boolean tryRefillBuffer(int n) throws IOException { - if (bufferPos + n <= bufferSize) { - throw new IllegalStateException( - "refillBuffer() called when " + n + - " bytes were already available in buffer"); - } - - if (totalBytesRetired + bufferPos + n > currentLimit) { - // Oops, we hit a limit. - return false; - } - - if (refillCallback != null) { - refillCallback.onRefill(); - } - - if (input != null) { - int pos = bufferPos; - if (pos > 0) { - if (bufferSize > pos) { - System.arraycopy(buffer, pos, buffer, 0, bufferSize - pos); - } - totalBytesRetired += pos; - bufferSize -= pos; - bufferPos = 0; - } - - int bytesRead = input.read(buffer, bufferSize, buffer.length - bufferSize); - if (bytesRead == 0 || bytesRead < -1 || bytesRead > buffer.length) { - throw new IllegalStateException( - "InputStream#read(byte[]) returned invalid result: " + bytesRead + - "\nThe InputStream implementation is buggy."); - } - if (bytesRead > 0) { - bufferSize += bytesRead; - // Integer-overflow-conscious check against sizeLimit - if (totalBytesRetired + n - sizeLimit > 0) { - throw InvalidProtocolBufferException.sizeLimitExceeded(); - } - recomputeBufferSizeAfterLimit(); - return (bufferSize >= n) ? true : tryRefillBuffer(n); - } - } - - return false; - } - - /** - * Read one byte from the input. - * - * @throws InvalidProtocolBufferException The end of the stream or the current - * limit was reached. - */ - public byte readRawByte() throws IOException { - if (bufferPos == bufferSize) { - refillBuffer(1); - } - return buffer[bufferPos++]; - } - - /** - * Read a fixed size of bytes from the input. - * - * @throws InvalidProtocolBufferException The end of the stream or the current - * limit was reached. - */ - public byte[] readRawBytes(final int size) throws IOException { - final int pos = bufferPos; - if (size <= (bufferSize - pos) && size > 0) { - bufferPos = pos + size; - return Arrays.copyOfRange(buffer, pos, pos + size); - } else { - return readRawBytesSlowPath(size); - } - } - - /** - * Exactly like readRawBytes, but caller must have already checked the fast - * path: (size <= (bufferSize - pos) && size > 0) - */ - private byte[] readRawBytesSlowPath(final int size) throws IOException { - if (size <= 0) { - if (size == 0) { - return Internal.EMPTY_BYTE_ARRAY; - } else { - throw InvalidProtocolBufferException.negativeSize(); - } - } - - if (totalBytesRetired + bufferPos + size > currentLimit) { - // Read to the end of the stream anyway. - skipRawBytes(currentLimit - totalBytesRetired - bufferPos); - // Then fail. - throw InvalidProtocolBufferException.truncatedMessage(); - } - - if (size < BUFFER_SIZE) { - // Reading more bytes than are in the buffer, but not an excessive number - // of bytes. We can safely allocate the resulting array ahead of time. - - // First copy what we have. - final byte[] bytes = new byte[size]; - int pos = bufferSize - bufferPos; - System.arraycopy(buffer, bufferPos, bytes, 0, pos); - bufferPos = bufferSize; - - // We want to refill the buffer and then copy from the buffer into our - // byte array rather than reading directly into our byte array because - // the input may be unbuffered. - ensureAvailable(size - pos); - System.arraycopy(buffer, 0, bytes, pos, size - pos); - bufferPos = size - pos; - - return bytes; - } else { - // The size is very large. For security reasons, we can't allocate the - // entire byte array yet. The size comes directly from the input, so a - // maliciously-crafted message could provide a bogus very large size in - // order to trick the app into allocating a lot of memory. We avoid this - // by allocating and reading only a small chunk at a time, so that the - // malicious message must actually *be* extremely large to cause - // problems. Meanwhile, we limit the allowed size of a message elsewhere. - - // Remember the buffer markers since we'll have to copy the bytes out of - // it later. - final int originalBufferPos = bufferPos; - final int originalBufferSize = bufferSize; - - // Mark the current buffer consumed. - totalBytesRetired += bufferSize; - bufferPos = 0; - bufferSize = 0; - - // Read all the rest of the bytes we need. - int sizeLeft = size - (originalBufferSize - originalBufferPos); - final List chunks = new ArrayList(); - - while (sizeLeft > 0) { - final byte[] chunk = new byte[Math.min(sizeLeft, BUFFER_SIZE)]; - int pos = 0; - while (pos < chunk.length) { - final int n = (input == null) ? -1 : - input.read(chunk, pos, chunk.length - pos); - if (n == -1) { - throw InvalidProtocolBufferException.truncatedMessage(); - } - totalBytesRetired += n; - pos += n; - } - sizeLeft -= chunk.length; - chunks.add(chunk); - } - - // OK, got everything. Now concatenate it all into one buffer. - final byte[] bytes = new byte[size]; - - // Start by copying the leftover bytes from this.buffer. - int pos = originalBufferSize - originalBufferPos; - System.arraycopy(buffer, originalBufferPos, bytes, 0, pos); - - // And now all the chunks. - for (final byte[] chunk : chunks) { - System.arraycopy(chunk, 0, bytes, pos, chunk.length); - pos += chunk.length; - } - - // Done. - return bytes; - } - } - - /** - * Reads and discards {@code size} bytes. - * - * @throws InvalidProtocolBufferException The end of the stream or the current - * limit was reached. - */ - public void skipRawBytes(final int size) throws IOException { - if (size <= (bufferSize - bufferPos) && size >= 0) { - // We have all the bytes we need already. - bufferPos += size; - } else { - skipRawBytesSlowPath(size); - } - } - - /** - * Exactly like skipRawBytes, but caller must have already checked the fast - * path: (size <= (bufferSize - pos) && size >= 0) - */ - private void skipRawBytesSlowPath(final int size) throws IOException { - if (size < 0) { - throw InvalidProtocolBufferException.negativeSize(); - } - - if (totalBytesRetired + bufferPos + size > currentLimit) { - // Read to the end of the stream anyway. - skipRawBytes(currentLimit - totalBytesRetired - bufferPos); - // Then fail. - throw InvalidProtocolBufferException.truncatedMessage(); - } - - // Skipping more bytes than are in the buffer. First skip what we have. - int pos = bufferSize - bufferPos; - bufferPos = bufferSize; - - // Keep refilling the buffer until we get to the point we wanted to skip to. - // This has the side effect of ensuring the limits are updated correctly. - refillBuffer(1); - while (size - pos > bufferSize) { - pos += bufferSize; - bufferPos = bufferSize; - refillBuffer(1); - } - - bufferPos = size - pos; - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedOutputStream.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedOutputStream.java deleted file mode 100644 index 2721b007c7..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/CodedOutputStream.java +++ /dev/null @@ -1,1297 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; - -/** - * Encodes and writes protocol message fields. - * - *

This class contains two kinds of methods: methods that write specific - * protocol message constructs and field types (e.g. {@link #writeTag} and - * {@link #writeInt32}) and methods that write low-level values (e.g. - * {@link #writeRawVarint32} and {@link #writeRawBytes}). If you are - * writing encoded protocol messages, you should use the former methods, but if - * you are writing some other format of your own design, use the latter. - * - *

This class is totally unsynchronized. - * - * @author kneton@google.com Kenton Varda - */ -public final class CodedOutputStream { - private final byte[] buffer; - private final int limit; - private int position; - private int totalBytesWritten = 0; - - private final OutputStream output; - - /** - * The buffer size used in {@link #newInstance(OutputStream)}. - */ - public static final int DEFAULT_BUFFER_SIZE = 4096; - - /** - * Returns the buffer size to efficiently write dataLength bytes to this - * CodedOutputStream. Used by AbstractMessageLite. - * - * @return the buffer size to efficiently write dataLength bytes to this - * CodedOutputStream. - */ - static int computePreferredBufferSize(int dataLength) { - if (dataLength > DEFAULT_BUFFER_SIZE) return DEFAULT_BUFFER_SIZE; - return dataLength; - } - - private CodedOutputStream(final byte[] buffer, final int offset, - final int length) { - output = null; - this.buffer = buffer; - position = offset; - limit = offset + length; - } - - private CodedOutputStream(final OutputStream output, final byte[] buffer) { - this.output = output; - this.buffer = buffer; - position = 0; - limit = buffer.length; - } - - /** - * Create a new {@code CodedOutputStream} wrapping the given - * {@code OutputStream}. - */ - public static CodedOutputStream newInstance(final OutputStream output) { - return newInstance(output, DEFAULT_BUFFER_SIZE); - } - - /** - * Create a new {@code CodedOutputStream} wrapping the given - * {@code OutputStream} with a given buffer size. - */ - public static CodedOutputStream newInstance(final OutputStream output, - final int bufferSize) { - return new CodedOutputStream(output, new byte[bufferSize]); - } - - /** - * Create a new {@code CodedOutputStream} that writes directly to the given - * byte array. If more bytes are written than fit in the array, - * {@link OutOfSpaceException} will be thrown. Writing directly to a flat - * array is faster than writing to an {@code OutputStream}. See also - * {@link ByteString#newCodedBuilder}. - */ - public static CodedOutputStream newInstance(final byte[] flatArray) { - return newInstance(flatArray, 0, flatArray.length); - } - - /** - * Create a new {@code CodedOutputStream} that writes directly to the given - * byte array slice. If more bytes are written than fit in the slice, - * {@link OutOfSpaceException} will be thrown. Writing directly to a flat - * array is faster than writing to an {@code OutputStream}. See also - * {@link ByteString#newCodedBuilder}. - */ - public static CodedOutputStream newInstance(final byte[] flatArray, - final int offset, - final int length) { - return new CodedOutputStream(flatArray, offset, length); - } - - /** - * Create a new {@code CodedOutputStream} that writes to the given ByteBuffer. - */ - public static CodedOutputStream newInstance(ByteBuffer byteBuffer) { - return newInstance(byteBuffer, DEFAULT_BUFFER_SIZE); - } - - /** - * Create a new {@code CodedOutputStream} that writes to the given ByteBuffer. - */ - public static CodedOutputStream newInstance(ByteBuffer byteBuffer, - int bufferSize) { - return newInstance(new ByteBufferOutputStream(byteBuffer), bufferSize); - } - - private static class ByteBufferOutputStream extends OutputStream { - private final ByteBuffer byteBuffer; - public ByteBufferOutputStream(ByteBuffer byteBuffer) { - this.byteBuffer = byteBuffer; - } - - @Override - public void write(int b) throws IOException { - byteBuffer.put((byte) b); - } - - @Override - public void write(byte[] data, int offset, int length) throws IOException { - byteBuffer.put(data, offset, length); - } - } - - // ----------------------------------------------------------------- - - /** Write a {@code double} field, including tag, to the stream. */ - public void writeDouble(final int fieldNumber, final double value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64); - writeDoubleNoTag(value); - } - - /** Write a {@code float} field, including tag, to the stream. */ - public void writeFloat(final int fieldNumber, final float value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED32); - writeFloatNoTag(value); - } - - /** Write a {@code uint64} field, including tag, to the stream. */ - public void writeUInt64(final int fieldNumber, final long value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); - writeUInt64NoTag(value); - } - - /** Write an {@code int64} field, including tag, to the stream. */ - public void writeInt64(final int fieldNumber, final long value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); - writeInt64NoTag(value); - } - - /** Write an {@code int32} field, including tag, to the stream. */ - public void writeInt32(final int fieldNumber, final int value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); - writeInt32NoTag(value); - } - - /** Write a {@code fixed64} field, including tag, to the stream. */ - public void writeFixed64(final int fieldNumber, final long value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64); - writeFixed64NoTag(value); - } - - /** Write a {@code fixed32} field, including tag, to the stream. */ - public void writeFixed32(final int fieldNumber, final int value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED32); - writeFixed32NoTag(value); - } - - /** Write a {@code bool} field, including tag, to the stream. */ - public void writeBool(final int fieldNumber, final boolean value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); - writeBoolNoTag(value); - } - - /** Write a {@code string} field, including tag, to the stream. */ - public void writeString(final int fieldNumber, final String value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); - writeStringNoTag(value); - } - - /** Write a {@code group} field, including tag, to the stream. */ - public void writeGroup(final int fieldNumber, final MessageLite value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_START_GROUP); - writeGroupNoTag(value); - writeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP); - } - - - /** - * Write a group represented by an {@link UnknownFieldSet}. - * - * @deprecated UnknownFieldSet now implements MessageLite, so you can just - * call {@link #writeGroup}. - */ - @Deprecated - public void writeUnknownGroup(final int fieldNumber, - final MessageLite value) - throws IOException { - writeGroup(fieldNumber, value); - } - - /** Write an embedded message field, including tag, to the stream. */ - public void writeMessage(final int fieldNumber, final MessageLite value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); - writeMessageNoTag(value); - } - - - /** Write a {@code bytes} field, including tag, to the stream. */ - public void writeBytes(final int fieldNumber, final ByteString value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); - writeBytesNoTag(value); - } - - /** Write a {@code bytes} field, including tag, to the stream. */ - public void writeByteArray(final int fieldNumber, final byte[] value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); - writeByteArrayNoTag(value); - } - - /** Write a {@code bytes} field, including tag, to the stream. */ - public void writeByteArray(final int fieldNumber, - final byte[] value, - final int offset, - final int length) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); - writeByteArrayNoTag(value, offset, length); - } - - /** - * Write a {@code bytes} field, including tag, to the stream. - * This method will write all content of the ByteBuffer regardless of the - * current position and limit (i.e., the number of bytes to be written is - * value.capacity(), not value.remaining()). Furthermore, this method doesn't - * alter the state of the passed-in ByteBuffer. Its position, limit, mark, - * etc. will remain unchanged. If you only want to write the remaining bytes - * of a ByteBuffer, you can call - * {@code writeByteBuffer(fieldNumber, byteBuffer.slice())}. - */ - public void writeByteBuffer(final int fieldNumber, final ByteBuffer value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); - writeByteBufferNoTag(value); - } - - /** Write a {@code uint32} field, including tag, to the stream. */ - public void writeUInt32(final int fieldNumber, final int value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); - writeUInt32NoTag(value); - } - - /** - * Write an enum field, including tag, to the stream. Caller is responsible - * for converting the enum value to its numeric value. - */ - public void writeEnum(final int fieldNumber, final int value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); - writeEnumNoTag(value); - } - - /** Write an {@code sfixed32} field, including tag, to the stream. */ - public void writeSFixed32(final int fieldNumber, final int value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED32); - writeSFixed32NoTag(value); - } - - /** Write an {@code sfixed64} field, including tag, to the stream. */ - public void writeSFixed64(final int fieldNumber, final long value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_FIXED64); - writeSFixed64NoTag(value); - } - - /** Write an {@code sint32} field, including tag, to the stream. */ - public void writeSInt32(final int fieldNumber, final int value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); - writeSInt32NoTag(value); - } - - /** Write an {@code sint64} field, including tag, to the stream. */ - public void writeSInt64(final int fieldNumber, final long value) - throws IOException { - writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); - writeSInt64NoTag(value); - } - - /** - * Write a MessageSet extension field to the stream. For historical reasons, - * the wire format differs from normal fields. - */ - public void writeMessageSetExtension(final int fieldNumber, - final MessageLite value) - throws IOException { - writeTag(WireFormat.MESSAGE_SET_ITEM, WireFormat.WIRETYPE_START_GROUP); - writeUInt32(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber); - writeMessage(WireFormat.MESSAGE_SET_MESSAGE, value); - writeTag(WireFormat.MESSAGE_SET_ITEM, WireFormat.WIRETYPE_END_GROUP); - } - - /** - * Write an unparsed MessageSet extension field to the stream. For - * historical reasons, the wire format differs from normal fields. - */ - public void writeRawMessageSetExtension(final int fieldNumber, - final ByteString value) - throws IOException { - writeTag(WireFormat.MESSAGE_SET_ITEM, WireFormat.WIRETYPE_START_GROUP); - writeUInt32(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber); - writeBytes(WireFormat.MESSAGE_SET_MESSAGE, value); - writeTag(WireFormat.MESSAGE_SET_ITEM, WireFormat.WIRETYPE_END_GROUP); - } - - // ----------------------------------------------------------------- - - /** Write a {@code double} field to the stream. */ - public void writeDoubleNoTag(final double value) throws IOException { - writeRawLittleEndian64(Double.doubleToRawLongBits(value)); - } - - /** Write a {@code float} field to the stream. */ - public void writeFloatNoTag(final float value) throws IOException { - writeRawLittleEndian32(Float.floatToRawIntBits(value)); - } - - /** Write a {@code uint64} field to the stream. */ - public void writeUInt64NoTag(final long value) throws IOException { - writeRawVarint64(value); - } - - /** Write an {@code int64} field to the stream. */ - public void writeInt64NoTag(final long value) throws IOException { - writeRawVarint64(value); - } - - /** Write an {@code int32} field to the stream. */ - public void writeInt32NoTag(final int value) throws IOException { - if (value >= 0) { - writeRawVarint32(value); - } else { - // Must sign-extend. - writeRawVarint64(value); - } - } - - /** Write a {@code fixed64} field to the stream. */ - public void writeFixed64NoTag(final long value) throws IOException { - writeRawLittleEndian64(value); - } - - /** Write a {@code fixed32} field to the stream. */ - public void writeFixed32NoTag(final int value) throws IOException { - writeRawLittleEndian32(value); - } - - /** Write a {@code bool} field to the stream. */ - public void writeBoolNoTag(final boolean value) throws IOException { - writeRawByte(value ? 1 : 0); - } - - /** Write a {@code string} field to the stream. */ - public void writeStringNoTag(final String value) throws IOException { - // Unfortunately there does not appear to be any way to tell Java to encode - // UTF-8 directly into our buffer, so we have to let it create its own byte - // array and then copy. - final byte[] bytes = value.getBytes("UTF-8"); - writeRawVarint32(bytes.length); - writeRawBytes(bytes); - } - - /** Write a {@code group} field to the stream. */ - public void writeGroupNoTag(final MessageLite value) throws IOException { - value.writeTo(this); - } - - - /** - * Write a group represented by an {@link UnknownFieldSet}. - * - * @deprecated UnknownFieldSet now implements MessageLite, so you can just - * call {@link #writeGroupNoTag}. - */ - @Deprecated - public void writeUnknownGroupNoTag(final MessageLite value) - throws IOException { - writeGroupNoTag(value); - } - - /** Write an embedded message field to the stream. */ - public void writeMessageNoTag(final MessageLite value) throws IOException { - writeRawVarint32(value.getSerializedSize()); - value.writeTo(this); - } - - - /** Write a {@code bytes} field to the stream. */ - public void writeBytesNoTag(final ByteString value) throws IOException { - writeRawVarint32(value.size()); - writeRawBytes(value); - } - - /** Write a {@code bytes} field to the stream. */ - public void writeByteArrayNoTag(final byte[] value) throws IOException { - writeRawVarint32(value.length); - writeRawBytes(value); - } - - /** Write a {@code bytes} field to the stream. */ - public void writeByteArrayNoTag(final byte[] value, - final int offset, - final int length) throws IOException { - writeRawVarint32(length); - writeRawBytes(value, offset, length); - } - - /** - * Write a {@code bytes} field to the stream. This method will write all - * content of the ByteBuffer regardless of the current position and limit - * (i.e., the number of bytes to be written is value.capacity(), not - * value.remaining()). Furthermore, this method doesn't alter the state of - * the passed-in ByteBuffer. Its position, limit, mark, etc. will remain - * unchanged. If you only want to write the remaining bytes of a ByteBuffer, - * you can call {@code writeByteBufferNoTag(byteBuffer.slice())}. - */ - public void writeByteBufferNoTag(final ByteBuffer value) throws IOException { - writeRawVarint32(value.capacity()); - writeRawBytes(value); - } - - /** Write a {@code uint32} field to the stream. */ - public void writeUInt32NoTag(final int value) throws IOException { - writeRawVarint32(value); - } - - /** - * Write an enum field to the stream. Caller is responsible - * for converting the enum value to its numeric value. - */ - public void writeEnumNoTag(final int value) throws IOException { - writeInt32NoTag(value); - } - - /** Write an {@code sfixed32} field to the stream. */ - public void writeSFixed32NoTag(final int value) throws IOException { - writeRawLittleEndian32(value); - } - - /** Write an {@code sfixed64} field to the stream. */ - public void writeSFixed64NoTag(final long value) throws IOException { - writeRawLittleEndian64(value); - } - - /** Write an {@code sint32} field to the stream. */ - public void writeSInt32NoTag(final int value) throws IOException { - writeRawVarint32(encodeZigZag32(value)); - } - - /** Write an {@code sint64} field to the stream. */ - public void writeSInt64NoTag(final long value) throws IOException { - writeRawVarint64(encodeZigZag64(value)); - } - - // ================================================================= - - /** - * Compute the number of bytes that would be needed to encode a - * {@code double} field, including tag. - */ - public static int computeDoubleSize(final int fieldNumber, - final double value) { - return computeTagSize(fieldNumber) + computeDoubleSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code float} field, including tag. - */ - public static int computeFloatSize(final int fieldNumber, final float value) { - return computeTagSize(fieldNumber) + computeFloatSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code uint64} field, including tag. - */ - public static int computeUInt64Size(final int fieldNumber, final long value) { - return computeTagSize(fieldNumber) + computeUInt64SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code int64} field, including tag. - */ - public static int computeInt64Size(final int fieldNumber, final long value) { - return computeTagSize(fieldNumber) + computeInt64SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code int32} field, including tag. - */ - public static int computeInt32Size(final int fieldNumber, final int value) { - return computeTagSize(fieldNumber) + computeInt32SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code fixed64} field, including tag. - */ - public static int computeFixed64Size(final int fieldNumber, - final long value) { - return computeTagSize(fieldNumber) + computeFixed64SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code fixed32} field, including tag. - */ - public static int computeFixed32Size(final int fieldNumber, - final int value) { - return computeTagSize(fieldNumber) + computeFixed32SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code bool} field, including tag. - */ - public static int computeBoolSize(final int fieldNumber, - final boolean value) { - return computeTagSize(fieldNumber) + computeBoolSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code string} field, including tag. - */ - public static int computeStringSize(final int fieldNumber, - final String value) { - return computeTagSize(fieldNumber) + computeStringSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code group} field, including tag. - */ - public static int computeGroupSize(final int fieldNumber, - final MessageLite value) { - return computeTagSize(fieldNumber) * 2 + computeGroupSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code group} field represented by an {@code UnknownFieldSet}, including - * tag. - * - * @deprecated UnknownFieldSet now implements MessageLite, so you can just - * call {@link #computeGroupSize}. - */ - @Deprecated - public static int computeUnknownGroupSize(final int fieldNumber, - final MessageLite value) { - return computeGroupSize(fieldNumber, value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * embedded message field, including tag. - */ - public static int computeMessageSize(final int fieldNumber, - final MessageLite value) { - return computeTagSize(fieldNumber) + computeMessageSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code bytes} field, including tag. - */ - public static int computeBytesSize(final int fieldNumber, - final ByteString value) { - return computeTagSize(fieldNumber) + computeBytesSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code bytes} field, including tag. - */ - public static int computeByteArraySize(final int fieldNumber, - final byte[] value) { - return computeTagSize(fieldNumber) + computeByteArraySizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code bytes} field, including tag. - */ - public static int computeByteBufferSize(final int fieldNumber, - final ByteBuffer value) { - return computeTagSize(fieldNumber) + computeByteBufferSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * embedded message in lazy field, including tag. - */ - public static int computeLazyFieldSize(final int fieldNumber, - final LazyFieldLite value) { - return computeTagSize(fieldNumber) + computeLazyFieldSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code uint32} field, including tag. - */ - public static int computeUInt32Size(final int fieldNumber, final int value) { - return computeTagSize(fieldNumber) + computeUInt32SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * enum field, including tag. Caller is responsible for converting the - * enum value to its numeric value. - */ - public static int computeEnumSize(final int fieldNumber, final int value) { - return computeTagSize(fieldNumber) + computeEnumSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code sfixed32} field, including tag. - */ - public static int computeSFixed32Size(final int fieldNumber, - final int value) { - return computeTagSize(fieldNumber) + computeSFixed32SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code sfixed64} field, including tag. - */ - public static int computeSFixed64Size(final int fieldNumber, - final long value) { - return computeTagSize(fieldNumber) + computeSFixed64SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code sint32} field, including tag. - */ - public static int computeSInt32Size(final int fieldNumber, final int value) { - return computeTagSize(fieldNumber) + computeSInt32SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code sint64} field, including tag. - */ - public static int computeSInt64Size(final int fieldNumber, final long value) { - return computeTagSize(fieldNumber) + computeSInt64SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * MessageSet extension to the stream. For historical reasons, - * the wire format differs from normal fields. - */ - public static int computeMessageSetExtensionSize( - final int fieldNumber, final MessageLite value) { - return computeTagSize(WireFormat.MESSAGE_SET_ITEM) * 2 + - computeUInt32Size(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber) + - computeMessageSize(WireFormat.MESSAGE_SET_MESSAGE, value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * unparsed MessageSet extension field to the stream. For - * historical reasons, the wire format differs from normal fields. - */ - public static int computeRawMessageSetExtensionSize( - final int fieldNumber, final ByteString value) { - return computeTagSize(WireFormat.MESSAGE_SET_ITEM) * 2 + - computeUInt32Size(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber) + - computeBytesSize(WireFormat.MESSAGE_SET_MESSAGE, value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * lazily parsed MessageSet extension field to the stream. For - * historical reasons, the wire format differs from normal fields. - */ - public static int computeLazyFieldMessageSetExtensionSize( - final int fieldNumber, final LazyFieldLite value) { - return computeTagSize(WireFormat.MESSAGE_SET_ITEM) * 2 + - computeUInt32Size(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber) + - computeLazyFieldSize(WireFormat.MESSAGE_SET_MESSAGE, value); - } - - // ----------------------------------------------------------------- - - /** - * Compute the number of bytes that would be needed to encode a - * {@code double} field, including tag. - */ - public static int computeDoubleSizeNoTag(final double value) { - return LITTLE_ENDIAN_64_SIZE; - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code float} field, including tag. - */ - public static int computeFloatSizeNoTag(final float value) { - return LITTLE_ENDIAN_32_SIZE; - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code uint64} field, including tag. - */ - public static int computeUInt64SizeNoTag(final long value) { - return computeRawVarint64Size(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code int64} field, including tag. - */ - public static int computeInt64SizeNoTag(final long value) { - return computeRawVarint64Size(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code int32} field, including tag. - */ - public static int computeInt32SizeNoTag(final int value) { - if (value >= 0) { - return computeRawVarint32Size(value); - } else { - // Must sign-extend. - return 10; - } - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code fixed64} field. - */ - public static int computeFixed64SizeNoTag(final long value) { - return LITTLE_ENDIAN_64_SIZE; - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code fixed32} field. - */ - public static int computeFixed32SizeNoTag(final int value) { - return LITTLE_ENDIAN_32_SIZE; - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code bool} field. - */ - public static int computeBoolSizeNoTag(final boolean value) { - return 1; - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code string} field. - */ - public static int computeStringSizeNoTag(final String value) { - try { - final byte[] bytes = value.getBytes("UTF-8"); - return computeRawVarint32Size(bytes.length) + - bytes.length; - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("UTF-8 not supported.", e); - } - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code group} field. - */ - public static int computeGroupSizeNoTag(final MessageLite value) { - return value.getSerializedSize(); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code group} field represented by an {@code UnknownFieldSet}, including - * tag. - * - * @deprecated UnknownFieldSet now implements MessageLite, so you can just - * call {@link #computeUnknownGroupSizeNoTag}. - */ - @Deprecated - public static int computeUnknownGroupSizeNoTag(final MessageLite value) { - return computeGroupSizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an embedded - * message field. - */ - public static int computeMessageSizeNoTag(final MessageLite value) { - final int size = value.getSerializedSize(); - return computeRawVarint32Size(size) + size; - } - - /** - * Compute the number of bytes that would be needed to encode an embedded - * message stored in lazy field. - */ - public static int computeLazyFieldSizeNoTag(final LazyFieldLite value) { - final int size = value.getSerializedSize(); - return computeRawVarint32Size(size) + size; - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code bytes} field. - */ - public static int computeBytesSizeNoTag(final ByteString value) { - return computeRawVarint32Size(value.size()) + - value.size(); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code bytes} field. - */ - public static int computeByteArraySizeNoTag(final byte[] value) { - return computeRawVarint32Size(value.length) + value.length; - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code bytes} field. - */ - public static int computeByteBufferSizeNoTag(final ByteBuffer value) { - return computeRawVarint32Size(value.capacity()) + value.capacity(); - } - - /** - * Compute the number of bytes that would be needed to encode a - * {@code uint32} field. - */ - public static int computeUInt32SizeNoTag(final int value) { - return computeRawVarint32Size(value); - } - - /** - * Compute the number of bytes that would be needed to encode an enum field. - * Caller is responsible for converting the enum value to its numeric value. - */ - public static int computeEnumSizeNoTag(final int value) { - return computeInt32SizeNoTag(value); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code sfixed32} field. - */ - public static int computeSFixed32SizeNoTag(final int value) { - return LITTLE_ENDIAN_32_SIZE; - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code sfixed64} field. - */ - public static int computeSFixed64SizeNoTag(final long value) { - return LITTLE_ENDIAN_64_SIZE; - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code sint32} field. - */ - public static int computeSInt32SizeNoTag(final int value) { - return computeRawVarint32Size(encodeZigZag32(value)); - } - - /** - * Compute the number of bytes that would be needed to encode an - * {@code sint64} field. - */ - public static int computeSInt64SizeNoTag(final long value) { - return computeRawVarint64Size(encodeZigZag64(value)); - } - - // ================================================================= - - /** - * Internal helper that writes the current buffer to the output. The - * buffer position is reset to its initial value when this returns. - */ - private void refreshBuffer() throws IOException { - if (output == null) { - // We're writing to a single buffer. - throw new OutOfSpaceException(); - } - - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - output.write(buffer, 0, position); - position = 0; - } - - /** - * Flushes the stream and forces any buffered bytes to be written. This - * does not flush the underlying OutputStream. - */ - public void flush() throws IOException { - if (output != null) { - refreshBuffer(); - } - } - - /** - * If writing to a flat array, return the space left in the array. - * Otherwise, throws {@code UnsupportedOperationException}. - */ - public int spaceLeft() { - if (output == null) { - return limit - position; - } else { - throw new UnsupportedOperationException( - "spaceLeft() can only be called on CodedOutputStreams that are " + - "writing to a flat array."); - } - } - - /** - * Verifies that {@link #spaceLeft()} returns zero. It's common to create - * a byte array that is exactly big enough to hold a message, then write to - * it with a {@code CodedOutputStream}. Calling {@code checkNoSpaceLeft()} - * after writing verifies that the message was actually as big as expected, - * which can help catch bugs. - */ - public void checkNoSpaceLeft() { - if (spaceLeft() != 0) { - throw new IllegalStateException( - "Did not write as much data as expected."); - } - } - - /** - * If you create a CodedOutputStream around a simple flat array, you must - * not attempt to write more bytes than the array has space. Otherwise, - * this exception will be thrown. - */ - public static class OutOfSpaceException extends IOException { - private static final long serialVersionUID = -6947486886997889499L; - - OutOfSpaceException() { - super("CodedOutputStream was writing to a flat byte array and ran " + - "out of space."); - } - } - - /** - * Get the total number of bytes successfully written to this stream. The - * returned value is not guaranteed to be accurate if exceptions have been - * found in the middle of writing. - */ - public int getTotalBytesWritten() { - return totalBytesWritten; - } - - /** Write a single byte. */ - public void writeRawByte(final byte value) throws IOException { - if (position == limit) { - refreshBuffer(); - } - - buffer[position++] = value; - ++totalBytesWritten; - } - - /** Write a single byte, represented by an integer value. */ - public void writeRawByte(final int value) throws IOException { - writeRawByte((byte) value); - } - - /** Write a byte string. */ - public void writeRawBytes(final ByteString value) throws IOException { - writeRawBytes(value, 0, value.size()); - } - - /** Write an array of bytes. */ - public void writeRawBytes(final byte[] value) throws IOException { - writeRawBytes(value, 0, value.length); - } - - /** - * Write a ByteBuffer. This method will write all content of the ByteBuffer - * regardless of the current position and limit (i.e., the number of bytes - * to be written is value.capacity(), not value.remaining()). Furthermore, - * this method doesn't alter the state of the passed-in ByteBuffer. Its - * position, limit, mark, etc. will remain unchanged. If you only want to - * write the remaining bytes of a ByteBuffer, you can call - * {@code writeRawBytes(byteBuffer.slice())}. - */ - public void writeRawBytes(final ByteBuffer value) throws IOException { - if (value.hasArray()) { - writeRawBytes(value.array(), value.arrayOffset(), value.capacity()); - } else { - ByteBuffer duplicated = value.duplicate(); - duplicated.clear(); - writeRawBytesInternal(duplicated); - } - } - - /** Write a ByteBuffer that isn't backed by an array. */ - private void writeRawBytesInternal(final ByteBuffer value) - throws IOException { - int length = value.remaining(); - if (limit - position >= length) { - // We have room in the current buffer. - value.get(buffer, position, length); - position += length; - totalBytesWritten += length; - } else { - // Write extends past current buffer. Fill the rest of this buffer and - // flush. - final int bytesWritten = limit - position; - value.get(buffer, position, bytesWritten); - length -= bytesWritten; - position = limit; - totalBytesWritten += bytesWritten; - refreshBuffer(); - - // Now deal with the rest. - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - while (length > limit) { - // Copy data into the buffer before writing it to OutputStream. - // TODO(xiaofeng): Introduce ZeroCopyOutputStream to avoid this copy. - value.get(buffer, 0, limit); - output.write(buffer, 0, limit); - length -= limit; - totalBytesWritten += limit; - } - value.get(buffer, 0, length); - position = length; - totalBytesWritten += length; - } - } - - /** Write part of an array of bytes. */ - public void writeRawBytes(final byte[] value, int offset, int length) - throws IOException { - if (limit - position >= length) { - // We have room in the current buffer. - System.arraycopy(value, offset, buffer, position, length); - position += length; - totalBytesWritten += length; - } else { - // Write extends past current buffer. Fill the rest of this buffer and - // flush. - final int bytesWritten = limit - position; - System.arraycopy(value, offset, buffer, position, bytesWritten); - offset += bytesWritten; - length -= bytesWritten; - position = limit; - totalBytesWritten += bytesWritten; - refreshBuffer(); - - // Now deal with the rest. - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - if (length <= limit) { - // Fits in new buffer. - System.arraycopy(value, offset, buffer, 0, length); - position = length; - } else { - // Write is very big. Let's do it all at once. - output.write(value, offset, length); - } - totalBytesWritten += length; - } - } - - /** Write part of a byte string. */ - public void writeRawBytes(final ByteString value, int offset, int length) - throws IOException { - if (limit - position >= length) { - // We have room in the current buffer. - value.copyTo(buffer, offset, position, length); - position += length; - totalBytesWritten += length; - } else { - // Write extends past current buffer. Fill the rest of this buffer and - // flush. - final int bytesWritten = limit - position; - value.copyTo(buffer, offset, position, bytesWritten); - offset += bytesWritten; - length -= bytesWritten; - position = limit; - totalBytesWritten += bytesWritten; - refreshBuffer(); - - // Now deal with the rest. - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - if (length <= limit) { - // Fits in new buffer. - value.copyTo(buffer, offset, 0, length); - position = length; - } else { - value.writeTo(output, offset, length); - } - totalBytesWritten += length; - } - } - - /** Encode and write a tag. */ - public void writeTag(final int fieldNumber, final int wireType) - throws IOException { - writeRawVarint32(WireFormat.makeTag(fieldNumber, wireType)); - } - - /** Compute the number of bytes that would be needed to encode a tag. */ - public static int computeTagSize(final int fieldNumber) { - return computeRawVarint32Size(WireFormat.makeTag(fieldNumber, 0)); - } - - /** - * Encode and write a varint. {@code value} is treated as - * unsigned, so it won't be sign-extended if negative. - */ - public void writeRawVarint32(int value) throws IOException { - while (true) { - if ((value & ~0x7F) == 0) { - writeRawByte(value); - return; - } else { - writeRawByte((value & 0x7F) | 0x80); - value >>>= 7; - } - } - } - - /** - * Compute the number of bytes that would be needed to encode a varint. - * {@code value} is treated as unsigned, so it won't be sign-extended if - * negative. - */ - public static int computeRawVarint32Size(final int value) { - if ((value & (0xffffffff << 7)) == 0) return 1; - if ((value & (0xffffffff << 14)) == 0) return 2; - if ((value & (0xffffffff << 21)) == 0) return 3; - if ((value & (0xffffffff << 28)) == 0) return 4; - return 5; - } - - /** Encode and write a varint. */ - public void writeRawVarint64(long value) throws IOException { - while (true) { - if ((value & ~0x7FL) == 0) { - writeRawByte((int)value); - return; - } else { - writeRawByte(((int)value & 0x7F) | 0x80); - value >>>= 7; - } - } - } - - /** Compute the number of bytes that would be needed to encode a varint. */ - public static int computeRawVarint64Size(final long value) { - if ((value & (0xffffffffffffffffL << 7)) == 0) return 1; - if ((value & (0xffffffffffffffffL << 14)) == 0) return 2; - if ((value & (0xffffffffffffffffL << 21)) == 0) return 3; - if ((value & (0xffffffffffffffffL << 28)) == 0) return 4; - if ((value & (0xffffffffffffffffL << 35)) == 0) return 5; - if ((value & (0xffffffffffffffffL << 42)) == 0) return 6; - if ((value & (0xffffffffffffffffL << 49)) == 0) return 7; - if ((value & (0xffffffffffffffffL << 56)) == 0) return 8; - if ((value & (0xffffffffffffffffL << 63)) == 0) return 9; - return 10; - } - - /** Write a little-endian 32-bit integer. */ - public void writeRawLittleEndian32(final int value) throws IOException { - writeRawByte((value ) & 0xFF); - writeRawByte((value >> 8) & 0xFF); - writeRawByte((value >> 16) & 0xFF); - writeRawByte((value >> 24) & 0xFF); - } - - public static final int LITTLE_ENDIAN_32_SIZE = 4; - - /** Write a little-endian 64-bit integer. */ - public void writeRawLittleEndian64(final long value) throws IOException { - writeRawByte((int)(value ) & 0xFF); - writeRawByte((int)(value >> 8) & 0xFF); - writeRawByte((int)(value >> 16) & 0xFF); - writeRawByte((int)(value >> 24) & 0xFF); - writeRawByte((int)(value >> 32) & 0xFF); - writeRawByte((int)(value >> 40) & 0xFF); - writeRawByte((int)(value >> 48) & 0xFF); - writeRawByte((int)(value >> 56) & 0xFF); - } - - public static final int LITTLE_ENDIAN_64_SIZE = 8; - - /** - * Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n A signed 32-bit integer. - * @return An unsigned 32-bit integer, stored in a signed int because - * Java has no explicit unsigned support. - */ - public static int encodeZigZag32(final int n) { - // Note: the right-shift must be arithmetic - return (n << 1) ^ (n >> 31); - } - - /** - * Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers - * into values that can be efficiently encoded with varint. (Otherwise, - * negative values must be sign-extended to 64 bits to be varint encoded, - * thus always taking 10 bytes on the wire.) - * - * @param n A signed 64-bit integer. - * @return An unsigned 64-bit integer, stored in a signed int because - * Java has no explicit unsigned support. - */ - public static long encodeZigZag64(final long n) { - // Note: the right-shift must be arithmetic - return (n << 1) ^ (n >> 63); - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/ExtensionRegistryLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ExtensionRegistryLite.java deleted file mode 100644 index 5d1e3cdc6e..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/ExtensionRegistryLite.java +++ /dev/null @@ -1,186 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** - * Equivalent to {@link ExtensionRegistry} but supports only "lite" types. - *

- * If all of your types are lite types, then you only need to use - * {@code ExtensionRegistryLite}. Similarly, if all your types are regular - * types, then you only need {@link ExtensionRegistry}. Typically it does not - * make sense to mix the two, since if you have any regular types in your - * program, you then require the full runtime and lose all the benefits of - * the lite runtime, so you might as well make all your types be regular types. - * However, in some cases (e.g. when depending on multiple third-party libraries - * where one uses lite types and one uses regular), you may find yourself - * wanting to mix the two. In this case things get more complicated. - *

- * There are three factors to consider: Whether the type being extended is - * lite, whether the embedded type (in the case of a message-typed extension) - * is lite, and whether the extension itself is lite. Since all three are - * declared in different files, they could all be different. Here are all - * the combinations and which type of registry to use: - *

- *   Extended type     Inner type    Extension         Use registry
- *   =======================================================================
- *   lite              lite          lite              ExtensionRegistryLite
- *   lite              regular       lite              ExtensionRegistry
- *   regular           regular       regular           ExtensionRegistry
- *   all other combinations                            not supported
- * 
- *

- * Note that just as regular types are not allowed to contain lite-type fields, - * they are also not allowed to contain lite-type extensions. This is because - * regular types must be fully accessible via reflection, which in turn means - * that all the inner messages must also support reflection. On the other hand, - * since regular types implement the entire lite interface, there is no problem - * with embedding regular types inside lite types. - * - * @author kenton@google.com Kenton Varda - */ -public class ExtensionRegistryLite { - - // Set true to enable lazy parsing feature for MessageSet. - // - // TODO(xiangl): Now we use a global flag to control whether enable lazy - // parsing feature for MessageSet, which may be too crude for some - // applications. Need to support this feature on smaller granularity. - private static volatile boolean eagerlyParseMessageSets = false; - - public static boolean isEagerlyParseMessageSets() { - return eagerlyParseMessageSets; - } - - public static void setEagerlyParseMessageSets(boolean isEagerlyParse) { - eagerlyParseMessageSets = isEagerlyParse; - } - - /** Construct a new, empty instance. */ - public static ExtensionRegistryLite newInstance() { - return new ExtensionRegistryLite(); - } - - /** Get the unmodifiable singleton empty instance. */ - public static ExtensionRegistryLite getEmptyRegistry() { - return EMPTY; - } - - /** Returns an unmodifiable view of the registry. */ - public ExtensionRegistryLite getUnmodifiable() { - return new ExtensionRegistryLite(this); - } - - /** - * Find an extension by containing type and field number. - * - * @return Information about the extension if found, or {@code null} - * otherwise. - */ - @SuppressWarnings("unchecked") - public - GeneratedMessageLite.GeneratedExtension - findLiteExtensionByNumber( - final ContainingType containingTypeDefaultInstance, - final int fieldNumber) { - return (GeneratedMessageLite.GeneratedExtension) - extensionsByNumber.get( - new ObjectIntPair(containingTypeDefaultInstance, fieldNumber)); - } - - /** Add an extension from a lite generated file to the registry. */ - public final void add( - final GeneratedMessageLite.GeneratedExtension extension) { - extensionsByNumber.put( - new ObjectIntPair(extension.getContainingTypeDefaultInstance(), - extension.getNumber()), - extension); - } - - // ================================================================= - // Private stuff. - - // Constructors are package-private so that ExtensionRegistry can subclass - // this. - - ExtensionRegistryLite() { - this.extensionsByNumber = - new HashMap>(); - } - - ExtensionRegistryLite(ExtensionRegistryLite other) { - if (other == EMPTY) { - this.extensionsByNumber = Collections.emptyMap(); - } else { - this.extensionsByNumber = - Collections.unmodifiableMap(other.extensionsByNumber); - } - } - - private final Map> - extensionsByNumber; - - @SuppressWarnings("UnusedVariable") - private ExtensionRegistryLite(boolean empty) { - this.extensionsByNumber = Collections.emptyMap(); - } - private static final ExtensionRegistryLite EMPTY = - new ExtensionRegistryLite(true); - - /** A (Object, int) pair, used as a map key. */ - private static final class ObjectIntPair { - private final Object object; - private final int number; - - ObjectIntPair(final Object object, final int number) { - this.object = object; - this.number = number; - } - - @Override - public int hashCode() { - return System.identityHashCode(object) * ((1 << 16) - 1) + number; - } - @Override - public boolean equals(final Object obj) { - if (!(obj instanceof ObjectIntPair)) { - return false; - } - final ObjectIntPair other = (ObjectIntPair)obj; - return object == other.object && number == other.number; - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/FieldSet.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/FieldSet.java deleted file mode 100644 index 5c34dfb660..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/FieldSet.java +++ /dev/null @@ -1,905 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * A class which represents an arbitrary set of fields of some message type. - * This is used to implement {@link DynamicMessage}, and also to represent - * extensions in {@link GeneratedMessage}. This class is package-private, - * since outside users should probably be using {@link DynamicMessage}. - * - * @author kenton@google.com Kenton Varda - */ -final class FieldSet> { - /** - * Interface for a FieldDescriptor or lite extension descriptor. This - * prevents FieldSet from depending on {@link Descriptors.FieldDescriptor}. - */ - public interface FieldDescriptorLite> - extends Comparable { - int getNumber(); - WireFormat.FieldType getLiteType(); - WireFormat.JavaType getLiteJavaType(); - boolean isRepeated(); - boolean isPacked(); - Internal.EnumLiteMap getEnumType(); - - // If getLiteJavaType() == MESSAGE, this merges a message object of the - // type into a builder of the type. Returns {@code to}. - MessageLite.Builder internalMergeFrom( - MessageLite.Builder to, MessageLite from); - } - - private final SmallSortedMap fields; - private boolean isImmutable; - private boolean hasLazyField = false; - - /** Construct a new FieldSet. */ - private FieldSet() { - this.fields = SmallSortedMap.newFieldMap(16); - } - - /** - * Construct an empty FieldSet. This is only used to initialize - * DEFAULT_INSTANCE. - */ - private FieldSet(final boolean dummy) { - this.fields = SmallSortedMap.newFieldMap(0); - makeImmutable(); - } - - /** Construct a new FieldSet. */ - public static > - FieldSet newFieldSet() { - return new FieldSet(); - } - - /** Get an immutable empty FieldSet. */ - @SuppressWarnings("unchecked") - public static > - FieldSet emptySet() { - return DEFAULT_INSTANCE; - } - @SuppressWarnings("rawtypes") - private static final FieldSet DEFAULT_INSTANCE = new FieldSet(true); - - /** Make this FieldSet immutable from this point forward. */ - @SuppressWarnings("unchecked") - public void makeImmutable() { - if (isImmutable) { - return; - } - fields.makeImmutable(); - isImmutable = true; - } - - /** - * Returns whether the FieldSet is immutable. This is true if it is the - * {@link #emptySet} or if {@link #makeImmutable} were called. - * - * @return whether the FieldSet is immutable. - */ - public boolean isImmutable() { - return isImmutable; - } - - /** - * Clones the FieldSet. The returned FieldSet will be mutable even if the - * original FieldSet was immutable. - * - * @return the newly cloned FieldSet - */ - @Override - public FieldSet clone() { - // We can't just call fields.clone because List objects in the map - // should not be shared. - FieldSet clone = FieldSet.newFieldSet(); - for (int i = 0; i < fields.getNumArrayEntries(); i++) { - Map.Entry entry = fields.getArrayEntryAt(i); - FieldDescriptorType descriptor = entry.getKey(); - clone.setField(descriptor, entry.getValue()); - } - for (Map.Entry entry : - fields.getOverflowEntries()) { - FieldDescriptorType descriptor = entry.getKey(); - clone.setField(descriptor, entry.getValue()); - } - clone.hasLazyField = hasLazyField; - return clone; - } - - - // ================================================================= - - /** See {@link Message.Builder#clear()}. */ - public void clear() { - fields.clear(); - hasLazyField = false; - } - - /** - * Get a simple map containing all the fields. - */ - public Map getAllFields() { - if (hasLazyField) { - SmallSortedMap result = - SmallSortedMap.newFieldMap(16); - for (int i = 0; i < fields.getNumArrayEntries(); i++) { - cloneFieldEntry(result, fields.getArrayEntryAt(i)); - } - for (Map.Entry entry : - fields.getOverflowEntries()) { - cloneFieldEntry(result, entry); - } - if (fields.isImmutable()) { - result.makeImmutable(); - } - return result; - } - return fields.isImmutable() ? fields : Collections.unmodifiableMap(fields); - } - - private void cloneFieldEntry(Map map, - Map.Entry entry) { - FieldDescriptorType key = entry.getKey(); - Object value = entry.getValue(); - if (value instanceof LazyField) { - map.put(key, ((LazyField) value).getValue()); - } else { - map.put(key, value); - } - } - - /** - * Get an iterator to the field map. This iterator should not be leaked out - * of the protobuf library as it is not protected from mutation when fields - * is not immutable. - */ - public Iterator> iterator() { - if (hasLazyField) { - return new LazyField.LazyIterator( - fields.entrySet().iterator()); - } - return fields.entrySet().iterator(); - } - - /** - * Useful for implementing - * {@link Message#hasField(Descriptors.FieldDescriptor)}. - */ - public boolean hasField(final FieldDescriptorType descriptor) { - if (descriptor.isRepeated()) { - throw new IllegalArgumentException( - "hasField() can only be called on non-repeated fields."); - } - - return fields.get(descriptor) != null; - } - - /** - * Useful for implementing - * {@link Message#getField(Descriptors.FieldDescriptor)}. This method - * returns {@code null} if the field is not set; in this case it is up - * to the caller to fetch the field's default value. - */ - public Object getField(final FieldDescriptorType descriptor) { - Object o = fields.get(descriptor); - if (o instanceof LazyField) { - return ((LazyField) o).getValue(); - } - return o; - } - - /** - * Useful for implementing - * {@link Message.Builder#setField(Descriptors.FieldDescriptor,Object)}. - */ - @SuppressWarnings({"unchecked", "rawtypes"}) - public void setField(final FieldDescriptorType descriptor, - Object value) { - if (descriptor.isRepeated()) { - if (!(value instanceof List)) { - throw new IllegalArgumentException( - "Wrong object type used with protocol message reflection."); - } - - // Wrap the contents in a new list so that the caller cannot change - // the list's contents after setting it. - final List newList = new ArrayList(); - newList.addAll((List) value); - for (final Object element : newList) { - verifyType(descriptor.getLiteType(), element); - } - value = newList; - } else { - verifyType(descriptor.getLiteType(), value); - } - - if (value instanceof LazyField) { - hasLazyField = true; - } - fields.put(descriptor, value); - } - - /** - * Useful for implementing - * {@link Message.Builder#clearField(Descriptors.FieldDescriptor)}. - */ - public void clearField(final FieldDescriptorType descriptor) { - fields.remove(descriptor); - if (fields.isEmpty()) { - hasLazyField = false; - } - } - - /** - * Useful for implementing - * {@link Message#getRepeatedFieldCount(Descriptors.FieldDescriptor)}. - */ - public int getRepeatedFieldCount(final FieldDescriptorType descriptor) { - if (!descriptor.isRepeated()) { - throw new IllegalArgumentException( - "getRepeatedField() can only be called on repeated fields."); - } - - final Object value = getField(descriptor); - if (value == null) { - return 0; - } else { - return ((List) value).size(); - } - } - - /** - * Useful for implementing - * {@link Message#getRepeatedField(Descriptors.FieldDescriptor,int)}. - */ - public Object getRepeatedField(final FieldDescriptorType descriptor, - final int index) { - if (!descriptor.isRepeated()) { - throw new IllegalArgumentException( - "getRepeatedField() can only be called on repeated fields."); - } - - final Object value = getField(descriptor); - - if (value == null) { - throw new IndexOutOfBoundsException(); - } else { - return ((List) value).get(index); - } - } - - /** - * Useful for implementing - * {@link Message.Builder#setRepeatedField(Descriptors.FieldDescriptor,int,Object)}. - */ - @SuppressWarnings("unchecked") - public void setRepeatedField(final FieldDescriptorType descriptor, - final int index, - final Object value) { - if (!descriptor.isRepeated()) { - throw new IllegalArgumentException( - "getRepeatedField() can only be called on repeated fields."); - } - - final Object list = getField(descriptor); - if (list == null) { - throw new IndexOutOfBoundsException(); - } - - verifyType(descriptor.getLiteType(), value); - ((List) list).set(index, value); - } - - /** - * Useful for implementing - * {@link Message.Builder#addRepeatedField(Descriptors.FieldDescriptor,Object)}. - */ - @SuppressWarnings("unchecked") - public void addRepeatedField(final FieldDescriptorType descriptor, - final Object value) { - if (!descriptor.isRepeated()) { - throw new IllegalArgumentException( - "addRepeatedField() can only be called on repeated fields."); - } - - verifyType(descriptor.getLiteType(), value); - - final Object existingValue = getField(descriptor); - List list; - if (existingValue == null) { - list = new ArrayList(); - fields.put(descriptor, list); - } else { - list = (List) existingValue; - } - - list.add(value); - } - - /** - * Verifies that the given object is of the correct type to be a valid - * value for the given field. (For repeated fields, this checks if the - * object is the right type to be one element of the field.) - * - * @throws IllegalArgumentException The value is not of the right type. - */ - private static void verifyType(final WireFormat.FieldType type, - final Object value) { - if (value == null) { - throw new NullPointerException(); - } - - boolean isValid = false; - switch (type.getJavaType()) { - case INT: isValid = value instanceof Integer ; break; - case LONG: isValid = value instanceof Long ; break; - case FLOAT: isValid = value instanceof Float ; break; - case DOUBLE: isValid = value instanceof Double ; break; - case BOOLEAN: isValid = value instanceof Boolean ; break; - case STRING: isValid = value instanceof String ; break; - case BYTE_STRING: - isValid = value instanceof ByteString || value instanceof byte[]; - break; - case ENUM: - // TODO(kenton): Caller must do type checking here, I guess. - isValid = - (value instanceof Integer || value instanceof Internal.EnumLite); - break; - case MESSAGE: - // TODO(kenton): Caller must do type checking here, I guess. - isValid = - (value instanceof MessageLite) || (value instanceof LazyField); - break; - } - - if (!isValid) { - // TODO(kenton): When chaining calls to setField(), it can be hard to - // tell from the stack trace which exact call failed, since the whole - // chain is considered one line of code. It would be nice to print - // more information here, e.g. naming the field. We used to do that. - // But we can't now that FieldSet doesn't use descriptors. Maybe this - // isn't a big deal, though, since it would only really apply when using - // reflection and generally people don't chain reflection setters. - throw new IllegalArgumentException( - "Wrong object type used with protocol message reflection."); - } - } - - // ================================================================= - // Parsing and serialization - - /** - * See {@link Message#isInitialized()}. Note: Since {@code FieldSet} - * itself does not have any way of knowing about required fields that - * aren't actually present in the set, it is up to the caller to check - * that all required fields are present. - */ - public boolean isInitialized() { - for (int i = 0; i < fields.getNumArrayEntries(); i++) { - if (!isInitialized(fields.getArrayEntryAt(i))) { - return false; - } - } - for (final Map.Entry entry : - fields.getOverflowEntries()) { - if (!isInitialized(entry)) { - return false; - } - } - return true; - } - - @SuppressWarnings("unchecked") - private boolean isInitialized( - final Map.Entry entry) { - final FieldDescriptorType descriptor = entry.getKey(); - if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE) { - if (descriptor.isRepeated()) { - for (final MessageLite element: - (List) entry.getValue()) { - if (!element.isInitialized()) { - return false; - } - } - } else { - Object value = entry.getValue(); - if (value instanceof MessageLite) { - if (!((MessageLite) value).isInitialized()) { - return false; - } - } else if (value instanceof LazyField) { - return true; - } else { - throw new IllegalArgumentException( - "Wrong object type used with protocol message reflection."); - } - } - } - return true; - } - - /** - * Given a field type, return the wire type. - * - * @returns One of the {@code WIRETYPE_} constants defined in - * {@link WireFormat}. - */ - static int getWireFormatForFieldType(final WireFormat.FieldType type, - boolean isPacked) { - if (isPacked) { - return WireFormat.WIRETYPE_LENGTH_DELIMITED; - } else { - return type.getWireType(); - } - } - - /** - * Like {@link Message.Builder#mergeFrom(Message)}, but merges from another - * {@link FieldSet}. - */ - public void mergeFrom(final FieldSet other) { - for (int i = 0; i < other.fields.getNumArrayEntries(); i++) { - mergeFromField(other.fields.getArrayEntryAt(i)); - } - for (final Map.Entry entry : - other.fields.getOverflowEntries()) { - mergeFromField(entry); - } - } - - private Object cloneIfMutable(Object value) { - if (value instanceof byte[]) { - byte[] bytes = (byte[]) value; - byte[] copy = new byte[bytes.length]; - System.arraycopy(bytes, 0, copy, 0, bytes.length); - return copy; - } else { - return value; - } - } - - @SuppressWarnings({"unchecked", "rawtypes"}) - private void mergeFromField( - final Map.Entry entry) { - final FieldDescriptorType descriptor = entry.getKey(); - Object otherValue = entry.getValue(); - if (otherValue instanceof LazyField) { - otherValue = ((LazyField) otherValue).getValue(); - } - - if (descriptor.isRepeated()) { - Object value = getField(descriptor); - if (value == null) { - value = new ArrayList(); - } - for (Object element : (List) otherValue) { - ((List) value).add(cloneIfMutable(element)); - } - fields.put(descriptor, value); - } else if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE) { - Object value = getField(descriptor); - if (value == null) { - fields.put(descriptor, cloneIfMutable(otherValue)); - } else { - // Merge the messages. - value = descriptor.internalMergeFrom( - ((MessageLite) value).toBuilder(), (MessageLite) otherValue) - .build(); - - fields.put(descriptor, value); - } - } else { - fields.put(descriptor, cloneIfMutable(otherValue)); - } - } - - // TODO(kenton): Move static parsing and serialization methods into some - // other class. Probably WireFormat. - - /** - * Read a field of any primitive type for immutable messages from a - * CodedInputStream. Enums, groups, and embedded messages are not handled by - * this method. - * - * @param input The stream from which to read. - * @param type Declared type of the field. - * @param checkUtf8 When true, check that the input is valid utf8. - * @return An object representing the field's value, of the exact - * type which would be returned by - * {@link Message#getField(Descriptors.FieldDescriptor)} for - * this field. - */ - public static Object readPrimitiveField( - CodedInputStream input, - final WireFormat.FieldType type, - boolean checkUtf8) throws IOException { - switch (type) { - case DOUBLE : return input.readDouble (); - case FLOAT : return input.readFloat (); - case INT64 : return input.readInt64 (); - case UINT64 : return input.readUInt64 (); - case INT32 : return input.readInt32 (); - case FIXED64 : return input.readFixed64 (); - case FIXED32 : return input.readFixed32 (); - case BOOL : return input.readBool (); - case STRING : if (checkUtf8) { - return input.readStringRequireUtf8(); - } else { - return input.readString(); - } - case BYTES : return input.readBytes (); - case UINT32 : return input.readUInt32 (); - case SFIXED32: return input.readSFixed32(); - case SFIXED64: return input.readSFixed64(); - case SINT32 : return input.readSInt32 (); - case SINT64 : return input.readSInt64 (); - - case GROUP: - throw new IllegalArgumentException( - "readPrimitiveField() cannot handle nested groups."); - case MESSAGE: - throw new IllegalArgumentException( - "readPrimitiveField() cannot handle embedded messages."); - case ENUM: - // We don't handle enums because we don't know what to do if the - // value is not recognized. - throw new IllegalArgumentException( - "readPrimitiveField() cannot handle enums."); - } - - throw new RuntimeException( - "There is no way to get here, but the compiler thinks otherwise."); - } - - - /** See {@link Message#writeTo(CodedOutputStream)}. */ - public void writeTo(final CodedOutputStream output) - throws IOException { - for (int i = 0; i < fields.getNumArrayEntries(); i++) { - final Map.Entry entry = - fields.getArrayEntryAt(i); - writeField(entry.getKey(), entry.getValue(), output); - } - for (final Map.Entry entry : - fields.getOverflowEntries()) { - writeField(entry.getKey(), entry.getValue(), output); - } - } - - /** - * Like {@link #writeTo} but uses MessageSet wire format. - */ - public void writeMessageSetTo(final CodedOutputStream output) - throws IOException { - for (int i = 0; i < fields.getNumArrayEntries(); i++) { - writeMessageSetTo(fields.getArrayEntryAt(i), output); - } - for (final Map.Entry entry : - fields.getOverflowEntries()) { - writeMessageSetTo(entry, output); - } - } - - private void writeMessageSetTo( - final Map.Entry entry, - final CodedOutputStream output) throws IOException { - final FieldDescriptorType descriptor = entry.getKey(); - if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE && - !descriptor.isRepeated() && !descriptor.isPacked()) { - Object value = entry.getValue(); - if (value instanceof LazyField) { - value = ((LazyField) value).getValue(); - } - output.writeMessageSetExtension(entry.getKey().getNumber(), - (MessageLite) value); - } else { - writeField(descriptor, entry.getValue(), output); - } - } - - /** - * Write a single tag-value pair to the stream. - * - * @param output The output stream. - * @param type The field's type. - * @param number The field's number. - * @param value Object representing the field's value. Must be of the exact - * type which would be returned by - * {@link Message#getField(Descriptors.FieldDescriptor)} for - * this field. - */ - private static void writeElement(final CodedOutputStream output, - final WireFormat.FieldType type, - final int number, - final Object value) throws IOException { - // Special case for groups, which need a start and end tag; other fields - // can just use writeTag() and writeFieldNoTag(). - if (type == WireFormat.FieldType.GROUP) { - output.writeGroup(number, (MessageLite) value); - } else { - output.writeTag(number, getWireFormatForFieldType(type, false)); - writeElementNoTag(output, type, value); - } - } - - /** - * Write a field of arbitrary type, without its tag, to the stream. - * - * @param output The output stream. - * @param type The field's type. - * @param value Object representing the field's value. Must be of the exact - * type which would be returned by - * {@link Message#getField(Descriptors.FieldDescriptor)} for - * this field. - */ - private static void writeElementNoTag( - final CodedOutputStream output, - final WireFormat.FieldType type, - final Object value) throws IOException { - switch (type) { - case DOUBLE : output.writeDoubleNoTag ((Double ) value); break; - case FLOAT : output.writeFloatNoTag ((Float ) value); break; - case INT64 : output.writeInt64NoTag ((Long ) value); break; - case UINT64 : output.writeUInt64NoTag ((Long ) value); break; - case INT32 : output.writeInt32NoTag ((Integer ) value); break; - case FIXED64 : output.writeFixed64NoTag ((Long ) value); break; - case FIXED32 : output.writeFixed32NoTag ((Integer ) value); break; - case BOOL : output.writeBoolNoTag ((Boolean ) value); break; - case STRING : output.writeStringNoTag ((String ) value); break; - case GROUP : output.writeGroupNoTag ((MessageLite) value); break; - case MESSAGE : output.writeMessageNoTag ((MessageLite) value); break; - case BYTES: - if (value instanceof ByteString) { - output.writeBytesNoTag((ByteString) value); - } else { - output.writeByteArrayNoTag((byte[]) value); - } - break; - case UINT32 : output.writeUInt32NoTag ((Integer ) value); break; - case SFIXED32: output.writeSFixed32NoTag((Integer ) value); break; - case SFIXED64: output.writeSFixed64NoTag((Long ) value); break; - case SINT32 : output.writeSInt32NoTag ((Integer ) value); break; - case SINT64 : output.writeSInt64NoTag ((Long ) value); break; - - case ENUM: - if (value instanceof Internal.EnumLite) { - output.writeEnumNoTag(((Internal.EnumLite) value).getNumber()); - } else { - output.writeEnumNoTag(((Integer) value).intValue()); - } - break; - } - } - - /** Write a single field. */ - public static void writeField(final FieldDescriptorLite descriptor, - final Object value, - final CodedOutputStream output) - throws IOException { - WireFormat.FieldType type = descriptor.getLiteType(); - int number = descriptor.getNumber(); - if (descriptor.isRepeated()) { - final List valueList = (List)value; - if (descriptor.isPacked()) { - output.writeTag(number, WireFormat.WIRETYPE_LENGTH_DELIMITED); - // Compute the total data size so the length can be written. - int dataSize = 0; - for (final Object element : valueList) { - dataSize += computeElementSizeNoTag(type, element); - } - output.writeRawVarint32(dataSize); - // Write the data itself, without any tags. - for (final Object element : valueList) { - writeElementNoTag(output, type, element); - } - } else { - for (final Object element : valueList) { - writeElement(output, type, number, element); - } - } - } else { - if (value instanceof LazyField) { - writeElement(output, type, number, ((LazyField) value).getValue()); - } else { - writeElement(output, type, number, value); - } - } - } - - /** - * See {@link Message#getSerializedSize()}. It's up to the caller to cache - * the resulting size if desired. - */ - public int getSerializedSize() { - int size = 0; - for (int i = 0; i < fields.getNumArrayEntries(); i++) { - final Map.Entry entry = - fields.getArrayEntryAt(i); - size += computeFieldSize(entry.getKey(), entry.getValue()); - } - for (final Map.Entry entry : - fields.getOverflowEntries()) { - size += computeFieldSize(entry.getKey(), entry.getValue()); - } - return size; - } - - /** - * Like {@link #getSerializedSize} but uses MessageSet wire format. - */ - public int getMessageSetSerializedSize() { - int size = 0; - for (int i = 0; i < fields.getNumArrayEntries(); i++) { - size += getMessageSetSerializedSize(fields.getArrayEntryAt(i)); - } - for (final Map.Entry entry : - fields.getOverflowEntries()) { - size += getMessageSetSerializedSize(entry); - } - return size; - } - - private int getMessageSetSerializedSize( - final Map.Entry entry) { - final FieldDescriptorType descriptor = entry.getKey(); - Object value = entry.getValue(); - if (descriptor.getLiteJavaType() == WireFormat.JavaType.MESSAGE - && !descriptor.isRepeated() && !descriptor.isPacked()) { - if (value instanceof LazyField) { - return CodedOutputStream.computeLazyFieldMessageSetExtensionSize( - entry.getKey().getNumber(), (LazyField) value); - } else { - return CodedOutputStream.computeMessageSetExtensionSize( - entry.getKey().getNumber(), (MessageLite) value); - } - } else { - return computeFieldSize(descriptor, value); - } - } - - /** - * Compute the number of bytes that would be needed to encode a - * single tag/value pair of arbitrary type. - * - * @param type The field's type. - * @param number The field's number. - * @param value Object representing the field's value. Must be of the exact - * type which would be returned by - * {@link Message#getField(Descriptors.FieldDescriptor)} for - * this field. - */ - private static int computeElementSize( - final WireFormat.FieldType type, - final int number, final Object value) { - int tagSize = CodedOutputStream.computeTagSize(number); - if (type == WireFormat.FieldType.GROUP) { - // Only count the end group tag for proto2 messages as for proto1 the end - // group tag will be counted as a part of getSerializedSize(). - tagSize *= 2; - } - return tagSize + computeElementSizeNoTag(type, value); - } - - /** - * Compute the number of bytes that would be needed to encode a - * particular value of arbitrary type, excluding tag. - * - * @param type The field's type. - * @param value Object representing the field's value. Must be of the exact - * type which would be returned by - * {@link Message#getField(Descriptors.FieldDescriptor)} for - * this field. - */ - private static int computeElementSizeNoTag( - final WireFormat.FieldType type, final Object value) { - switch (type) { - // Note: Minor violation of 80-char limit rule here because this would - // actually be harder to read if we wrapped the lines. - case DOUBLE : return CodedOutputStream.computeDoubleSizeNoTag ((Double )value); - case FLOAT : return CodedOutputStream.computeFloatSizeNoTag ((Float )value); - case INT64 : return CodedOutputStream.computeInt64SizeNoTag ((Long )value); - case UINT64 : return CodedOutputStream.computeUInt64SizeNoTag ((Long )value); - case INT32 : return CodedOutputStream.computeInt32SizeNoTag ((Integer )value); - case FIXED64 : return CodedOutputStream.computeFixed64SizeNoTag ((Long )value); - case FIXED32 : return CodedOutputStream.computeFixed32SizeNoTag ((Integer )value); - case BOOL : return CodedOutputStream.computeBoolSizeNoTag ((Boolean )value); - case STRING : return CodedOutputStream.computeStringSizeNoTag ((String )value); - case GROUP : return CodedOutputStream.computeGroupSizeNoTag ((MessageLite)value); - case BYTES : - if (value instanceof ByteString) { - return CodedOutputStream.computeBytesSizeNoTag((ByteString) value); - } else { - return CodedOutputStream.computeByteArraySizeNoTag((byte[]) value); - } - case UINT32 : return CodedOutputStream.computeUInt32SizeNoTag ((Integer )value); - case SFIXED32: return CodedOutputStream.computeSFixed32SizeNoTag((Integer )value); - case SFIXED64: return CodedOutputStream.computeSFixed64SizeNoTag((Long )value); - case SINT32 : return CodedOutputStream.computeSInt32SizeNoTag ((Integer )value); - case SINT64 : return CodedOutputStream.computeSInt64SizeNoTag ((Long )value); - - case MESSAGE: - if (value instanceof LazyField) { - return CodedOutputStream.computeLazyFieldSizeNoTag((LazyField) value); - } else { - return CodedOutputStream.computeMessageSizeNoTag((MessageLite) value); - } - - case ENUM: - if (value instanceof Internal.EnumLite) { - return CodedOutputStream.computeEnumSizeNoTag( - ((Internal.EnumLite) value).getNumber()); - } else { - return CodedOutputStream.computeEnumSizeNoTag((Integer) value); - } - } - - throw new RuntimeException( - "There is no way to get here, but the compiler thinks otherwise."); - } - - /** - * Compute the number of bytes needed to encode a particular field. - */ - public static int computeFieldSize(final FieldDescriptorLite descriptor, - final Object value) { - WireFormat.FieldType type = descriptor.getLiteType(); - int number = descriptor.getNumber(); - if (descriptor.isRepeated()) { - if (descriptor.isPacked()) { - int dataSize = 0; - for (final Object element : (List)value) { - dataSize += computeElementSizeNoTag(type, element); - } - return dataSize + - CodedOutputStream.computeTagSize(number) + - CodedOutputStream.computeRawVarint32Size(dataSize); - } else { - int size = 0; - for (final Object element : (List)value) { - size += computeElementSize(type, number, element); - } - return size; - } - } else { - return computeElementSize(type, number, value); - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/GeneratedMessageLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/GeneratedMessageLite.java deleted file mode 100644 index 5463bb9992..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/GeneratedMessageLite.java +++ /dev/null @@ -1,960 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.IOException; -import java.io.ObjectStreamException; -import java.io.Serializable; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * Lite version of {@link GeneratedMessage}. - * - * @author kenton@google.com Kenton Varda - */ -public abstract class GeneratedMessageLite extends AbstractMessageLite - implements Serializable { - private static final long serialVersionUID = 1L; - - protected GeneratedMessageLite() { - } - - protected GeneratedMessageLite(Builder builder) { - } - - @Override public Parser getParserForType() { - throw new UnsupportedOperationException( - "This is supposed to be overridden by subclasses."); - } - - /** - * Called by subclasses to parse an unknown field. - * @return {@code true} unless the tag is an end-group tag. - */ - protected boolean parseUnknownField( - CodedInputStream input, - CodedOutputStream unknownFieldsCodedOutput, - ExtensionRegistryLite extensionRegistry, - int tag) throws IOException { - return input.skipField(tag, unknownFieldsCodedOutput); - } - - /** - * Used by parsing constructors in generated classes. - */ - protected void makeExtensionsImmutable() { - // Noop for messages without extensions. - } - - @SuppressWarnings("unchecked") - public abstract static class Builder - extends AbstractMessageLite.Builder { - protected Builder() {} - - //@Override (Java 1.6 override semantics, but we must support 1.5) - @Override public BuilderType clear() { - unknownFields = ByteString.EMPTY; - return (BuilderType) this; - } - - // This is implemented here only to work around an apparent bug in the - // Java compiler and/or build system. See bug #1898463. The mere presence - // of this dummy clone() implementation makes it go away. - @Override public BuilderType clone() { - throw new UnsupportedOperationException( - "This is supposed to be overridden by subclasses."); - } - - /** All subclasses implement this. */ - public abstract BuilderType mergeFrom(MessageType message); - - // Defined here for return type covariance. - @Override public abstract MessageType getDefaultInstanceForType(); - - /** - * Called by subclasses to parse an unknown field. - * @return {@code true} unless the tag is an end-group tag. - */ - protected boolean parseUnknownField( - CodedInputStream input, - CodedOutputStream unknownFieldsCodedOutput, - ExtensionRegistryLite extensionRegistry, - int tag) throws IOException { - return input.skipField(tag, unknownFieldsCodedOutput); - } - - public final ByteString getUnknownFields() { - return unknownFields; - } - - public final BuilderType setUnknownFields(final ByteString unknownFields) { - this.unknownFields = unknownFields; - return (BuilderType) this; - } - - private ByteString unknownFields = ByteString.EMPTY; - } - - - // ================================================================= - // Extensions-related stuff - - /** - * Lite equivalent of {@link com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder}. - */ - public interface ExtendableMessageOrBuilder< - MessageType extends ExtendableMessage> extends MessageLiteOrBuilder { - - /** Check if a singular extension is present. */ - boolean hasExtension( - GeneratedExtension extension); - - /** Get the number of elements in a repeated extension. */ - int getExtensionCount( - GeneratedExtension> extension); - - /** Get the value of an extension. */ - Type getExtension(GeneratedExtension extension); - - /** Get one element of a repeated extension. */ - Type getExtension( - GeneratedExtension> extension, - int index); - } - - /** - * Lite equivalent of {@link GeneratedMessage.ExtendableMessage}. - */ - public abstract static class ExtendableMessage< - MessageType extends ExtendableMessage> - extends GeneratedMessageLite - implements ExtendableMessageOrBuilder { - - private final FieldSet extensions; - - protected ExtendableMessage() { - this.extensions = FieldSet.newFieldSet(); - } - - protected ExtendableMessage(ExtendableBuilder builder) { - this.extensions = builder.buildExtensions(); - } - - private void verifyExtensionContainingType( - final GeneratedExtension extension) { - if (extension.getContainingTypeDefaultInstance() != - getDefaultInstanceForType()) { - // This can only happen if someone uses unchecked operations. - throw new IllegalArgumentException( - "This extension is for a different message type. Please make " + - "sure that you are not suppressing any generics type warnings."); - } - } - - /** Check if a singular extension is present. */ - //@Override (Java 1.6 override semantics, but we must support 1.5) - @Override public final boolean hasExtension( - final GeneratedExtension extension) { - verifyExtensionContainingType(extension); - return extensions.hasField(extension.descriptor); - } - - /** Get the number of elements in a repeated extension. */ - //@Override (Java 1.6 override semantics, but we must support 1.5) - @Override public final int getExtensionCount( - final GeneratedExtension> extension) { - verifyExtensionContainingType(extension); - return extensions.getRepeatedFieldCount(extension.descriptor); - } - - /** Get the value of an extension. */ - //@Override (Java 1.6 override semantics, but we must support 1.5) - @SuppressWarnings("unchecked") - @Override public final Type getExtension( - final GeneratedExtension extension) { - verifyExtensionContainingType(extension); - final Object value = extensions.getField(extension.descriptor); - if (value == null) { - return extension.defaultValue; - } else { - return (Type) extension.fromFieldSetType(value); - } - } - - /** Get one element of a repeated extension. */ - //@Override (Java 1.6 override semantics, but we must support 1.5) - @SuppressWarnings("unchecked") - @Override public final Type getExtension( - final GeneratedExtension> extension, - final int index) { - verifyExtensionContainingType(extension); - return (Type) extension.singularFromFieldSetType( - extensions.getRepeatedField(extension.descriptor, index)); - } - - /** Called by subclasses to check if all extensions are initialized. */ - protected boolean extensionsAreInitialized() { - return extensions.isInitialized(); - } - - /** - * Called by subclasses to parse an unknown field or an extension. - * @return {@code true} unless the tag is an end-group tag. - */ - @Override - protected boolean parseUnknownField( - CodedInputStream input, - CodedOutputStream unknownFieldsCodedOutput, - ExtensionRegistryLite extensionRegistry, - int tag) throws IOException { - return GeneratedMessageLite.parseUnknownField( - extensions, - getDefaultInstanceForType(), - input, - unknownFieldsCodedOutput, - extensionRegistry, - tag); - } - - - /** - * Used by parsing constructors in generated classes. - */ - @Override - protected void makeExtensionsImmutable() { - extensions.makeImmutable(); - } - - /** - * Used by subclasses to serialize extensions. Extension ranges may be - * interleaved with field numbers, but we must write them in canonical - * (sorted by field number) order. ExtensionWriter helps us write - * individual ranges of extensions at once. - */ - protected class ExtensionWriter { - // Imagine how much simpler this code would be if Java iterators had - // a way to get the next element without advancing the iterator. - - private final Iterator> iter = - extensions.iterator(); - private Map.Entry next; - private final boolean messageSetWireFormat; - - private ExtensionWriter(boolean messageSetWireFormat) { - if (iter.hasNext()) { - next = iter.next(); - } - this.messageSetWireFormat = messageSetWireFormat; - } - - public void writeUntil(final int end, final CodedOutputStream output) - throws IOException { - while (next != null && next.getKey().getNumber() < end) { - ExtensionDescriptor extension = next.getKey(); - if (messageSetWireFormat && extension.getLiteJavaType() == - WireFormat.JavaType.MESSAGE && - !extension.isRepeated()) { - output.writeMessageSetExtension(extension.getNumber(), - (MessageLite) next.getValue()); - } else { - FieldSet.writeField(extension, next.getValue(), output); - } - if (iter.hasNext()) { - next = iter.next(); - } else { - next = null; - } - } - } - } - - protected ExtensionWriter newExtensionWriter() { - return new ExtensionWriter(false); - } - protected ExtensionWriter newMessageSetExtensionWriter() { - return new ExtensionWriter(true); - } - - /** Called by subclasses to compute the size of extensions. */ - protected int extensionsSerializedSize() { - return extensions.getSerializedSize(); - } - protected int extensionsSerializedSizeAsMessageSet() { - return extensions.getMessageSetSerializedSize(); - } - } - - /** - * Lite equivalent of {@link GeneratedMessage.ExtendableBuilder}. - */ - @SuppressWarnings("unchecked") - public abstract static class ExtendableBuilder< - MessageType extends ExtendableMessage, - BuilderType extends ExtendableBuilder> - extends Builder - implements ExtendableMessageOrBuilder { - protected ExtendableBuilder() {} - - private FieldSet extensions = FieldSet.emptySet(); - private boolean extensionsIsMutable; - - // For immutable message conversion. - void internalSetExtensionSet(FieldSet extensions) { - this.extensions = extensions; - } - - @Override - public BuilderType clear() { - extensions.clear(); - extensionsIsMutable = false; - return super.clear(); - } - - private void ensureExtensionsIsMutable() { - if (!extensionsIsMutable) { - extensions = extensions.clone(); - extensionsIsMutable = true; - } - } - - /** - * Called by the build code path to create a copy of the extensions for - * building the message. - */ - private FieldSet buildExtensions() { - extensions.makeImmutable(); - extensionsIsMutable = false; - return extensions; - } - - private void verifyExtensionContainingType( - final GeneratedExtension extension) { - if (extension.getContainingTypeDefaultInstance() != - getDefaultInstanceForType()) { - // This can only happen if someone uses unchecked operations. - throw new IllegalArgumentException( - "This extension is for a different message type. Please make " + - "sure that you are not suppressing any generics type warnings."); - } - } - - /** Check if a singular extension is present. */ - //@Override (Java 1.6 override semantics, but we must support 1.5) - @Override - public final boolean hasExtension( - final GeneratedExtension extension) { - verifyExtensionContainingType(extension); - return extensions.hasField(extension.descriptor); - } - - /** Get the number of elements in a repeated extension. */ - //@Override (Java 1.6 override semantics, but we must support 1.5) - @Override - public final int getExtensionCount( - final GeneratedExtension> extension) { - verifyExtensionContainingType(extension); - return extensions.getRepeatedFieldCount(extension.descriptor); - } - - /** Get the value of an extension. */ - //@Override (Java 1.6 override semantics, but we must support 1.5) - @SuppressWarnings("unchecked") - @Override - public final Type getExtension( - final GeneratedExtension extension) { - verifyExtensionContainingType(extension); - final Object value = extensions.getField(extension.descriptor); - if (value == null) { - return extension.defaultValue; - } else { - return (Type) extension.fromFieldSetType(value); - } - } - - /** Get one element of a repeated extension. */ - @SuppressWarnings("unchecked") - //@Override (Java 1.6 override semantics, but we must support 1.5) - @Override - public final Type getExtension( - final GeneratedExtension> extension, - final int index) { - verifyExtensionContainingType(extension); - return (Type) extension.singularFromFieldSetType( - extensions.getRepeatedField(extension.descriptor, index)); - } - - // This is implemented here only to work around an apparent bug in the - // Java compiler and/or build system. See bug #1898463. The mere presence - // of this dummy clone() implementation makes it go away. - @Override - public BuilderType clone() { - throw new UnsupportedOperationException( - "This is supposed to be overridden by subclasses."); - } - - /** Set the value of an extension. */ - public final BuilderType setExtension( - final GeneratedExtension extension, - final Type value) { - verifyExtensionContainingType(extension); - ensureExtensionsIsMutable(); - extensions.setField(extension.descriptor, - extension.toFieldSetType(value)); - return (BuilderType) this; - } - - /** Set the value of one element of a repeated extension. */ - public final BuilderType setExtension( - final GeneratedExtension> extension, - final int index, final Type value) { - verifyExtensionContainingType(extension); - ensureExtensionsIsMutable(); - extensions.setRepeatedField(extension.descriptor, index, - extension.singularToFieldSetType(value)); - return (BuilderType) this; - } - - /** Append a value to a repeated extension. */ - public final BuilderType addExtension( - final GeneratedExtension> extension, - final Type value) { - verifyExtensionContainingType(extension); - ensureExtensionsIsMutable(); - extensions.addRepeatedField(extension.descriptor, - extension.singularToFieldSetType(value)); - return (BuilderType) this; - } - - /** Clear an extension. */ - public final BuilderType clearExtension( - final GeneratedExtension extension) { - verifyExtensionContainingType(extension); - ensureExtensionsIsMutable(); - extensions.clearField(extension.descriptor); - return (BuilderType) this; - } - - /** Called by subclasses to check if all extensions are initialized. */ - protected boolean extensionsAreInitialized() { - return extensions.isInitialized(); - } - - /** - * Called by subclasses to parse an unknown field or an extension. - * @return {@code true} unless the tag is an end-group tag. - */ - @Override - protected boolean parseUnknownField( - CodedInputStream input, - CodedOutputStream unknownFieldsCodedOutput, - ExtensionRegistryLite extensionRegistry, - int tag) throws IOException { - ensureExtensionsIsMutable(); - return GeneratedMessageLite.parseUnknownField( - extensions, - getDefaultInstanceForType(), - input, - unknownFieldsCodedOutput, - extensionRegistry, - tag); - } - - protected final void mergeExtensionFields(final MessageType other) { - ensureExtensionsIsMutable(); - extensions.mergeFrom(((ExtendableMessage) other).extensions); - } - } - - // ----------------------------------------------------------------- - - /** - * Parse an unknown field or an extension. - * @return {@code true} unless the tag is an end-group tag. - */ - private static - boolean parseUnknownField( - FieldSet extensions, - MessageType defaultInstance, - CodedInputStream input, - CodedOutputStream unknownFieldsCodedOutput, - ExtensionRegistryLite extensionRegistry, - int tag) throws IOException { - int wireType = WireFormat.getTagWireType(tag); - int fieldNumber = WireFormat.getTagFieldNumber(tag); - - GeneratedExtension extension = - extensionRegistry.findLiteExtensionByNumber( - defaultInstance, fieldNumber); - - boolean unknown = false; - boolean packed = false; - if (extension == null) { - unknown = true; // Unknown field. - } else if (wireType == FieldSet.getWireFormatForFieldType( - extension.descriptor.getLiteType(), - false /* isPacked */)) { - packed = false; // Normal, unpacked value. - } else if (extension.descriptor.isRepeated && - extension.descriptor.type.isPackable() && - wireType == FieldSet.getWireFormatForFieldType( - extension.descriptor.getLiteType(), - true /* isPacked */)) { - packed = true; // Packed value. - } else { - unknown = true; // Wrong wire type. - } - - if (unknown) { // Unknown field or wrong wire type. Skip. - return input.skipField(tag, unknownFieldsCodedOutput); - } - - if (packed) { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (extension.descriptor.getLiteType() == WireFormat.FieldType.ENUM) { - while (input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - Object value = - extension.descriptor.getEnumType().findValueByNumber(rawValue); - if (value == null) { - // If the number isn't recognized as a valid value for this - // enum, drop it (don't even add it to unknownFields). - return true; - } - extensions.addRepeatedField(extension.descriptor, - extension.singularToFieldSetType(value)); - } - } else { - while (input.getBytesUntilLimit() > 0) { - Object value = - FieldSet.readPrimitiveField(input, - extension.descriptor.getLiteType(), - /*checkUtf8=*/ false); - extensions.addRepeatedField(extension.descriptor, value); - } - } - input.popLimit(limit); - } else { - Object value; - switch (extension.descriptor.getLiteJavaType()) { - case MESSAGE: { - MessageLite.Builder subBuilder = null; - if (!extension.descriptor.isRepeated()) { - MessageLite existingValue = - (MessageLite) extensions.getField(extension.descriptor); - if (existingValue != null) { - subBuilder = existingValue.toBuilder(); - } - } - if (subBuilder == null) { - subBuilder = extension.getMessageDefaultInstance() - .newBuilderForType(); - } - if (extension.descriptor.getLiteType() == - WireFormat.FieldType.GROUP) { - input.readGroup(extension.getNumber(), - subBuilder, extensionRegistry); - } else { - input.readMessage(subBuilder, extensionRegistry); - } - value = subBuilder.build(); - break; - } - case ENUM: - int rawValue = input.readEnum(); - value = extension.descriptor.getEnumType() - .findValueByNumber(rawValue); - // If the number isn't recognized as a valid value for this enum, - // write it to unknown fields object. - if (value == null) { - unknownFieldsCodedOutput.writeRawVarint32(tag); - unknownFieldsCodedOutput.writeUInt32NoTag(rawValue); - return true; - } - break; - default: - value = FieldSet.readPrimitiveField(input, - extension.descriptor.getLiteType(), - /*checkUtf8=*/ false); - break; - } - - if (extension.descriptor.isRepeated()) { - extensions.addRepeatedField(extension.descriptor, - extension.singularToFieldSetType(value)); - } else { - extensions.setField(extension.descriptor, - extension.singularToFieldSetType(value)); - } - } - - return true; - } - - // ----------------------------------------------------------------- - - /** For use by generated code only. */ - public static - GeneratedExtension - newSingularGeneratedExtension( - final ContainingType containingTypeDefaultInstance, - final Type defaultValue, - final MessageLite messageDefaultInstance, - final Internal.EnumLiteMap enumTypeMap, - final int number, - final WireFormat.FieldType type, - final Class singularType) { - return new GeneratedExtension( - containingTypeDefaultInstance, - defaultValue, - messageDefaultInstance, - new ExtensionDescriptor(enumTypeMap, number, type, - false /* isRepeated */, - false /* isPacked */), - singularType); - } - - /** For use by generated code only. */ - public static - GeneratedExtension - newRepeatedGeneratedExtension( - final ContainingType containingTypeDefaultInstance, - final MessageLite messageDefaultInstance, - final Internal.EnumLiteMap enumTypeMap, - final int number, - final WireFormat.FieldType type, - final boolean isPacked, - final Class singularType) { - @SuppressWarnings("unchecked") // Subclasses ensure Type is a List - Type emptyList = (Type) Collections.emptyList(); - return new GeneratedExtension( - containingTypeDefaultInstance, - emptyList, - messageDefaultInstance, - new ExtensionDescriptor( - enumTypeMap, number, type, true /* isRepeated */, isPacked), - singularType); - } - - static final class ExtensionDescriptor - implements FieldSet.FieldDescriptorLite< - ExtensionDescriptor> { - ExtensionDescriptor( - final Internal.EnumLiteMap enumTypeMap, - final int number, - final WireFormat.FieldType type, - final boolean isRepeated, - final boolean isPacked) { - this.enumTypeMap = enumTypeMap; - this.number = number; - this.type = type; - this.isRepeated = isRepeated; - this.isPacked = isPacked; - } - - final Internal.EnumLiteMap enumTypeMap; - final int number; - final WireFormat.FieldType type; - final boolean isRepeated; - final boolean isPacked; - - @Override - public int getNumber() { - return number; - } - - @Override - public WireFormat.FieldType getLiteType() { - return type; - } - - @Override - public WireFormat.JavaType getLiteJavaType() { - return type.getJavaType(); - } - - @Override - public boolean isRepeated() { - return isRepeated; - } - - @Override - public boolean isPacked() { - return isPacked; - } - - @Override - public Internal.EnumLiteMap getEnumType() { - return enumTypeMap; - } - - @SuppressWarnings("unchecked") - @Override - public MessageLite.Builder internalMergeFrom( - MessageLite.Builder to, MessageLite from) { - return ((Builder) to).mergeFrom((GeneratedMessageLite) from); - } - - - @Override - public int compareTo(ExtensionDescriptor other) { - return number - other.number; - } - } - - // ================================================================= - - /** Calls Class.getMethod and throws a RuntimeException if it fails. */ - @SuppressWarnings("unchecked") - static Method getMethodOrDie(Class clazz, String name, Class... params) { - try { - return clazz.getMethod(name, params); - } catch (NoSuchMethodException e) { - throw new RuntimeException( - "Generated message class \"" + clazz.getName() + - "\" missing method \"" + name + "\".", e); - } - } - - /** Calls invoke and throws a RuntimeException if it fails. */ - static Object invokeOrDie(Method method, Object object, Object... params) { - try { - return method.invoke(object, params); - } catch (IllegalAccessException e) { - throw new RuntimeException( - "Couldn't use Java reflection to implement protocol message " + - "reflection.", e); - } catch (InvocationTargetException e) { - final Throwable cause = e.getCause(); - if (cause instanceof RuntimeException) { - throw (RuntimeException) cause; - } else if (cause instanceof Error) { - throw (Error) cause; - } else { - throw new RuntimeException( - "Unexpected exception thrown by generated accessor method.", cause); - } - } - } - - /** - * Lite equivalent to {@link GeneratedMessage.GeneratedExtension}. - * - * Users should ignore the contents of this class and only use objects of - * this type as parameters to extension accessors and ExtensionRegistry.add(). - */ - public static class GeneratedExtension< - ContainingType extends MessageLite, Type> { - - /** - * Create a new isntance with the given parameters. - * - * The last parameter {@code singularType} is only needed for enum types. - * We store integer values for enum types in a {@link ExtendableMessage} - * and use Java reflection to convert an integer value back into a concrete - * enum object. - */ - GeneratedExtension( - final ContainingType containingTypeDefaultInstance, - final Type defaultValue, - final MessageLite messageDefaultInstance, - final ExtensionDescriptor descriptor, - Class singularType) { - // Defensive checks to verify the correct initialization order of - // GeneratedExtensions and their related GeneratedMessages. - if (containingTypeDefaultInstance == null) { - throw new IllegalArgumentException( - "Null containingTypeDefaultInstance"); - } - if (descriptor.getLiteType() == WireFormat.FieldType.MESSAGE && - messageDefaultInstance == null) { - throw new IllegalArgumentException( - "Null messageDefaultInstance"); - } - this.containingTypeDefaultInstance = containingTypeDefaultInstance; - this.defaultValue = defaultValue; - this.messageDefaultInstance = messageDefaultInstance; - this.descriptor = descriptor; - - // Use Java reflection to invoke the static method {@code valueOf} of - // enum types in order to convert integers to concrete enum objects. - this.singularType = singularType; - if (Internal.EnumLite.class.isAssignableFrom(singularType)) { - this.enumValueOf = getMethodOrDie( - singularType, "valueOf", int.class); - } else { - this.enumValueOf = null; - } - } - - final ContainingType containingTypeDefaultInstance; - final Type defaultValue; - final MessageLite messageDefaultInstance; - final ExtensionDescriptor descriptor; - final Class singularType; - final Method enumValueOf; - - /** - * Default instance of the type being extended, used to identify that type. - */ - public ContainingType getContainingTypeDefaultInstance() { - return containingTypeDefaultInstance; - } - - /** Get the field number. */ - public int getNumber() { - return descriptor.getNumber(); - } - - - /** - * If the extension is an embedded message or group, returns the default - * instance of the message. - */ - public MessageLite getMessageDefaultInstance() { - return messageDefaultInstance; - } - - @SuppressWarnings("unchecked") - Object fromFieldSetType(final Object value) { - if (descriptor.isRepeated()) { - if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { - final List result = new ArrayList(); - for (final Object element : (List) value) { - result.add(singularFromFieldSetType(element)); - } - return result; - } else { - return value; - } - } else { - return singularFromFieldSetType(value); - } - } - - Object singularFromFieldSetType(final Object value) { - if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { - return invokeOrDie(enumValueOf, null, (Integer) value); - } else { - return value; - } - } - - @SuppressWarnings("unchecked") - Object toFieldSetType(final Object value) { - if (descriptor.isRepeated()) { - if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { - final List result = new ArrayList(); - for (final Object element : (List) value) { - result.add(singularToFieldSetType(element)); - } - return result; - } else { - return value; - } - } else { - return singularToFieldSetType(value); - } - } - - Object singularToFieldSetType(final Object value) { - if (descriptor.getLiteJavaType() == WireFormat.JavaType.ENUM) { - return ((Internal.EnumLite) value).getNumber(); - } else { - return value; - } - } - } - - /** - * A serialized (serializable) form of the generated message. Stores the - * message as a class name and a byte array. - */ - static final class SerializedForm implements Serializable { - private static final long serialVersionUID = 0L; - - private String messageClassName; - private byte[] asBytes; - - /** - * Creates the serialized form by calling {@link MessageLite#toByteArray}. - * @param regularForm the message to serialize - */ - SerializedForm(MessageLite regularForm) { - messageClassName = regularForm.getClass().getName(); - asBytes = regularForm.toByteArray(); - } - - /** - * When read from an ObjectInputStream, this method converts this object - * back to the regular form. Part of Java's serialization magic. - * @return a GeneratedMessage of the type that was serialized - */ - @SuppressWarnings("unchecked") - protected Object readResolve() throws ObjectStreamException { - try { - Class messageClass = Class.forName(messageClassName); - Method newBuilder = messageClass.getMethod("newBuilder"); - MessageLite.Builder builder = - (MessageLite.Builder) newBuilder.invoke(null); - builder.mergeFrom(asBytes); - return builder.buildPartial(); - } catch (ClassNotFoundException e) { - throw new RuntimeException("Unable to find proto buffer class", e); - } catch (NoSuchMethodException e) { - throw new RuntimeException("Unable to find newBuilder method", e); - } catch (IllegalAccessException e) { - throw new RuntimeException("Unable to call newBuilder method", e); - } catch (InvocationTargetException e) { - throw new RuntimeException("Error calling newBuilder", e.getCause()); - } catch (InvalidProtocolBufferException e) { - throw new RuntimeException("Unable to understand proto buffer", e); - } - } - } - - /** - * Replaces this object in the output stream with a serialized form. - * Part of Java's serialization magic. Generated sub-classes must override - * this method by calling {@code return super.writeReplace();} - * @return a SerializedForm of this message - */ - protected Object writeReplace() throws ObjectStreamException { - return new SerializedForm(this); - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/Internal.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Internal.java deleted file mode 100644 index a332a2c5d3..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/Internal.java +++ /dev/null @@ -1,390 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.List; - -/** - * The classes contained within are used internally by the Protocol Buffer - * library and generated message implementations. They are public only because - * those generated messages do not reside in the {@code protobuf} package. - * Others should not use this class directly. - * - * @author kenton@google.com (Kenton Varda) - */ -public class Internal { - /** - * Helper called by generated code to construct default values for string - * fields. - *

- * The protocol compiler does not actually contain a UTF-8 decoder -- it - * just pushes UTF-8-encoded text around without touching it. The one place - * where this presents a problem is when generating Java string literals. - * Unicode characters in the string literal would normally need to be encoded - * using a Unicode escape sequence, which would require decoding them. - * To get around this, protoc instead embeds the UTF-8 bytes into the - * generated code and leaves it to the runtime library to decode them. - *

- * It gets worse, though. If protoc just generated a byte array, like: - * new byte[] {0x12, 0x34, 0x56, 0x78} - * Java actually generates *code* which allocates an array and then fills - * in each value. This is much less efficient than just embedding the bytes - * directly into the bytecode. To get around this, we need another - * work-around. String literals are embedded directly, so protoc actually - * generates a string literal corresponding to the bytes. The easiest way - * to do this is to use the ISO-8859-1 character set, which corresponds to - * the first 256 characters of the Unicode range. Protoc can then use - * good old CEscape to generate the string. - *

- * So we have a string literal which represents a set of bytes which - * represents another string. This function -- stringDefaultValue -- - * converts from the generated string to the string we actually want. The - * generated code calls this automatically. - */ - public static String stringDefaultValue(String bytes) { - try { - return new String(bytes.getBytes("ISO-8859-1"), "UTF-8"); - } catch (UnsupportedEncodingException e) { - // This should never happen since all JVMs are required to implement - // both of the above character sets. - throw new IllegalStateException( - "Java VM does not support a standard character set.", e); - } - } - - /** - * Helper called by generated code to construct default values for bytes - * fields. - *

- * This is a lot like {@link #stringDefaultValue}, but for bytes fields. - * In this case we only need the second of the two hacks -- allowing us to - * embed raw bytes as a string literal with ISO-8859-1 encoding. - */ - public static ByteString bytesDefaultValue(String bytes) { - try { - return ByteString.copyFrom(bytes.getBytes("ISO-8859-1")); - } catch (UnsupportedEncodingException e) { - // This should never happen since all JVMs are required to implement - // ISO-8859-1. - throw new IllegalStateException( - "Java VM does not support a standard character set.", e); - } - } - /** - * Helper called by generated code to construct default values for bytes - * fields. - *

- * This is like {@link #bytesDefaultValue}, but returns a byte array. - */ - public static byte[] byteArrayDefaultValue(String bytes) { - try { - return bytes.getBytes("ISO-8859-1"); - } catch (UnsupportedEncodingException e) { - // This should never happen since all JVMs are required to implement - // ISO-8859-1. - throw new IllegalStateException( - "Java VM does not support a standard character set.", e); - } - } - - /** - * Helper called by generated code to construct default values for bytes - * fields. - *

- * This is like {@link #bytesDefaultValue}, but returns a ByteBuffer. - */ - public static ByteBuffer byteBufferDefaultValue(String bytes) { - return ByteBuffer.wrap(byteArrayDefaultValue(bytes)); - } - - /** - * Create a new ByteBuffer and copy all the content of {@code source} - * ByteBuffer to the new ByteBuffer. The new ByteBuffer's limit and - * capacity will be source.capacity(), and its position will be 0. - * Note that the state of {@code source} ByteBuffer won't be changed. - */ - public static ByteBuffer copyByteBuffer(ByteBuffer source) { - // Make a duplicate of the source ByteBuffer and read data from the - // duplicate. This is to avoid affecting the source ByteBuffer's state. - ByteBuffer temp = source.duplicate(); - // We want to copy all the data in the source ByteBuffer, not just the - // remaining bytes. - temp.clear(); - ByteBuffer result = ByteBuffer.allocate(temp.capacity()); - result.put(temp); - result.clear(); - return result; - } - - /** - * Helper called by generated code to determine if a byte array is a valid - * UTF-8 encoded string such that the original bytes can be converted to - * a String object and then back to a byte array round tripping the bytes - * without loss. More precisely, returns {@code true} whenever: - *

   {@code
-   * Arrays.equals(byteString.toByteArray(),
-   *     new String(byteString.toByteArray(), "UTF-8").getBytes("UTF-8"))
-   * }
- * - *

This method rejects "overlong" byte sequences, as well as - * 3-byte sequences that would map to a surrogate character, in - * accordance with the restricted definition of UTF-8 introduced in - * Unicode 3.1. Note that the UTF-8 decoder included in Oracle's - * JDK has been modified to also reject "overlong" byte sequences, - * but currently (2011) still accepts 3-byte surrogate character - * byte sequences. - * - *

See the Unicode Standard,
- * Table 3-6. UTF-8 Bit Distribution,
- * Table 3-7. Well Formed UTF-8 Byte Sequences. - * - *

As of 2011-02, this method simply returns the result of {@link - * ByteString#isValidUtf8()}. Calling that method directly is preferred. - * - * @param byteString the string to check - * @return whether the byte array is round trippable - */ - public static boolean isValidUtf8(ByteString byteString) { - return byteString.isValidUtf8(); - } - - /** - * Like {@link #isValidUtf8(ByteString)} but for byte arrays. - */ - public static boolean isValidUtf8(byte[] byteArray) { - return Utf8.isValidUtf8(byteArray); - } - - /** - * Helper method to get the UTF-8 bytes of a string. - */ - public static byte[] toByteArray(String value) { - try { - return value.getBytes("UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("UTF-8 not supported?", e); - } - } - - /** - * Helper method to convert a byte array to a string using UTF-8 encoding. - */ - public static String toStringUtf8(byte[] bytes) { - try { - return new String(bytes, "UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("UTF-8 not supported?", e); - } - } - - /** - * Interface for an enum value or value descriptor, to be used in FieldSet. - * The lite library stores enum values directly in FieldSets but the full - * library stores EnumValueDescriptors in order to better support reflection. - */ - public interface EnumLite { - int getNumber(); - } - - /** - * Interface for an object which maps integers to {@link EnumLite}s. - * {@link Descriptors.EnumDescriptor} implements this interface by mapping - * numbers to {@link Descriptors.EnumValueDescriptor}s. Additionally, - * every generated enum type has a static method internalGetValueMap() which - * returns an implementation of this type that maps numbers to enum values. - */ - public interface EnumLiteMap { - T findValueByNumber(int number); - } - - /** - * Helper method for implementing {@link MessageLite#hashCode()} for longs. - * @see Long#hashCode() - */ - public static int hashLong(long n) { - return (int) (n ^ (n >>> 32)); - } - - /** - * Helper method for implementing {@link MessageLite#hashCode()} for - * booleans. - * @see Boolean#hashCode() - */ - public static int hashBoolean(boolean b) { - return b ? 1231 : 1237; - } - - /** - * Helper method for implementing {@link MessageLite#hashCode()} for enums. - *

- * This is needed because {@link java.lang.Enum#hashCode()} is final, but we - * need to use the field number as the hash code to ensure compatibility - * between statically and dynamically generated enum objects. - */ - public static int hashEnum(EnumLite e) { - return e.getNumber(); - } - - /** - * Helper method for implementing {@link MessageLite#hashCode()} for - * enum lists. - */ - public static int hashEnumList(List list) { - int hash = 1; - for (EnumLite e : list) { - hash = 31 * hash + hashEnum(e); - } - return hash; - } - - /** - * Helper method for implementing {@link MessageLite#equals()} for bytes field. - */ - public static boolean equals(List a, List b) { - if (a.size() != b.size()) return false; - for (int i = 0; i < a.size(); ++i) { - if (!Arrays.equals(a.get(i), b.get(i))) { - return false; - } - } - return true; - } - - /** - * Helper method for implementing {@link MessageLite#hashCode()} for bytes field. - */ - public static int hashCode(List list) { - int hash = 1; - for (byte[] bytes : list) { - hash = 31 * hash + hashCode(bytes); - } - return hash; - } - - /** - * Helper method for implementing {@link MessageLite#hashCode()} for bytes field. - */ - public static int hashCode(byte[] bytes) { - // The hash code for a byte array should be the same as the hash code for a - // ByteString with the same content. This is to ensure that the generated - // hashCode() method will return the same value as the pure reflection - // based hashCode() method. - return LiteralByteString.hashCode(bytes); - } - - /** - * Helper method for implementing {@link MessageLite#equals()} for bytes - * field. - */ - public static boolean equalsByteBuffer(ByteBuffer a, ByteBuffer b) { - if (a.capacity() != b.capacity()) { - return false; - } - // ByteBuffer.equals() will only compare the remaining bytes, but we want to - // compare all the content. - return a.duplicate().clear().equals(b.duplicate().clear()); - } - - /** - * Helper method for implementing {@link MessageLite#equals()} for bytes - * field. - */ - public static boolean equalsByteBuffer( - List a, List b) { - if (a.size() != b.size()) { - return false; - } - for (int i = 0; i < a.size(); ++i) { - if (!equalsByteBuffer(a.get(i), b.get(i))) { - return false; - } - } - return true; - } - - /** - * Helper method for implementing {@link MessageLite#hashCode()} for bytes - * field. - */ - public static int hashCodeByteBuffer(List list) { - int hash = 1; - for (ByteBuffer bytes : list) { - hash = 31 * hash + hashCodeByteBuffer(bytes); - } - return hash; - } - - private static final int DEFAULT_BUFFER_SIZE = 4096; - - /** - * Helper method for implementing {@link MessageLite#hashCode()} for bytes - * field. - */ - public static int hashCodeByteBuffer(ByteBuffer bytes) { - if (bytes.hasArray()) { - // Fast path. - int h = LiteralByteString.hashCode(bytes.capacity(), bytes.array(), - bytes.arrayOffset(), bytes.capacity()); - return h == 0 ? 1 : h; - } else { - // Read the data into a temporary byte array before calculating the - // hash value. - final int bufferSize = bytes.capacity() > DEFAULT_BUFFER_SIZE - ? DEFAULT_BUFFER_SIZE : bytes.capacity(); - final byte[] buffer = new byte[bufferSize]; - final ByteBuffer duplicated = bytes.duplicate(); - duplicated.clear(); - int h = bytes.capacity(); - while (duplicated.remaining() > 0) { - final int length = duplicated.remaining() <= bufferSize ? - duplicated.remaining() : bufferSize; - duplicated.get(buffer, 0, length); - h = LiteralByteString.hashCode(h, buffer, 0, length); - } - return h == 0 ? 1 : h; - } - } - - /** - * An empty byte array constant used in generated code. - */ - public static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; - - /** - * An empty byte array constant used in generated code. - */ - public static final ByteBuffer EMPTY_BYTE_BUFFER = - ByteBuffer.wrap(EMPTY_BYTE_ARRAY); - -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/InvalidProtocolBufferException.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/InvalidProtocolBufferException.java deleted file mode 100644 index b73b5afc7e..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/InvalidProtocolBufferException.java +++ /dev/null @@ -1,122 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.IOException; - -/** - * Thrown when a protocol message being parsed is invalid in some way, - * e.g. it contains a malformed varint or a negative byte length. - * - * @author kenton@google.com Kenton Varda - */ -public class InvalidProtocolBufferException extends IOException { - private static final long serialVersionUID = -1616151763072450476L; - private MessageLite unfinishedMessage = null; - - public InvalidProtocolBufferException(final String description) { - super(description); - } - - /** - * Attaches an unfinished message to the exception to support best-effort - * parsing in {@code Parser} interface. - * - * @return this - */ - public InvalidProtocolBufferException setUnfinishedMessage( - MessageLite unfinishedMessage) { - this.unfinishedMessage = unfinishedMessage; - return this; - } - - /** - * Returns the unfinished message attached to the exception, or null if - * no message is attached. - */ - public MessageLite getUnfinishedMessage() { - return unfinishedMessage; - } - - static InvalidProtocolBufferException truncatedMessage() { - return new InvalidProtocolBufferException( - "While parsing a protocol message, the input ended unexpectedly " + - "in the middle of a field. This could mean either than the " + - "input has been truncated or that an embedded message " + - "misreported its own length."); - } - - static InvalidProtocolBufferException negativeSize() { - return new InvalidProtocolBufferException( - "CodedInputStream encountered an embedded string or message " + - "which claimed to have negative size."); - } - - static InvalidProtocolBufferException malformedVarint() { - return new InvalidProtocolBufferException( - "CodedInputStream encountered a malformed varint."); - } - - static InvalidProtocolBufferException invalidTag() { - return new InvalidProtocolBufferException( - "Protocol message contained an invalid tag (zero)."); - } - - static InvalidProtocolBufferException invalidEndTag() { - return new InvalidProtocolBufferException( - "Protocol message end-group tag did not match expected tag."); - } - - static InvalidProtocolBufferException invalidWireType() { - return new InvalidProtocolBufferException( - "Protocol message tag had invalid wire type."); - } - - static InvalidProtocolBufferException recursionLimitExceeded() { - return new InvalidProtocolBufferException( - "Protocol message had too many levels of nesting. May be malicious. " + - "Use CodedInputStream.setRecursionLimit() to increase the depth limit."); - } - - static InvalidProtocolBufferException sizeLimitExceeded() { - return new InvalidProtocolBufferException( - "Protocol message was too large. May be malicious. " + - "Use CodedInputStream.setSizeLimit() to increase the size limit."); - } - - static InvalidProtocolBufferException parseFailure() { - return new InvalidProtocolBufferException("Failed to parse the message."); - } - - static InvalidProtocolBufferException invalidUtf8() { - return new InvalidProtocolBufferException("Protocol message had invalid UTF-8."); - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyField.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyField.java deleted file mode 100644 index 22a7a427b4..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyField.java +++ /dev/null @@ -1,154 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.Iterator; -import java.util.Map.Entry; - -/** - * LazyField encapsulates the logic of lazily parsing message fields. It stores - * the message in a ByteString initially and then parse it on-demand. - * - * Most of key methods are implemented in {@link LazyFieldLite} but this class - * can contain default instance of the message to provide {@code hashCode()}, - * {@code euqals()} and {@code toString()}. - * - * @author xiangl@google.com (Xiang Li) - */ -public class LazyField extends LazyFieldLite { - - /** - * Carry a message's default instance which is used by {@code hashCode()}, {@code euqals()} and - * {@code toString()}. - */ - private final MessageLite defaultInstance; - - public LazyField(MessageLite defaultInstance, - ExtensionRegistryLite extensionRegistry, ByteString bytes) { - super(extensionRegistry, bytes); - - this.defaultInstance = defaultInstance; - } - - @Override - public boolean containsDefaultInstance() { - return super.containsDefaultInstance() || value == defaultInstance; - } - - public MessageLite getValue() { - return getValue(defaultInstance); - } - - @Override - public int hashCode() { - return getValue().hashCode(); - } - - @Override - public boolean equals(Object obj) { - return getValue().equals(obj); - } - - @Override - public String toString() { - return getValue().toString(); - } - - // ==================================================== - - /** - * LazyEntry and LazyIterator are used to encapsulate the LazyField, when - * users iterate all fields from FieldSet. - */ - static class LazyEntry implements Entry { - private Entry entry; - - private LazyEntry(Entry entry) { - this.entry = entry; - } - - // @Override - public K getKey() { - return entry.getKey(); - } - - // @Override - public Object getValue() { - LazyField field = entry.getValue(); - if (field == null) { - return null; - } - return field.getValue(); - } - - public LazyField getField() { - return entry.getValue(); - } - - // @Override - public Object setValue(Object value) { - if (!(value instanceof MessageLite)) { - throw new IllegalArgumentException( - "LazyField now only used for MessageSet, " - + "and the value of MessageSet must be an instance of MessageLite"); - } - return entry.getValue().setValue((MessageLite) value); - } - } - - static class LazyIterator implements Iterator> { - private Iterator> iterator; - - public LazyIterator(Iterator> iterator) { - this.iterator = iterator; - } - - // @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @SuppressWarnings("unchecked") - // @Override - public Entry next() { - Entry entry = iterator.next(); - if (entry.getValue() instanceof LazyField) { - return new LazyEntry((Entry) entry); - } - return (Entry) entry; - } - - // @Override - public void remove() { - iterator.remove(); - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyFieldLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyFieldLite.java deleted file mode 100644 index b6a00cf0d0..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyFieldLite.java +++ /dev/null @@ -1,176 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.IOException; - -/** - * LazyFieldLite encapsulates the logic of lazily parsing message fields. It stores - * the message in a ByteString initially and then parse it on-demand. - * - * LazyField is thread-compatible e.g. concurrent read are safe, however, - * synchronizations are needed under read/write situations. - * - * This class is internal implementation detail, so you don't need to use it directly. - * - * @author xiangl@google.com (Xiang Li) - */ -public class LazyFieldLite { - private ByteString bytes; - private ExtensionRegistryLite extensionRegistry; - private volatile boolean isDirty = false; - - protected volatile MessageLite value; - - public LazyFieldLite(ExtensionRegistryLite extensionRegistry, ByteString bytes) { - this.extensionRegistry = extensionRegistry; - this.bytes = bytes; - } - - public LazyFieldLite() { - } - - public static LazyFieldLite fromValue(MessageLite value) { - LazyFieldLite lf = new LazyFieldLite(); - lf.setValue(value); - return lf; - } - - public boolean containsDefaultInstance() { - return value == null && bytes == null; - } - - public void clear() { - bytes = null; - value = null; - extensionRegistry = null; - isDirty = true; - } - - /** - * Returns message instance. At first time, serialized data is parsed by - * {@code defaultInstance.getParserForType()}. - * - * @param defaultInstance its message's default instance. It's also used to get parser for the - * message type. - */ - public MessageLite getValue(MessageLite defaultInstance) { - ensureInitialized(defaultInstance); - return value; - } - - /** - * LazyField is not thread-safe for write access. Synchronizations are needed - * under read/write situations. - */ - public MessageLite setValue(MessageLite value) { - MessageLite originalValue = this.value; - this.value = value; - bytes = null; - isDirty = true; - return originalValue; - } - - public void merge(LazyFieldLite value) { - if (value.containsDefaultInstance()) { - return; - } - - if (bytes == null) { - this.bytes = value.bytes; - } else { - this.bytes.concat(value.toByteString()); - } - isDirty = false; - } - - public void setByteString(ByteString bytes, ExtensionRegistryLite extensionRegistry) { - this.bytes = bytes; - this.extensionRegistry = extensionRegistry; - isDirty = false; - } - - public ExtensionRegistryLite getExtensionRegistry() { - return extensionRegistry; - } - - /** - * Due to the optional field can be duplicated at the end of serialized - * bytes, which will make the serialized size changed after LazyField - * parsed. Be careful when using this method. - */ - public int getSerializedSize() { - if (isDirty) { - return value.getSerializedSize(); - } - return bytes.size(); - } - - public ByteString toByteString() { - if (!isDirty) { - return bytes; - } - synchronized (this) { - if (!isDirty) { - return bytes; - } - if (value == null) { - bytes = ByteString.EMPTY; - } else { - bytes = value.toByteString(); - } - isDirty = false; - return bytes; - } - } - - protected void ensureInitialized(MessageLite defaultInstance) { - if (value != null) { - return; - } - synchronized (this) { - if (value != null) { - return; - } - try { - if (bytes != null) { - value = defaultInstance.getParserForType() - .parseFrom(bytes, extensionRegistry); - } else { - value = defaultInstance; - } - } catch (IOException e) { - // TODO(xiangl): Refactory the API to support the exception thrown from - // lazily load messages. - } - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringArrayList.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringArrayList.java deleted file mode 100644 index 704145824a..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringArrayList.java +++ /dev/null @@ -1,367 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.RandomAccess; - -/** - * An implementation of {@link LazyStringList} that wraps an ArrayList. Each - * element is one of String, ByteString, or byte[]. It caches the last one - * requested which is most likely the one needed next. This minimizes memory - * usage while satisfying the most common use cases. - *

- * Note that this implementation is not synchronized. - * If multiple threads access an ArrayList instance concurrently, - * and at least one of the threads modifies the list structurally, it - * must be synchronized externally. (A structural modification is - * any operation that adds or deletes one or more elements, or explicitly - * resizes the backing array; merely setting the value of an element is not - * a structural modification.) This is typically accomplished by - * synchronizing on some object that naturally encapsulates the list. - *

- * If the implementation is accessed via concurrent reads, this is thread safe. - * Conversions are done in a thread safe manner. It's possible that the - * conversion may happen more than once if two threads attempt to access the - * same element and the modifications were not visible to each other, but this - * will not result in any corruption of the list or change in behavior other - * than performance. - * - * @author jonp@google.com (Jon Perlow) - */ -public class LazyStringArrayList extends AbstractList - implements LazyStringList, RandomAccess { - - public static final LazyStringList EMPTY = - new LazyStringArrayList().getUnmodifiableView(); - - private final List list; - - public LazyStringArrayList() { - list = new ArrayList(); - } - - public LazyStringArrayList(LazyStringList from) { - list = new ArrayList(from.size()); - addAll(from); - } - - public LazyStringArrayList(List from) { - list = new ArrayList(from); - } - - @Override - public String get(int index) { - Object o = list.get(index); - if (o instanceof String) { - return (String) o; - } else if (o instanceof ByteString) { - ByteString bs = (ByteString) o; - String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - list.set(index, s); - } - return s; - } else { - byte[] ba = (byte[]) o; - String s = Internal.toStringUtf8(ba); - if (Internal.isValidUtf8(ba)) { - list.set(index, s); - } - return s; - } - } - - @Override - public int size() { - return list.size(); - } - - @Override - public String set(int index, String s) { - Object o = list.set(index, s); - return asString(o); - } - - @Override - public void add(int index, String element) { - list.add(index, element); - modCount++; - } - - @Override - public boolean addAll(Collection c) { - // The default implementation of AbstractCollection.addAll(Collection) - // delegates to add(Object). This implementation instead delegates to - // addAll(int, Collection), which makes a special case for Collections - // which are instances of LazyStringList. - return addAll(size(), c); - } - - @Override - public boolean addAll(int index, Collection c) { - // When copying from another LazyStringList, directly copy the underlying - // elements rather than forcing each element to be decoded to a String. - Collection collection = c instanceof LazyStringList - ? ((LazyStringList) c).getUnderlyingElements() : c; - boolean ret = list.addAll(index, collection); - modCount++; - return ret; - } - - // @Override - public boolean addAllByteString(Collection values) { - boolean ret = list.addAll(values); - modCount++; - return ret; - } - - // @Override - public boolean addAllByteArray(Collection c) { - boolean ret = list.addAll(c); - modCount++; - return ret; - } - - @Override - public String remove(int index) { - Object o = list.remove(index); - modCount++; - return asString(o); - } - - @Override - public void clear() { - list.clear(); - modCount++; - } - - // @Override - public void add(ByteString element) { - list.add(element); - modCount++; - } - - // @Override - public void add(byte[] element) { - list.add(element); - modCount++; - } - - // @Override - public ByteString getByteString(int index) { - Object o = list.get(index); - ByteString b = asByteString(o); - if (b != o) { - list.set(index, b); - } - return b; - } - - // @Override - public byte[] getByteArray(int index) { - Object o = list.get(index); - byte[] b = asByteArray(o); - if (b != o) { - list.set(index, b); - } - return b; - } - - // @Override - public void set(int index, ByteString s) { - list.set(index, s); - } - - // @Override - public void set(int index, byte[] s) { - list.set(index, s); - } - - - private static String asString(Object o) { - if (o instanceof String) { - return (String) o; - } else if (o instanceof ByteString) { - return ((ByteString) o).toStringUtf8(); - } else { - return Internal.toStringUtf8((byte[]) o); - } - } - - private static ByteString asByteString(Object o) { - if (o instanceof ByteString) { - return (ByteString) o; - } else if (o instanceof String) { - return ByteString.copyFromUtf8((String) o); - } else { - return ByteString.copyFrom((byte[]) o); - } - } - - private static byte[] asByteArray(Object o) { - if (o instanceof byte[]) { - return (byte[]) o; - } else if (o instanceof String) { - return Internal.toByteArray((String) o); - } else { - return ((ByteString) o).toByteArray(); - } - } - - // @Override - public List getUnderlyingElements() { - return Collections.unmodifiableList(list); - } - - // @Override - public void mergeFrom(LazyStringList other) { - for (Object o : other.getUnderlyingElements()) { - if (o instanceof byte[]) { - byte[] b = (byte[]) o; - // Byte array's content is mutable so they should be copied rather than - // shared when merging from one message to another. - list.add(Arrays.copyOf(b, b.length)); - } else { - list.add(o); - } - } - } - - private static class ByteArrayListView extends AbstractList - implements RandomAccess { - private final List list; - - ByteArrayListView(List list) { - this.list = list; - } - - @Override - public byte[] get(int index) { - Object o = list.get(index); - byte[] b = asByteArray(o); - if (b != o) { - list.set(index, b); - } - return b; - } - - @Override - public int size() { - return list.size(); - } - - @Override - public byte[] set(int index, byte[] s) { - Object o = list.set(index, s); - modCount++; - return asByteArray(o); - } - - @Override - public void add(int index, byte[] s) { - list.add(index, s); - modCount++; - } - - @Override - public byte[] remove(int index) { - Object o = list.remove(index); - modCount++; - return asByteArray(o); - } - } - - // @Override - public List asByteArrayList() { - return new ByteArrayListView(list); - } - - private static class ByteStringListView extends AbstractList - implements RandomAccess { - private final List list; - - ByteStringListView(List list) { - this.list = list; - } - - @Override - public ByteString get(int index) { - Object o = list.get(index); - ByteString b = asByteString(o); - if (b != o) { - list.set(index, b); - } - return b; - } - - @Override - public int size() { - return list.size(); - } - - @Override - public ByteString set(int index, ByteString s) { - Object o = list.set(index, s); - modCount++; - return asByteString(o); - } - - @Override - public void add(int index, ByteString s) { - list.add(index, s); - modCount++; - } - - @Override - public ByteString remove(int index) { - Object o = list.remove(index); - modCount++; - return asByteString(o); - } - } - - // @Override - public List asByteStringList() { - return new ByteStringListView(list); - } - - // @Override - public LazyStringList getUnmodifiableView() { - return new UnmodifiableLazyStringList(this); - } - -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringList.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringList.java deleted file mode 100644 index 5561587812..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LazyStringList.java +++ /dev/null @@ -1,163 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.Collection; -import java.util.List; - -/** - * An interface extending {@code List} that also provides access to the - * items of the list as UTF8-encoded ByteString or byte[] objects. This is - * used by the protocol buffer implementation to support lazily converting bytes - * parsed over the wire to String objects until needed and also increases the - * efficiency of serialization if the String was never requested as the - * ByteString or byte[] is already cached. The ByteString methods are used in - * immutable API only and byte[] methods used in mutable API only for they use - * different representations for string/bytes fields. - * - * @author jonp@google.com (Jon Perlow) - */ -public interface LazyStringList extends ProtocolStringList { - - /** - * Returns the element at the specified position in this list as a ByteString. - * - * @param index index of the element to return - * @return the element at the specified position in this list - * @throws IndexOutOfBoundsException if the index is out of range - * ({@code index < 0 || index >= size()}) - */ - ByteString getByteString(int index); - - /** - * Returns the element at the specified position in this list as byte[]. - * - * @param index index of the element to return - * @return the element at the specified position in this list - * @throws IndexOutOfBoundsException if the index is out of range - * ({@code index < 0 || index >= size()}) - */ - byte[] getByteArray(int index); - - /** - * Appends the specified element to the end of this list (optional - * operation). - * - * @param element element to be appended to this list - * @throws UnsupportedOperationException if the add operation - * is not supported by this list - */ - void add(ByteString element); - - /** - * Appends the specified element to the end of this list (optional - * operation). - * - * @param element element to be appended to this list - * @throws UnsupportedOperationException if the add operation - * is not supported by this list - */ - void add(byte[] element); - - /** - * Replaces the element at the specified position in this list with the - * specified element (optional operation). - * - * @param index index of the element to replace - * @param element the element to be stored at the specified position - * @throws UnsupportedOperationException if the set operation - * is not supported by this list - * IndexOutOfBoundsException if the index is out of range - * ({@code index < 0 || index >= size()}) - */ - void set(int index, ByteString element); - - /** - * Replaces the element at the specified position in this list with the - * specified element (optional operation). - * - * @param index index of the element to replace - * @param element the element to be stored at the specified position - * @throws UnsupportedOperationException if the set operation - * is not supported by this list - * IndexOutOfBoundsException if the index is out of range - * ({@code index < 0 || index >= size()}) - */ - void set(int index, byte[] element); - - /** - * Appends all elements in the specified ByteString collection to the end of - * this list. - * - * @param c collection whose elements are to be added to this list - * @return true if this list changed as a result of the call - * @throws UnsupportedOperationException if the addAllByteString - * operation is not supported by this list - */ - boolean addAllByteString(Collection c); - - /** - * Appends all elements in the specified byte[] collection to the end of - * this list. - * - * @param c collection whose elements are to be added to this list - * @return true if this list changed as a result of the call - * @throws UnsupportedOperationException if the addAllByteArray - * operation is not supported by this list - */ - boolean addAllByteArray(Collection c); - - /** - * Returns an unmodifiable List of the underlying elements, each of which is - * either a {@code String} or its equivalent UTF-8 encoded {@code ByteString} - * or byte[]. It is an error for the caller to modify the returned - * List, and attempting to do so will result in an - * {@link UnsupportedOperationException}. - */ - List getUnderlyingElements(); - - /** - * Merges all elements from another LazyStringList into this one. This method - * differs from {@link #addAll(Collection)} on that underlying byte arrays are - * copied instead of reference shared. Immutable API doesn't need to use this - * method as byte[] is not used there at all. - */ - void mergeFrom(LazyStringList other); - - /** - * Returns a mutable view of this list. Changes to the view will be made into - * the original list. This method is used in mutable API only. - */ - List asByteArrayList(); - - /** Returns an unmodifiable view of the list. */ - LazyStringList getUnmodifiableView(); -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LiteralByteString.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/LiteralByteString.java deleted file mode 100644 index d2fb11246e..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/LiteralByteString.java +++ /dev/null @@ -1,362 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * This class implements a {@link ByteString} backed by a - * single array of bytes, contiguous in memory. It supports substring by - * pointing to only a sub-range of the underlying byte array, meaning that a - * substring will reference the full byte-array of the string it's made from, - * exactly as with {@link String}. - * - * @author carlanton@google.com (Carl Haverl) - */ -class LiteralByteString extends ByteString { - - protected final byte[] bytes; - - /** - * Creates a {@code LiteralByteString} backed by the given array, without - * copying. - * - * @param bytes array to wrap - */ - LiteralByteString(byte[] bytes) { - this.bytes = bytes; - } - - @Override - public byte byteAt(int index) { - // Unlike most methods in this class, this one is a direct implementation - // ignoring the potential offset because we need to do range-checking in the - // substring case anyway. - return bytes[index]; - } - - @Override - public int size() { - return bytes.length; - } - - // ================================================================= - // ByteString -> substring - - @Override - public ByteString substring(int beginIndex, int endIndex) { - if (beginIndex < 0) { - throw new IndexOutOfBoundsException( - "Beginning index: " + beginIndex + " < 0"); - } - if (endIndex > size()) { - throw new IndexOutOfBoundsException("End index: " + endIndex + " > " + - size()); - } - int substringLength = endIndex - beginIndex; - if (substringLength < 0) { - throw new IndexOutOfBoundsException( - "Beginning index larger than ending index: " + beginIndex + ", " - + endIndex); - } - - ByteString result; - if (substringLength == 0) { - result = ByteString.EMPTY; - } else { - result = new BoundedByteString(bytes, getOffsetIntoBytes() + beginIndex, - substringLength); - } - return result; - } - - // ================================================================= - // ByteString -> byte[] - - @Override - protected void copyToInternal(byte[] target, int sourceOffset, - int targetOffset, int numberToCopy) { - // Optimized form, not for subclasses, since we don't call - // getOffsetIntoBytes() or check the 'numberToCopy' parameter. - System.arraycopy(bytes, sourceOffset, target, targetOffset, numberToCopy); - } - - @Override - public void copyTo(ByteBuffer target) { - target.put(bytes, getOffsetIntoBytes(), size()); // Copies bytes - } - - @Override - public ByteBuffer asReadOnlyByteBuffer() { - ByteBuffer byteBuffer = - ByteBuffer.wrap(bytes, getOffsetIntoBytes(), size()); - return byteBuffer.asReadOnlyBuffer(); - } - - @Override - public List asReadOnlyByteBufferList() { - // Return the ByteBuffer generated by asReadOnlyByteBuffer() as a singleton - List result = new ArrayList(1); - result.add(asReadOnlyByteBuffer()); - return result; - } - - @Override - public void writeTo(OutputStream outputStream) throws IOException { - outputStream.write(toByteArray()); - } - - @Override - void writeToInternal(OutputStream outputStream, int sourceOffset, - int numberToWrite) throws IOException { - outputStream.write(bytes, getOffsetIntoBytes() + sourceOffset, - numberToWrite); - } - - @Override - public String toString(String charsetName) - throws UnsupportedEncodingException { - return new String(bytes, getOffsetIntoBytes(), size(), charsetName); - } - - // ================================================================= - // UTF-8 decoding - - @Override - public boolean isValidUtf8() { - int offset = getOffsetIntoBytes(); - return Utf8.isValidUtf8(bytes, offset, offset + size()); - } - - @Override - protected int partialIsValidUtf8(int state, int offset, int length) { - int index = getOffsetIntoBytes() + offset; - return Utf8.partialIsValidUtf8(state, bytes, index, index + length); - } - - // ================================================================= - // equals() and hashCode() - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if (!(other instanceof ByteString)) { - return false; - } - - if (size() != ((ByteString) other).size()) { - return false; - } - if (size() == 0) { - return true; - } - - if (other instanceof LiteralByteString) { - return equalsRange((LiteralByteString) other, 0, size()); - } else if (other instanceof RopeByteString) { - return other.equals(this); - } else { - throw new IllegalArgumentException( - "Has a new type of ByteString been created? Found " - + other.getClass()); - } - } - - /** - * Check equality of the substring of given length of this object starting at - * zero with another {@code LiteralByteString} substring starting at offset. - * - * @param other what to compare a substring in - * @param offset offset into other - * @param length number of bytes to compare - * @return true for equality of substrings, else false. - */ - boolean equalsRange(LiteralByteString other, int offset, int length) { - if (length > other.size()) { - throw new IllegalArgumentException( - "Length too large: " + length + size()); - } - if (offset + length > other.size()) { - throw new IllegalArgumentException( - "Ran off end of other: " + offset + ", " + length + ", " + - other.size()); - } - - byte[] thisBytes = bytes; - byte[] otherBytes = other.bytes; - int thisLimit = getOffsetIntoBytes() + length; - for (int thisIndex = getOffsetIntoBytes(), otherIndex = - other.getOffsetIntoBytes() + offset; - (thisIndex < thisLimit); ++thisIndex, ++otherIndex) { - if (thisBytes[thisIndex] != otherBytes[otherIndex]) { - return false; - } - } - return true; - } - - /** - * Cached hash value. Intentionally accessed via a data race, which - * is safe because of the Java Memory Model's "no out-of-thin-air values" - * guarantees for ints. - */ - private int hash = 0; - - /** - * Compute the hashCode using the traditional algorithm from {@link - * ByteString}. - * - * @return hashCode value - */ - @Override - public int hashCode() { - int h = hash; - - if (h == 0) { - int size = size(); - h = partialHash(size, 0, size); - if (h == 0) { - h = 1; - } - hash = h; - } - return h; - } - - @Override - protected int peekCachedHashCode() { - return hash; - } - - @Override - protected int partialHash(int h, int offset, int length) { - return hashCode(h, bytes, getOffsetIntoBytes() + offset, length); - } - - static int hashCode(int h, byte[] bytes, int offset, int length) { - for (int i = offset; i < offset + length; i++) { - h = h * 31 + bytes[i]; - } - return h; - } - - static int hashCode(byte[] bytes) { - int h = hashCode(bytes.length, bytes, 0, bytes.length); - return h == 0 ? 1 : h; - } - - // ================================================================= - // Input stream - - @Override - public InputStream newInput() { - return new ByteArrayInputStream(bytes, getOffsetIntoBytes(), - size()); // No copy - } - - @Override - public CodedInputStream newCodedInput() { - // We trust CodedInputStream not to modify the bytes, or to give anyone - // else access to them. - return CodedInputStream.newInstance(this); - } - - // ================================================================= - // ByteIterator - - @Override - public ByteIterator iterator() { - return new LiteralByteIterator(); - } - - private class LiteralByteIterator implements ByteIterator { - private int position; - private final int limit; - - private LiteralByteIterator() { - position = 0; - limit = size(); - } - - public boolean hasNext() { - return (position < limit); - } - - public Byte next() { - // Boxing calls Byte.valueOf(byte), which does not instantiate. - return nextByte(); - } - - public byte nextByte() { - try { - return bytes[position++]; - } catch (ArrayIndexOutOfBoundsException e) { - throw new NoSuchElementException(e.getMessage()); - } - } - - public void remove() { - throw new UnsupportedOperationException(); - } - } - - // ================================================================= - // Internal methods - - @Override - protected int getTreeDepth() { - return 0; - } - - @Override - protected boolean isBalanced() { - return true; - } - - /** - * Offset into {@code bytes[]} to use, non-zero for substrings. - * - * @return always 0 for this class - */ - protected int getOffsetIntoBytes() { - return 0; - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLite.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLite.java deleted file mode 100644 index 908d38319c..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLite.java +++ /dev/null @@ -1,320 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// TODO(kenton): Use generics? E.g. Builder, then -// mergeFrom*() could return BuilderType for better type-safety. - -package retrofit2.kotlin.protobuf; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * Abstract interface implemented by Protocol Message objects. - * - *

This interface is implemented by all protocol message objects. Non-lite - * messages additionally implement the Message interface, which is a subclass - * of MessageLite. Use MessageLite instead when you only need the subset of - * features which it supports -- namely, nothing that uses descriptors or - * reflection. You can instruct the protocol compiler to generate classes - * which implement only MessageLite, not the full Message interface, by adding - * the follow line to the .proto file: - *

- *   option optimize_for = LITE_RUNTIME;
- * 
- * - *

This is particularly useful on resource-constrained systems where the - * full protocol buffers runtime library is too big. - * - *

Note that on non-constrained systems (e.g. servers) when you need to link - * in lots of protocol definitions, a better way to reduce total code footprint - * is to use {@code optimize_for = CODE_SIZE}. This will make the generated - * code smaller while still supporting all the same features (at the expense of - * speed). {@code optimize_for = LITE_RUNTIME} is best when you only have a - * small number of message types linked into your binary, in which case the - * size of the protocol buffers runtime itself is the biggest problem. - * - * @author kenton@google.com Kenton Varda - */ -public interface MessageLite extends MessageLiteOrBuilder { - - - /** - * Serializes the message and writes it to {@code output}. This does not - * flush or close the stream. - */ - void writeTo(CodedOutputStream output) throws IOException; - - /** - * Get the number of bytes required to encode this message. The result - * is only computed on the first call and memoized after that. - */ - int getSerializedSize(); - - - /** - * Gets the parser for a message of the same type as this message. - */ - Parser getParserForType(); - - // ----------------------------------------------------------------- - // Convenience methods. - - /** - * Serializes the message to a {@code ByteString} and returns it. This is - * just a trivial wrapper around - * {@link #writeTo(CodedOutputStream)}. - */ - ByteString toByteString(); - - /** - * Serializes the message to a {@code byte} array and returns it. This is - * just a trivial wrapper around - * {@link #writeTo(CodedOutputStream)}. - */ - byte[] toByteArray(); - - /** - * Serializes the message and writes it to {@code output}. This is just a - * trivial wrapper around {@link #writeTo(CodedOutputStream)}. This does - * not flush or close the stream. - *

- * NOTE: Protocol Buffers are not self-delimiting. Therefore, if you write - * any more data to the stream after the message, you must somehow ensure - * that the parser on the receiving end does not interpret this as being - * part of the protocol message. This can be done e.g. by writing the size - * of the message before the data, then making sure to limit the input to - * that size on the receiving end (e.g. by wrapping the InputStream in one - * which limits the input). Alternatively, just use - * {@link #writeDelimitedTo(OutputStream)}. - */ - void writeTo(OutputStream output) throws IOException; - - /** - * Like {@link #writeTo(OutputStream)}, but writes the size of the message - * as a varint before writing the data. This allows more data to be written - * to the stream after the message without the need to delimit the message - * data yourself. Use {@link Builder#mergeDelimitedFrom(InputStream)} (or - * the static method {@code YourMessageType.parseDelimitedFrom(InputStream)}) - * to parse messages written by this method. - */ - void writeDelimitedTo(OutputStream output) throws IOException; - - - // ================================================================= - // Builders - - /** - * Constructs a new builder for a message of the same type as this message. - */ - Builder newBuilderForType(); - - /** - * Constructs a builder initialized with the current message. Use this to - * derive a new message from the current one. - */ - Builder toBuilder(); - - /** - * Abstract interface implemented by Protocol Message builders. - */ - interface Builder extends MessageLiteOrBuilder, Cloneable { - /** Resets all fields to their default values. */ - Builder clear(); - - /** - * Constructs the message based on the state of the Builder. Subsequent - * changes to the Builder will not affect the returned message. - * @throws UninitializedMessageException The message is missing one or more - * required fields (i.e. {@link #isInitialized()} returns false). - * Use {@link #buildPartial()} to bypass this check. - */ - MessageLite build(); - - /** - * Like {@link #build()}, but does not throw an exception if the message - * is missing required fields. Instead, a partial message is returned. - * Subsequent changes to the Builder will not affect the returned message. - */ - MessageLite buildPartial(); - - /** - * Clones the Builder. - * @see Object#clone() - */ - Builder clone(); - - /** - * Parses a message of this type from the input and merges it with this - * message. - * - *

Warning: This does not verify that all required fields are present in - * the input message. If you call {@link #build()} without setting all - * required fields, it will throw an {@link UninitializedMessageException}, - * which is a {@code RuntimeException} and thus might not be caught. There - * are a few good ways to deal with this: - *

    - *
  • Call {@link #isInitialized()} to verify that all required fields - * are set before building. - *
  • Use {@code buildPartial()} to build, which ignores missing - * required fields. - *
- * - *

Note: The caller should call - * {@link CodedInputStream#checkLastTagWas(int)} after calling this to - * verify that the last tag seen was the appropriate end-group tag, - * or zero for EOF. - */ - Builder mergeFrom(CodedInputStream input) throws IOException; - - /** - * Like {@link Builder#mergeFrom(CodedInputStream)}, but also - * parses extensions. The extensions that you want to be able to parse - * must be registered in {@code extensionRegistry}. Extensions not in - * the registry will be treated as unknown fields. - */ - Builder mergeFrom(CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws IOException; - - // --------------------------------------------------------------- - // Convenience methods. - - /** - * Parse {@code data} as a message of this type and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream)}. - * - * @return this - */ - Builder mergeFrom(ByteString data) throws InvalidProtocolBufferException; - - /** - * Parse {@code data} as a message of this type and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. - * - * @return this - */ - Builder mergeFrom(ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Parse {@code data} as a message of this type and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream)}. - * - * @return this - */ - Builder mergeFrom(byte[] data) throws InvalidProtocolBufferException; - - /** - * Parse {@code data} as a message of this type and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream)}. - * - * @return this - */ - Builder mergeFrom(byte[] data, int off, int len) - throws InvalidProtocolBufferException; - - /** - * Parse {@code data} as a message of this type and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. - * - * @return this - */ - Builder mergeFrom(byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Parse {@code data} as a message of this type and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. - * - * @return this - */ - Builder mergeFrom(byte[] data, int off, int len, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Parse a message of this type from {@code input} and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream)}. Note that this method always - * reads the entire input (unless it throws an exception). If you - * want it to stop earlier, you will need to wrap your input in some - * wrapper stream that limits reading. Or, use - * {@link MessageLite#writeDelimitedTo(OutputStream)} to write your message - * and {@link #mergeDelimitedFrom(InputStream)} to read it. - *

- * Despite usually reading the entire input, this does not close the stream. - * - * @return this - */ - Builder mergeFrom(InputStream input) throws IOException; - - /** - * Parse a message of this type from {@code input} and merge it with the - * message being built. This is just a small wrapper around - * {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. - * - * @return this - */ - Builder mergeFrom(InputStream input, - ExtensionRegistryLite extensionRegistry) - throws IOException; - - /** - * Like {@link #mergeFrom(InputStream)}, but does not read until EOF. - * Instead, the size of the message (encoded as a varint) is read first, - * then the message data. Use - * {@link MessageLite#writeDelimitedTo(OutputStream)} to write messages in - * this format. - * - * @return True if successful, or false if the stream is at EOF when the - * method starts. Any other error (including reaching EOF during - * parsing) will cause an exception to be thrown. - */ - boolean mergeDelimitedFrom(InputStream input) - throws IOException; - - /** - * Like {@link #mergeDelimitedFrom(InputStream)} but supporting extensions. - */ - boolean mergeDelimitedFrom(InputStream input, - ExtensionRegistryLite extensionRegistry) - throws IOException; - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLiteOrBuilder.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLiteOrBuilder.java deleted file mode 100644 index c3fa05221c..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/MessageLiteOrBuilder.java +++ /dev/null @@ -1,60 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -/** - * Base interface for methods common to {@link MessageLite} - * and {@link MessageLite.Builder} to provide type equivalency. - * - * @author jonp@google.com (Jon Perlow) - */ -public interface MessageLiteOrBuilder { - /** - * Get an instance of the type with no fields set. Because no fields are set, - * all getters for singular fields will return default values and repeated - * fields will appear empty. - * This may or may not be a singleton. This differs from the - * {@code getDefaultInstance()} method of generated message classes in that - * this method is an abstract method of the {@code MessageLite} interface - * whereas {@code getDefaultInstance()} is a static method of a specific - * class. They return the same thing. - */ - MessageLite getDefaultInstanceForType(); - - /** - * Returns true if all required fields in the message and all embedded - * messages are set, false otherwise. - * - *

See also: {@link MessageOrBuilder#getInitializationErrorString()} - */ - boolean isInitialized(); - -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/Parser.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Parser.java deleted file mode 100644 index beb2dde7c2..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/Parser.java +++ /dev/null @@ -1,197 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.InputStream; - -/** - * Abstract interface for parsing Protocol Messages. - * - * The implementation should be stateless and thread-safe. - * - * @author liujisi@google.com (Pherl Liu) - */ -public interface Parser { - /** - * Parses a message of {@code MessageType} from the input. - * - *

Note: The caller should call - * {@link CodedInputStream#checkLastTagWas(int)} after calling this to - * verify that the last tag seen was the appropriate end-group tag, - * or zero for EOF. - */ - public MessageType parseFrom(CodedInputStream input) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseFrom(CodedInputStream)}, but also parses extensions. - * The extensions that you want to be able to parse must be registered in - * {@code extensionRegistry}. Extensions not in the registry will be treated - * as unknown fields. - */ - public MessageType parseFrom(CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseFrom(CodedInputStream input, ExtensionRegistryLite)}, - * but does not throw an exception if the message is missing required fields. - * Instead, a partial message is returned. - */ - public MessageType parsePartialFrom(CodedInputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - // --------------------------------------------------------------- - // Convenience methods. - - /** - * Parses {@code data} as a message of {@code MessageType}. - * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. - */ - public MessageType parseFrom(ByteString data) - throws InvalidProtocolBufferException; - - /** - * Parses {@code data} as a message of {@code MessageType}. - * This is just a small wrapper around - * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}. - */ - public MessageType parseFrom(ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseFrom(ByteString, ExtensionRegistryLite)}, - * but does not throw an exception if the message is missing required fields. - * Instead, a partial message is returned. - */ - public MessageType parsePartialFrom(ByteString data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Parses {@code data} as a message of {@code MessageType}. - * This is just a small wrapper around - * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}. - */ - public MessageType parseFrom(byte[] data, int off, int len, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Parses {@code data} as a message of {@code MessageType}. - * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. - */ - public MessageType parseFrom(byte[] data) - throws InvalidProtocolBufferException; - - /** - * Parses {@code data} as a message of {@code MessageType}. - * This is just a small wrapper around - * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}. - */ - public MessageType parseFrom(byte[] data, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseFrom(ByteString, ExtensionRegistryLite)}, - * but does not throw an exception if the message is missing required fields. - * Instead, a partial message is returned. - */ - public MessageType parsePartialFrom(byte[] data, int off, int len, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Parse a message of {@code MessageType} from {@code input}. - * This is just a small wrapper around {@link #parseFrom(CodedInputStream)}. - * Note that this method always reads the entire input (unless it - * throws an exception). If you want it to stop earlier, you will need to - * wrap your input in some wrapper stream that limits reading. Or, use - * {@link MessageLite#writeDelimitedTo(java.io.OutputStream)} to write your - * message and {@link #parseDelimitedFrom(InputStream)} to read it. - *

- * Despite usually reading the entire input, this does not close the stream. - */ - public MessageType parseFrom(InputStream input) - throws InvalidProtocolBufferException; - - /** - * Parses a message of {@code MessageType} from {@code input}. - * This is just a small wrapper around - * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}. - */ - public MessageType parseFrom(InputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseFrom(InputStream, ExtensionRegistryLite)}, - * but does not throw an exception if the message is missing required fields. - * Instead, a partial message is returned. - */ - public MessageType parsePartialFrom(InputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseFrom(InputStream)}, but does not read util EOF. - * Instead, the size of message (encoded as a varint) is read first, - * then the message data. Use - * {@link MessageLite#writeDelimitedTo(java.io.OutputStream)} to write - * messages in this format. - * - * @return True if successful, or false if the stream is at EOF when the - * method starts. Any other error (including reaching EOF during - * parsing) will cause an exception to be thrown. - */ - public MessageType parseDelimitedFrom(InputStream input) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseDelimitedFrom(InputStream)} but supporting extensions. - */ - public MessageType parseDelimitedFrom(InputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; - - /** - * Like {@link #parseDelimitedFrom(InputStream, ExtensionRegistryLite)}, - * but does not throw an exception if the message is missing required fields. - * Instead, a partial message is returned. - */ - public MessageType parsePartialDelimitedFrom( - InputStream input, - ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException; -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/ProtocolStringList.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/ProtocolStringList.java deleted file mode 100644 index dcc2eaa5c0..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/ProtocolStringList.java +++ /dev/null @@ -1,48 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.List; - -/** - * An interface extending {@code List} used for repeated string fields - * to provide optional access to the data as a list of ByteStrings. The - * underlying implementation stores values as either ByteStrings or Strings - * (see {@link LazyStringArrayList}) depending on how the value was initialized - * or last read, and it is often more efficient to deal with lists of - * ByteStrings when handling protos that have been deserialized from bytes. - */ -public interface ProtocolStringList extends List { - - /** Returns a view of the data as a list of ByteStrings. */ - List asByteStringList(); - -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/RopeByteString.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/RopeByteString.java deleted file mode 100644 index 735a36edd4..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/RopeByteString.java +++ /dev/null @@ -1,957 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.io.ByteArrayInputStream; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Stack; - -/** - * Class to represent {@code ByteStrings} formed by concatenation of other - * ByteStrings, without copying the data in the pieces. The concatenation is - * represented as a tree whose leaf nodes are each a {@link LiteralByteString}. - * - *

Most of the operation here is inspired by the now-famous paper - * BAP95 Ropes: an Alternative to Strings hans-j. boehm, russ atkinson and - * michael plass - * - *

The algorithms described in the paper have been implemented for character - * strings in {@link com.google.common.string.Rope} and in the c++ class {@code - * cord.cc}. - * - *

Fundamentally the Rope algorithm represents the collection of pieces as a - * binary tree. BAP95 uses a Fibonacci bound relating depth to a minimum - * sequence length, sequences that are too short relative to their depth cause a - * tree rebalance. More precisely, a tree of depth d is "balanced" in the - * terminology of BAP95 if its length is at least F(d+2), where F(n) is the - * n-the Fibonacci number. Thus for depths 0, 1, 2, 3, 4, 5,... we have minimum - * lengths 1, 2, 3, 5, 8, 13,... - * - * @author carlanton@google.com (Carl Haverl) - */ -class RopeByteString extends ByteString { - - /** - * BAP95. Let Fn be the nth Fibonacci number. A {@link RopeByteString} of - * depth n is "balanced", i.e flat enough, if its length is at least Fn+2, - * e.g. a "balanced" {@link RopeByteString} of depth 1 must have length at - * least 2, of depth 4 must have length >= 8, etc. - * - *

There's nothing special about using the Fibonacci numbers for this, but - * they are a reasonable sequence for encapsulating the idea that we are OK - * with longer strings being encoded in deeper binary trees. - * - *

For 32-bit integers, this array has length 46. - */ - private static final int[] minLengthByDepth; - - static { - // Dynamically generate the list of Fibonacci numbers the first time this - // class is accessed. - List numbers = new ArrayList(); - - // we skip the first Fibonacci number (1). So instead of: 1 1 2 3 5 8 ... - // we have: 1 2 3 5 8 ... - int f1 = 1; - int f2 = 1; - - // get all the values until we roll over. - while (f2 > 0) { - numbers.add(f2); - int temp = f1 + f2; - f1 = f2; - f2 = temp; - } - - // we include this here so that we can index this array to [x + 1] in the - // loops below. - numbers.add(Integer.MAX_VALUE); - minLengthByDepth = new int[numbers.size()]; - for (int i = 0; i < minLengthByDepth.length; i++) { - // unbox all the values - minLengthByDepth[i] = numbers.get(i); - } - } - - private final int totalLength; - private final ByteString left; - private final ByteString right; - private final int leftLength; - private final int treeDepth; - - /** - * Create a new RopeByteString, which can be thought of as a new tree node, by - * recording references to the two given strings. - * - * @param left string on the left of this node, should have {@code size() > - * 0} - * @param right string on the right of this node, should have {@code size() > - * 0} - */ - private RopeByteString(ByteString left, ByteString right) { - this.left = left; - this.right = right; - leftLength = left.size(); - totalLength = leftLength + right.size(); - treeDepth = Math.max(left.getTreeDepth(), right.getTreeDepth()) + 1; - } - - /** - * Concatenate the given strings while performing various optimizations to - * slow the growth rate of tree depth and tree node count. The result is - * either a {@link LiteralByteString} or a {@link RopeByteString} - * depending on which optimizations, if any, were applied. - * - *

Small pieces of length less than {@link - * ByteString#CONCATENATE_BY_COPY_SIZE} may be copied by value here, as in - * BAP95. Large pieces are referenced without copy. - * - * @param left string on the left - * @param right string on the right - * @return concatenation representing the same sequence as the given strings - */ - static ByteString concatenate(ByteString left, ByteString right) { - ByteString result; - RopeByteString leftRope = - (left instanceof RopeByteString) ? (RopeByteString) left : null; - if (right.size() == 0) { - result = left; - } else if (left.size() == 0) { - result = right; - } else { - int newLength = left.size() + right.size(); - if (newLength < CONCATENATE_BY_COPY_SIZE) { - // Optimization from BAP95: For short (leaves in paper, but just short - // here) total length, do a copy of data to a new leaf. - result = concatenateBytes(left, right); - } else if (leftRope != null - && leftRope.right.size() + right.size() < CONCATENATE_BY_COPY_SIZE) { - // Optimization from BAP95: As an optimization of the case where the - // ByteString is constructed by repeated concatenate, recognize the case - // where a short string is concatenated to a left-hand node whose - // right-hand branch is short. In the paper this applies to leaves, but - // we just look at the length here. This has the advantage of shedding - // references to unneeded data when substrings have been taken. - // - // When we recognize this case, we do a copy of the data and create a - // new parent node so that the depth of the result is the same as the - // given left tree. - ByteString newRight = concatenateBytes(leftRope.right, right); - result = new RopeByteString(leftRope.left, newRight); - } else if (leftRope != null - && leftRope.left.getTreeDepth() > leftRope.right.getTreeDepth() - && leftRope.getTreeDepth() > right.getTreeDepth()) { - // Typically for concatenate-built strings the left-side is deeper than - // the right. This is our final attempt to concatenate without - // increasing the tree depth. We'll redo the the node on the RHS. This - // is yet another optimization for building the string by repeatedly - // concatenating on the right. - ByteString newRight = new RopeByteString(leftRope.right, right); - result = new RopeByteString(leftRope.left, newRight); - } else { - // Fine, we'll add a node and increase the tree depth--unless we - // rebalance ;^) - int newDepth = Math.max(left.getTreeDepth(), right.getTreeDepth()) + 1; - if (newLength >= minLengthByDepth[newDepth]) { - // The tree is shallow enough, so don't rebalance - result = new RopeByteString(left, right); - } else { - result = new Balancer().balance(left, right); - } - } - } - return result; - } - - /** - * Concatenates two strings by copying data values. This is called in a few - * cases in order to reduce the growth of the number of tree nodes. - * - * @param left string on the left - * @param right string on the right - * @return string formed by copying data bytes - */ - private static LiteralByteString concatenateBytes(ByteString left, - ByteString right) { - int leftSize = left.size(); - int rightSize = right.size(); - byte[] bytes = new byte[leftSize + rightSize]; - left.copyTo(bytes, 0, 0, leftSize); - right.copyTo(bytes, 0, leftSize, rightSize); - return new LiteralByteString(bytes); // Constructor wraps bytes - } - - /** - * Create a new RopeByteString for testing only while bypassing all the - * defenses of {@link #concatenate(ByteString, ByteString)}. This allows - * testing trees of specific structure. We are also able to insert empty - * leaves, though these are dis-allowed, so that we can make sure the - * implementation can withstand their presence. - * - * @param left string on the left of this node - * @param right string on the right of this node - * @return an unsafe instance for testing only - */ - static RopeByteString newInstanceForTest(ByteString left, ByteString right) { - return new RopeByteString(left, right); - } - - /** - * Gets the byte at the given index. - * Throws {@link ArrayIndexOutOfBoundsException} for backwards-compatibility - * reasons although it would more properly be {@link - * IndexOutOfBoundsException}. - * - * @param index index of byte - * @return the value - * @throws ArrayIndexOutOfBoundsException {@code index} is < 0 or >= size - */ - @Override - public byte byteAt(int index) { - if (index < 0) { - throw new ArrayIndexOutOfBoundsException("Index < 0: " + index); - } - if (index > totalLength) { - throw new ArrayIndexOutOfBoundsException( - "Index > length: " + index + ", " + totalLength); - } - - byte result; - // Find the relevant piece by recursive descent - if (index < leftLength) { - result = left.byteAt(index); - } else { - result = right.byteAt(index - leftLength); - } - return result; - } - - @Override - public int size() { - return totalLength; - } - - // ================================================================= - // Pieces - - @Override - protected int getTreeDepth() { - return treeDepth; - } - - /** - * Determines if the tree is balanced according to BAP95, which means the tree - * is flat-enough with respect to the bounds. Note that this definition of - * balanced is one where sub-trees of balanced trees are not necessarily - * balanced. - * - * @return true if the tree is balanced - */ - @Override - protected boolean isBalanced() { - return totalLength >= minLengthByDepth[treeDepth]; - } - - /** - * Takes a substring of this one. This involves recursive descent along the - * left and right edges of the substring, and referencing any wholly contained - * segments in between. Any leaf nodes entirely uninvolved in the substring - * will not be referenced by the substring. - * - *

Substrings of {@code length < 2} should result in at most a single - * recursive call chain, terminating at a leaf node. Thus the result will be a - * {@link LiteralByteString}. {@link #RopeByteString(ByteString, - * ByteString)}. - * - * @param beginIndex start at this index - * @param endIndex the last character is the one before this index - * @return substring leaf node or tree - */ - @Override - public ByteString substring(int beginIndex, int endIndex) { - if (beginIndex < 0) { - throw new IndexOutOfBoundsException( - "Beginning index: " + beginIndex + " < 0"); - } - if (endIndex > totalLength) { - throw new IndexOutOfBoundsException( - "End index: " + endIndex + " > " + totalLength); - } - int substringLength = endIndex - beginIndex; - if (substringLength < 0) { - throw new IndexOutOfBoundsException( - "Beginning index larger than ending index: " + beginIndex + ", " - + endIndex); - } - - ByteString result; - if (substringLength == 0) { - // Empty substring - result = EMPTY; - } else if (substringLength == totalLength) { - // The whole string - result = this; - } else { - // Proper substring - if (endIndex <= leftLength) { - // Substring on the left - result = left.substring(beginIndex, endIndex); - } else if (beginIndex >= leftLength) { - // Substring on the right - result = right - .substring(beginIndex - leftLength, endIndex - leftLength); - } else { - // Split substring - ByteString leftSub = left.substring(beginIndex); - ByteString rightSub = right.substring(0, endIndex - leftLength); - // Intentionally not rebalancing, since in many cases these two - // substrings will already be less deep than the top-level - // RopeByteString we're taking a substring of. - result = new RopeByteString(leftSub, rightSub); - } - } - return result; - } - - // ================================================================= - // ByteString -> byte[] - - @Override - protected void copyToInternal(byte[] target, int sourceOffset, - int targetOffset, int numberToCopy) { - if (sourceOffset + numberToCopy <= leftLength) { - left.copyToInternal(target, sourceOffset, targetOffset, numberToCopy); - } else if (sourceOffset >= leftLength) { - right.copyToInternal(target, sourceOffset - leftLength, targetOffset, - numberToCopy); - } else { - int leftLength = this.leftLength - sourceOffset; - left.copyToInternal(target, sourceOffset, targetOffset, leftLength); - right.copyToInternal(target, 0, targetOffset + leftLength, - numberToCopy - leftLength); - } - } - - @Override - public void copyTo(ByteBuffer target) { - left.copyTo(target); - right.copyTo(target); - } - - @Override - public ByteBuffer asReadOnlyByteBuffer() { - ByteBuffer byteBuffer = ByteBuffer.wrap(toByteArray()); - return byteBuffer.asReadOnlyBuffer(); - } - - @Override - public List asReadOnlyByteBufferList() { - // Walk through the list of LiteralByteString's that make up this - // rope, and add each one as a read-only ByteBuffer. - List result = new ArrayList(); - PieceIterator pieces = new PieceIterator(this); - while (pieces.hasNext()) { - LiteralByteString byteString = pieces.next(); - result.add(byteString.asReadOnlyByteBuffer()); - } - return result; - } - - @Override - public void writeTo(OutputStream outputStream) throws IOException { - left.writeTo(outputStream); - right.writeTo(outputStream); - } - - @Override - void writeToInternal(OutputStream out, int sourceOffset, - int numberToWrite) throws IOException { - if (sourceOffset + numberToWrite <= leftLength) { - left.writeToInternal(out, sourceOffset, numberToWrite); - } else if (sourceOffset >= leftLength) { - right.writeToInternal(out, sourceOffset - leftLength, numberToWrite); - } else { - int numberToWriteInLeft = leftLength - sourceOffset; - left.writeToInternal(out, sourceOffset, numberToWriteInLeft); - right.writeToInternal(out, 0, numberToWrite - numberToWriteInLeft); - } - } - - @Override - public String toString(String charsetName) - throws UnsupportedEncodingException { - return new String(toByteArray(), charsetName); - } - - // ================================================================= - // UTF-8 decoding - - @Override - public boolean isValidUtf8() { - int leftPartial = left.partialIsValidUtf8(Utf8.COMPLETE, 0, leftLength); - int state = right.partialIsValidUtf8(leftPartial, 0, right.size()); - return state == Utf8.COMPLETE; - } - - @Override - protected int partialIsValidUtf8(int state, int offset, int length) { - int toIndex = offset + length; - if (toIndex <= leftLength) { - return left.partialIsValidUtf8(state, offset, length); - } else if (offset >= leftLength) { - return right.partialIsValidUtf8(state, offset - leftLength, length); - } else { - int leftLength = this.leftLength - offset; - int leftPartial = left.partialIsValidUtf8(state, offset, leftLength); - return right.partialIsValidUtf8(leftPartial, 0, length - leftLength); - } - } - - // ================================================================= - // equals() and hashCode() - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if (!(other instanceof ByteString)) { - return false; - } - - ByteString otherByteString = (ByteString) other; - if (totalLength != otherByteString.size()) { - return false; - } - if (totalLength == 0) { - return true; - } - - // You don't really want to be calling equals on long strings, but since - // we cache the hashCode, we effectively cache inequality. We use the cached - // hashCode if it's already computed. It's arguable we should compute the - // hashCode here, and if we're going to be testing a bunch of byteStrings, - // it might even make sense. - if (hash != 0) { - int cachedOtherHash = otherByteString.peekCachedHashCode(); - if (cachedOtherHash != 0 && hash != cachedOtherHash) { - return false; - } - } - - return equalsFragments(otherByteString); - } - - /** - * Determines if this string is equal to another of the same length by - * iterating over the leaf nodes. On each step of the iteration, the - * overlapping segments of the leaves are compared. - * - * @param other string of the same length as this one - * @return true if the values of this string equals the value of the given - * one - */ - private boolean equalsFragments(ByteString other) { - int thisOffset = 0; - Iterator thisIter = new PieceIterator(this); - LiteralByteString thisString = thisIter.next(); - - int thatOffset = 0; - Iterator thatIter = new PieceIterator(other); - LiteralByteString thatString = thatIter.next(); - - int pos = 0; - while (true) { - int thisRemaining = thisString.size() - thisOffset; - int thatRemaining = thatString.size() - thatOffset; - int bytesToCompare = Math.min(thisRemaining, thatRemaining); - - // At least one of the offsets will be zero - boolean stillEqual = (thisOffset == 0) - ? thisString.equalsRange(thatString, thatOffset, bytesToCompare) - : thatString.equalsRange(thisString, thisOffset, bytesToCompare); - if (!stillEqual) { - return false; - } - - pos += bytesToCompare; - if (pos >= totalLength) { - if (pos == totalLength) { - return true; - } - throw new IllegalStateException(); - } - // We always get to the end of at least one of the pieces - if (bytesToCompare == thisRemaining) { // If reached end of this - thisOffset = 0; - thisString = thisIter.next(); - } else { - thisOffset += bytesToCompare; - } - if (bytesToCompare == thatRemaining) { // If reached end of that - thatOffset = 0; - thatString = thatIter.next(); - } else { - thatOffset += bytesToCompare; - } - } - } - - /** - * Cached hash value. Intentionally accessed via a data race, which is safe - * because of the Java Memory Model's "no out-of-thin-air values" guarantees - * for ints. - */ - private int hash = 0; - - @Override - public int hashCode() { - int h = hash; - - if (h == 0) { - h = totalLength; - h = partialHash(h, 0, totalLength); - if (h == 0) { - h = 1; - } - hash = h; - } - return h; - } - - @Override - protected int peekCachedHashCode() { - return hash; - } - - @Override - protected int partialHash(int h, int offset, int length) { - int toIndex = offset + length; - if (toIndex <= leftLength) { - return left.partialHash(h, offset, length); - } else if (offset >= leftLength) { - return right.partialHash(h, offset - leftLength, length); - } else { - int leftLength = this.leftLength - offset; - int leftPartial = left.partialHash(h, offset, leftLength); - return right.partialHash(leftPartial, 0, length - leftLength); - } - } - - // ================================================================= - // Input stream - - @Override - public CodedInputStream newCodedInput() { - return CodedInputStream.newInstance(new RopeInputStream()); - } - - @Override - public InputStream newInput() { - return new RopeInputStream(); - } - - /** - * This class implements the balancing algorithm of BAP95. In the paper the - * authors use an array to keep track of pieces, while here we use a stack. - * The tree is balanced by traversing subtrees in left to right order, and the - * stack always contains the part of the string we've traversed so far. - * - *

One surprising aspect of the algorithm is the result of balancing is not - * necessarily balanced, though it is nearly balanced. For details, see - * BAP95. - */ - private static class Balancer { - // Stack containing the part of the string, starting from the left, that - // we've already traversed. The final string should be the equivalent of - // concatenating the strings on the stack from bottom to top. - private final Stack prefixesStack = new Stack(); - - private ByteString balance(ByteString left, ByteString right) { - doBalance(left); - doBalance(right); - - // Sweep stack to gather the result - ByteString partialString = prefixesStack.pop(); - while (!prefixesStack.isEmpty()) { - ByteString newLeft = prefixesStack.pop(); - partialString = new RopeByteString(newLeft, partialString); - } - // We should end up with a RopeByteString since at a minimum we will - // create one from concatenating left and right - return partialString; - } - - private void doBalance(ByteString root) { - // BAP95: Insert balanced subtrees whole. This means the result might not - // be balanced, leading to repeated rebalancings on concatenate. However, - // these rebalancings are shallow due to ignoring balanced subtrees, and - // relatively few calls to insert() result. - if (root.isBalanced()) { - insert(root); - } else if (root instanceof RopeByteString) { - RopeByteString rbs = (RopeByteString) root; - doBalance(rbs.left); - doBalance(rbs.right); - } else { - throw new IllegalArgumentException( - "Has a new type of ByteString been created? Found " + - root.getClass()); - } - } - - /** - * Push a string on the balance stack (BAP95). BAP95 uses an array and - * calls the elements in the array 'bins'. We instead use a stack, so the - * 'bins' of lengths are represented by differences between the elements of - * minLengthByDepth. - * - *

If the length bin for our string, and all shorter length bins, are - * empty, we just push it on the stack. Otherwise, we need to start - * concatenating, putting the given string in the "middle" and continuing - * until we land in an empty length bin that matches the length of our - * concatenation. - * - * @param byteString string to place on the balance stack - */ - private void insert(ByteString byteString) { - int depthBin = getDepthBinForLength(byteString.size()); - int binEnd = minLengthByDepth[depthBin + 1]; - - // BAP95: Concatenate all trees occupying bins representing the length of - // our new piece or of shorter pieces, to the extent that is possible. - // The goal is to clear the bin which our piece belongs in, but that may - // not be entirely possible if there aren't enough longer bins occupied. - if (prefixesStack.isEmpty() || prefixesStack.peek().size() >= binEnd) { - prefixesStack.push(byteString); - } else { - int binStart = minLengthByDepth[depthBin]; - - // Concatenate the subtrees of shorter length - ByteString newTree = prefixesStack.pop(); - while (!prefixesStack.isEmpty() - && prefixesStack.peek().size() < binStart) { - ByteString left = prefixesStack.pop(); - newTree = new RopeByteString(left, newTree); - } - - // Concatenate the given string - newTree = new RopeByteString(newTree, byteString); - - // Continue concatenating until we land in an empty bin - while (!prefixesStack.isEmpty()) { - depthBin = getDepthBinForLength(newTree.size()); - binEnd = minLengthByDepth[depthBin + 1]; - if (prefixesStack.peek().size() < binEnd) { - ByteString left = prefixesStack.pop(); - newTree = new RopeByteString(left, newTree); - } else { - break; - } - } - prefixesStack.push(newTree); - } - } - - private int getDepthBinForLength(int length) { - int depth = Arrays.binarySearch(minLengthByDepth, length); - if (depth < 0) { - // It wasn't an exact match, so convert to the index of the containing - // fragment, which is one less even than the insertion point. - int insertionPoint = -(depth + 1); - depth = insertionPoint - 1; - } - - return depth; - } - } - - /** - * This class is a continuable tree traversal, which keeps the state - * information which would exist on the stack in a recursive traversal instead - * on a stack of "Bread Crumbs". The maximum depth of the stack in this - * iterator is the same as the depth of the tree being traversed. - * - *

This iterator is used to implement - * {@link RopeByteString#equalsFragments(ByteString)}. - */ - private static class PieceIterator implements Iterator { - - private final Stack breadCrumbs = - new Stack(); - private LiteralByteString next; - - private PieceIterator(ByteString root) { - next = getLeafByLeft(root); - } - - private LiteralByteString getLeafByLeft(ByteString root) { - ByteString pos = root; - while (pos instanceof RopeByteString) { - RopeByteString rbs = (RopeByteString) pos; - breadCrumbs.push(rbs); - pos = rbs.left; - } - return (LiteralByteString) pos; - } - - private LiteralByteString getNextNonEmptyLeaf() { - while (true) { - // Almost always, we go through this loop exactly once. However, if - // we discover an empty string in the rope, we toss it and try again. - if (breadCrumbs.isEmpty()) { - return null; - } else { - LiteralByteString result = getLeafByLeft(breadCrumbs.pop().right); - if (!result.isEmpty()) { - return result; - } - } - } - } - - public boolean hasNext() { - return next != null; - } - - /** - * Returns the next item and advances one {@code LiteralByteString}. - * - * @return next non-empty LiteralByteString or {@code null} - */ - public LiteralByteString next() { - if (next == null) { - throw new NoSuchElementException(); - } - LiteralByteString result = next; - next = getNextNonEmptyLeaf(); - return result; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - } - - // ================================================================= - // ByteIterator - - @Override - public ByteIterator iterator() { - return new RopeByteIterator(); - } - - private class RopeByteIterator implements ByteString.ByteIterator { - - private final PieceIterator pieces; - private ByteIterator bytes; - int bytesRemaining; - - private RopeByteIterator() { - pieces = new PieceIterator(RopeByteString.this); - bytes = pieces.next().iterator(); - bytesRemaining = size(); - } - - public boolean hasNext() { - return (bytesRemaining > 0); - } - - public Byte next() { - return nextByte(); // Does not instantiate a Byte - } - - public byte nextByte() { - if (!bytes.hasNext()) { - bytes = pieces.next().iterator(); - } - --bytesRemaining; - return bytes.nextByte(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - } - - /** - * This class is the {@link RopeByteString} equivalent for - * {@link ByteArrayInputStream}. - */ - private class RopeInputStream extends InputStream { - // Iterates through the pieces of the rope - private PieceIterator pieceIterator; - // The current piece - private LiteralByteString currentPiece; - // The size of the current piece - private int currentPieceSize; - // The index of the next byte to read in the current piece - private int currentPieceIndex; - // The offset of the start of the current piece in the rope byte string - private int currentPieceOffsetInRope; - // Offset in the buffer at which user called mark(); - private int mark; - - public RopeInputStream() { - initialize(); - } - - @Override - public int read(byte b[], int offset, int length) { - if (b == null) { - throw new NullPointerException(); - } else if (offset < 0 || length < 0 || length > b.length - offset) { - throw new IndexOutOfBoundsException(); - } - return readSkipInternal(b, offset, length); - } - - @Override - public long skip(long length) { - if (length < 0) { - throw new IndexOutOfBoundsException(); - } else if (length > Integer.MAX_VALUE) { - length = Integer.MAX_VALUE; - } - return readSkipInternal(null, 0, (int) length); - } - - /** - * Internal implementation of read and skip. If b != null, then read the - * next {@code length} bytes into the buffer {@code b} at - * offset {@code offset}. If b == null, then skip the next {@code length) - * bytes. - *

- * This method assumes that all error checking has already happened. - *

- * Returns the actual number of bytes read or skipped. - */ - private int readSkipInternal(byte b[], int offset, int length) { - int bytesRemaining = length; - while (bytesRemaining > 0) { - advanceIfCurrentPieceFullyRead(); - if (currentPiece == null) { - if (bytesRemaining == length) { - // We didn't manage to read anything - return -1; - } - break; - } else { - // Copy the bytes from this piece. - int currentPieceRemaining = currentPieceSize - currentPieceIndex; - int count = Math.min(currentPieceRemaining, bytesRemaining); - if (b != null) { - currentPiece.copyTo(b, currentPieceIndex, offset, count); - offset += count; - } - currentPieceIndex += count; - bytesRemaining -= count; - } - } - // Return the number of bytes read. - return length - bytesRemaining; - } - - @Override - public int read() throws IOException { - advanceIfCurrentPieceFullyRead(); - if (currentPiece == null) { - return -1; - } else { - return currentPiece.byteAt(currentPieceIndex++) & 0xFF; - } - } - - @Override - public int available() throws IOException { - int bytesRead = currentPieceOffsetInRope + currentPieceIndex; - return RopeByteString.this.size() - bytesRead; - } - - @Override - public boolean markSupported() { - return true; - } - - @Override - public void mark(int readAheadLimit) { - // Set the mark to our position in the byte string - mark = currentPieceOffsetInRope + currentPieceIndex; - } - - @Override - public synchronized void reset() { - // Just reinitialize and skip the specified number of bytes. - initialize(); - readSkipInternal(null, 0, mark); - } - - /** Common initialization code used by both the constructor and reset() */ - private void initialize() { - pieceIterator = new PieceIterator(RopeByteString.this); - currentPiece = pieceIterator.next(); - currentPieceSize = currentPiece.size(); - currentPieceIndex = 0; - currentPieceOffsetInRope = 0; - } - - /** - * Skips to the next piece if we have read all the data in the current - * piece. Sets currentPiece to null if we have reached the end of the - * input. - */ - private void advanceIfCurrentPieceFullyRead() { - if (currentPiece != null && currentPieceIndex == currentPieceSize) { - // Generally, we can only go through this loop at most once, since - // empty strings can't end up in a rope. But better to test. - currentPieceOffsetInRope += currentPieceSize; - currentPieceIndex = 0; - if (pieceIterator.hasNext()) { - currentPiece = pieceIterator.next(); - currentPieceSize = currentPiece.size(); - } else { - currentPiece = null; - currentPieceSize = 0; - } - } - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/SmallSortedMap.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/SmallSortedMap.java deleted file mode 100644 index 12159fba86..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/SmallSortedMap.java +++ /dev/null @@ -1,618 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.AbstractMap; -import java.util.AbstractSet; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.TreeMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Set; -import java.util.SortedMap; - -/** - * A custom map implementation from FieldDescriptor to Object optimized to - * minimize the number of memory allocations for instances with a small number - * of mappings. The implementation stores the first {@code k} mappings in an - * array for a configurable value of {@code k}, allowing direct access to the - * corresponding {@code Entry}s without the need to create an Iterator. The - * remaining entries are stored in an overflow map. Iteration over the entries - * in the map should be done as follows: - * - *

   {@code
- * for (int i = 0; i < fieldMap.getNumArrayEntries(); i++) {
- *   process(fieldMap.getArrayEntryAt(i));
- * }
- * for (Map.Entry entry : fieldMap.getOverflowEntries()) {
- *   process(entry);
- * }
- * }
- * - * The resulting iteration is in order of ascending field tag number. The - * object returned by {@link #entrySet()} adheres to the same contract but is - * less efficient as it necessarily involves creating an object for iteration. - *

- * The tradeoff for this memory efficiency is that the worst case running time - * of the {@code put()} operation is {@code O(k + lg n)}, which happens when - * entries are added in descending order. {@code k} should be chosen such that - * it covers enough common cases without adversely affecting larger maps. In - * practice, the worst case scenario does not happen for extensions because - * extension fields are serialized and deserialized in order of ascending tag - * number, but the worst case scenario can happen for DynamicMessages. - *

- * The running time for all other operations is similar to that of - * {@code TreeMap}. - *

- * Instances are not thread-safe until {@link #makeImmutable()} is called, - * after which any modifying operation will result in an - * {@link UnsupportedOperationException}. - * - * @author darick@google.com Darick Tong - */ -// This class is final for all intents and purposes because the constructor is -// private. However, the FieldDescriptor-specific logic is encapsulated in -// a subclass to aid testability of the core logic. -class SmallSortedMap, V> extends AbstractMap { - - /** - * Creates a new instance for mapping FieldDescriptors to their values. - * The {@link #makeImmutable()} implementation will convert the List values - * of any repeated fields to unmodifiable lists. - * - * @param arraySize The size of the entry array containing the - * lexicographically smallest mappings. - */ - static > - SmallSortedMap newFieldMap(int arraySize) { - return new SmallSortedMap(arraySize) { - @Override - @SuppressWarnings("unchecked") - public void makeImmutable() { - if (!isImmutable()) { - for (int i = 0; i < getNumArrayEntries(); i++) { - final Map.Entry entry = - getArrayEntryAt(i); - if (entry.getKey().isRepeated()) { - final List value = (List) entry.getValue(); - entry.setValue(Collections.unmodifiableList(value)); - } - } - for (Map.Entry entry : - getOverflowEntries()) { - if (entry.getKey().isRepeated()) { - final List value = (List) entry.getValue(); - entry.setValue(Collections.unmodifiableList(value)); - } - } - } - super.makeImmutable(); - } - }; - } - - /** - * Creates a new instance for testing. - * - * @param arraySize The size of the entry array containing the - * lexicographically smallest mappings. - */ - static , V> SmallSortedMap newInstanceForTest( - int arraySize) { - return new SmallSortedMap(arraySize); - } - - private final int maxArraySize; - // The "entry array" is actually a List because generic arrays are not - // allowed. ArrayList also nicely handles the entry shifting on inserts and - // removes. - private List entryList; - private Map overflowEntries; - private boolean isImmutable; - // The EntrySet is a stateless view of the Map. It's initialized the first - // time it is requested and reused henceforth. - private volatile EntrySet lazyEntrySet; - - /** - * @code arraySize Size of the array in which the lexicographically smallest - * mappings are stored. (i.e. the {@code k} referred to in the class - * documentation). - */ - private SmallSortedMap(int arraySize) { - this.maxArraySize = arraySize; - this.entryList = Collections.emptyList(); - this.overflowEntries = Collections.emptyMap(); - } - - /** Make this map immutable from this point forward. */ - public void makeImmutable() { - if (!isImmutable) { - // Note: There's no need to wrap the entryList in an unmodifiableList - // because none of the list's accessors are exposed. The iterator() of - // overflowEntries, on the other hand, is exposed so it must be made - // unmodifiable. - overflowEntries = overflowEntries.isEmpty() ? - Collections.emptyMap() : - Collections.unmodifiableMap(overflowEntries); - isImmutable = true; - } - } - - /** @return Whether {@link #makeImmutable()} has been called. */ - public boolean isImmutable() { - return isImmutable; - } - - /** @return The number of entries in the entry array. */ - public int getNumArrayEntries() { - return entryList.size(); - } - - /** @return The array entry at the given {@code index}. */ - public Map.Entry getArrayEntryAt(int index) { - return entryList.get(index); - } - - /** @return There number of overflow entries. */ - public int getNumOverflowEntries() { - return overflowEntries.size(); - } - - /** @return An iterable over the overflow entries. */ - public Iterable> getOverflowEntries() { - return overflowEntries.isEmpty() ? - EmptySet.>iterable() : - overflowEntries.entrySet(); - } - - @Override - public int size() { - return entryList.size() + overflowEntries.size(); - } - - /** - * The implementation throws a {@code ClassCastException} if o is not an - * object of type {@code K}. - * - * {@inheritDoc} - */ - @Override - public boolean containsKey(Object o) { - @SuppressWarnings("unchecked") - final K key = (K) o; - return binarySearchInArray(key) >= 0 || overflowEntries.containsKey(key); - } - - /** - * The implementation throws a {@code ClassCastException} if o is not an - * object of type {@code K}. - * - * {@inheritDoc} - */ - @Override - public V get(Object o) { - @SuppressWarnings("unchecked") - final K key = (K) o; - final int index = binarySearchInArray(key); - if (index >= 0) { - return entryList.get(index).getValue(); - } - return overflowEntries.get(key); - } - - @Override - public V put(K key, V value) { - checkMutable(); - final int index = binarySearchInArray(key); - if (index >= 0) { - // Replace existing array entry. - return entryList.get(index).setValue(value); - } - ensureEntryArrayMutable(); - final int insertionPoint = -(index + 1); - if (insertionPoint >= maxArraySize) { - // Put directly in overflow. - return getOverflowEntriesMutable().put(key, value); - } - // Insert new Entry in array. - if (entryList.size() == maxArraySize) { - // Shift the last array entry into overflow. - final Entry lastEntryInArray = entryList.remove(maxArraySize - 1); - getOverflowEntriesMutable().put(lastEntryInArray.getKey(), - lastEntryInArray.getValue()); - } - entryList.add(insertionPoint, new Entry(key, value)); - return null; - } - - @Override - public void clear() { - checkMutable(); - if (!entryList.isEmpty()) { - entryList.clear(); - } - if (!overflowEntries.isEmpty()) { - overflowEntries.clear(); - } - } - - /** - * The implementation throws a {@code ClassCastException} if o is not an - * object of type {@code K}. - * - * {@inheritDoc} - */ - @Override - public V remove(Object o) { - checkMutable(); - @SuppressWarnings("unchecked") - final K key = (K) o; - final int index = binarySearchInArray(key); - if (index >= 0) { - return removeArrayEntryAt(index); - } - // overflowEntries might be Collections.unmodifiableMap(), so only - // call remove() if it is non-empty. - if (overflowEntries.isEmpty()) { - return null; - } else { - return overflowEntries.remove(key); - } - } - - private V removeArrayEntryAt(int index) { - checkMutable(); - final V removed = entryList.remove(index).getValue(); - if (!overflowEntries.isEmpty()) { - // Shift the first entry in the overflow to be the last entry in the - // array. - final Iterator> iterator = - getOverflowEntriesMutable().entrySet().iterator(); - entryList.add(new Entry(iterator.next())); - iterator.remove(); - } - return removed; - } - - /** - * @param key The key to find in the entry array. - * @return The returned integer position follows the same semantics as the - * value returned by {@link java.util.Arrays#binarySearch()}. - */ - private int binarySearchInArray(K key) { - int left = 0; - int right = entryList.size() - 1; - - // Optimization: For the common case in which entries are added in - // ascending tag order, check the largest element in the array before - // doing a full binary search. - if (right >= 0) { - int cmp = key.compareTo(entryList.get(right).getKey()); - if (cmp > 0) { - return -(right + 2); // Insert point is after "right". - } else if (cmp == 0) { - return right; - } - } - - while (left <= right) { - int mid = (left + right) / 2; - int cmp = key.compareTo(entryList.get(mid).getKey()); - if (cmp < 0) { - right = mid - 1; - } else if (cmp > 0) { - left = mid + 1; - } else { - return mid; - } - } - return -(left + 1); - } - - /** - * Similar to the AbstractMap implementation of {@code keySet()} and - * {@code values()}, the entry set is created the first time this method is - * called, and returned in response to all subsequent calls. - * - * {@inheritDoc} - */ - @Override - public Set> entrySet() { - if (lazyEntrySet == null) { - lazyEntrySet = new EntrySet(); - } - return lazyEntrySet; - } - - /** - * @throws UnsupportedOperationException if {@link #makeImmutable()} has - * has been called. - */ - private void checkMutable() { - if (isImmutable) { - throw new UnsupportedOperationException(); - } - } - - /** - * @return a {@link SortedMap} to which overflow entries mappings can be - * added or removed. - * @throws UnsupportedOperationException if {@link #makeImmutable()} has been - * called. - */ - @SuppressWarnings("unchecked") - private SortedMap getOverflowEntriesMutable() { - checkMutable(); - if (overflowEntries.isEmpty() && !(overflowEntries instanceof TreeMap)) { - overflowEntries = new TreeMap(); - } - return (SortedMap) overflowEntries; - } - - /** - * Lazily creates the entry list. Any code that adds to the list must first - * call this method. - */ - private void ensureEntryArrayMutable() { - checkMutable(); - if (entryList.isEmpty() && !(entryList instanceof ArrayList)) { - entryList = new ArrayList(maxArraySize); - } - } - - /** - * Entry implementation that implements Comparable in order to support - * binary search within the entry array. Also checks mutability in - * {@link #setValue()}. - */ - private class Entry implements Map.Entry, Comparable { - - private final K key; - private V value; - - Entry(Map.Entry copy) { - this(copy.getKey(), copy.getValue()); - } - - Entry(K key, V value) { - this.key = key; - this.value = value; - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public K getKey() { - return key; - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public V getValue() { - return value; - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public int compareTo(Entry other) { - return getKey().compareTo(other.getKey()); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public V setValue(V newValue) { - checkMutable(); - final V oldValue = this.value; - this.value = newValue; - return oldValue; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (!(o instanceof Map.Entry)) { - return false; - } - @SuppressWarnings("unchecked") - Map.Entry other = (Map.Entry) o; - return equals(key, other.getKey()) && equals(value, other.getValue()); - } - - @Override - public int hashCode() { - return (key == null ? 0 : key.hashCode()) ^ - (value == null ? 0 : value.hashCode()); - } - - @Override - public String toString() { - return key + "=" + value; - } - - /** equals() that handles null values. */ - private boolean equals(Object o1, Object o2) { - return o1 == null ? o2 == null : o1.equals(o2); - } - } - - /** - * Stateless view of the entries in the field map. - */ - private class EntrySet extends AbstractSet> { - - @Override - public Iterator> iterator() { - return new EntryIterator(); - } - - @Override - public int size() { - return SmallSortedMap.this.size(); - } - - /** - * Throws a {@link ClassCastException} if o is not of the expected type. - * - * {@inheritDoc} - */ - @Override - public boolean contains(Object o) { - @SuppressWarnings("unchecked") - final Map.Entry entry = (Map.Entry) o; - final V existing = get(entry.getKey()); - final V value = entry.getValue(); - return existing == value || - (existing != null && existing.equals(value)); - } - - @Override - public boolean add(Map.Entry entry) { - if (!contains(entry)) { - put(entry.getKey(), entry.getValue()); - return true; - } - return false; - } - - /** - * Throws a {@link ClassCastException} if o is not of the expected type. - * - * {@inheritDoc} - */ - @Override - public boolean remove(Object o) { - @SuppressWarnings("unchecked") - final Map.Entry entry = (Map.Entry) o; - if (contains(entry)) { - SmallSortedMap.this.remove(entry.getKey()); - return true; - } - return false; - } - - @Override - public void clear() { - SmallSortedMap.this.clear(); - } - } - - /** - * Iterator implementation that switches from the entry array to the overflow - * entries appropriately. - */ - private class EntryIterator implements Iterator> { - - private int pos = -1; - private boolean nextCalledBeforeRemove; - private Iterator> lazyOverflowIterator; - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public boolean hasNext() { - return (pos + 1) < entryList.size() || - getOverflowIterator().hasNext(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public Map.Entry next() { - nextCalledBeforeRemove = true; - // Always increment pos so that we know whether the last returned value - // was from the array or from overflow. - if (++pos < entryList.size()) { - return entryList.get(pos); - } - return getOverflowIterator().next(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void remove() { - if (!nextCalledBeforeRemove) { - throw new IllegalStateException("remove() was called before next()"); - } - nextCalledBeforeRemove = false; - checkMutable(); - - if (pos < entryList.size()) { - removeArrayEntryAt(pos--); - } else { - getOverflowIterator().remove(); - } - } - - /** - * It is important to create the overflow iterator only after the array - * entries have been iterated over because the overflow entry set changes - * when the client calls remove() on the array entries, which invalidates - * any existing iterators. - */ - private Iterator> getOverflowIterator() { - if (lazyOverflowIterator == null) { - lazyOverflowIterator = overflowEntries.entrySet().iterator(); - } - return lazyOverflowIterator; - } - } - - /** - * Helper class that holds immutable instances of an Iterable/Iterator that - * we return when the overflow entries is empty. This eliminates the creation - * of an Iterator object when there is nothing to iterate over. - */ - private static class EmptySet { - - private static final Iterator ITERATOR = new Iterator() { - //@Override (Java 1.6 override semantics, but we must support 1.5) - public boolean hasNext() { - return false; - } - //@Override (Java 1.6 override semantics, but we must support 1.5) - public Object next() { - throw new NoSuchElementException(); - } - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void remove() { - throw new UnsupportedOperationException(); - } - }; - - private static final Iterable ITERABLE = new Iterable() { - //@Override (Java 1.6 override semantics, but we must support 1.5) - public Iterator iterator() { - return ITERATOR; - } - }; - - @SuppressWarnings("unchecked") - static Iterable iterable() { - return (Iterable) ITERABLE; - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/UninitializedMessageException.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/UninitializedMessageException.java deleted file mode 100644 index f317d2930e..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/UninitializedMessageException.java +++ /dev/null @@ -1,99 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.Collections; -import java.util.List; - -/** - * Thrown when attempting to build a protocol message that is missing required - * fields. This is a {@code RuntimeException} because it normally represents - * a programming error: it happens when some code which constructs a message - * fails to set all the fields. {@code parseFrom()} methods do not - * throw this; they throw an {@link InvalidProtocolBufferException} if - * required fields are missing, because it is not a programming error to - * receive an incomplete message. In other words, - * {@code UninitializedMessageException} should never be thrown by correct - * code, but {@code InvalidProtocolBufferException} might be. - * - * @author kenton@google.com Kenton Varda - */ -public class UninitializedMessageException extends RuntimeException { - private static final long serialVersionUID = -7466929953374883507L; - - public UninitializedMessageException(final MessageLite message) { - super("Message was missing required fields. (Lite runtime could not " + - "determine which fields were missing)."); - missingFields = null; - } - - public UninitializedMessageException(final List missingFields) { - super(buildDescription(missingFields)); - this.missingFields = missingFields; - } - - private final List missingFields; - - /** - * Get a list of human-readable names of required fields missing from this - * message. Each name is a full path to a field, e.g. "foo.bar[5].baz". - * Returns null if the lite runtime was used, since it lacks the ability to - * find missing fields. - */ - public List getMissingFields() { - return Collections.unmodifiableList(missingFields); - } - - /** - * Converts this exception to an {@link InvalidProtocolBufferException}. - * When a parsed message is missing required fields, this should be thrown - * instead of {@code UninitializedMessageException}. - */ - public InvalidProtocolBufferException asInvalidProtocolBufferException() { - return new InvalidProtocolBufferException(getMessage()); - } - - /** Construct the description string for this exception. */ - private static String buildDescription(final List missingFields) { - final StringBuilder description = - new StringBuilder("Message missing required fields: "); - boolean first = true; - for (final String field : missingFields) { - if (first) { - first = false; - } else { - description.append(", "); - } - description.append(field); - } - return description.toString(); - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/UnmodifiableLazyStringList.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/UnmodifiableLazyStringList.java deleted file mode 100644 index d6ac17c751..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/UnmodifiableLazyStringList.java +++ /dev/null @@ -1,205 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -import java.util.AbstractList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.RandomAccess; - -/** - * An implementation of {@link LazyStringList} that wraps another - * {@link LazyStringList} such that it cannot be modified via the wrapper. - * - * @author jonp@google.com (Jon Perlow) - */ -public class UnmodifiableLazyStringList extends AbstractList - implements LazyStringList, RandomAccess { - - private final LazyStringList list; - - public UnmodifiableLazyStringList(LazyStringList list) { - this.list = list; - } - - @Override - public String get(int index) { - return list.get(index); - } - - @Override - public int size() { - return list.size(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public ByteString getByteString(int index) { - return list.getByteString(index); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void add(ByteString element) { - throw new UnsupportedOperationException(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void set(int index, ByteString element) { - throw new UnsupportedOperationException(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public boolean addAllByteString(Collection element) { - throw new UnsupportedOperationException(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public byte[] getByteArray(int index) { - return list.getByteArray(index); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void add(byte[] element) { - throw new UnsupportedOperationException(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void set(int index, byte[] element) { - throw new UnsupportedOperationException(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public boolean addAllByteArray(Collection element) { - throw new UnsupportedOperationException(); - } - - @Override - public ListIterator listIterator(final int index) { - return new ListIterator() { - ListIterator iter = list.listIterator(index); - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public boolean hasNext() { - return iter.hasNext(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public String next() { - return iter.next(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public boolean hasPrevious() { - return iter.hasPrevious(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public String previous() { - return iter.previous(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public int nextIndex() { - return iter.nextIndex(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public int previousIndex() { - return iter.previousIndex(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void remove() { - throw new UnsupportedOperationException(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void set(String o) { - throw new UnsupportedOperationException(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void add(String o) { - throw new UnsupportedOperationException(); - } - }; - } - - @Override - public Iterator iterator() { - return new Iterator() { - Iterator iter = list.iterator(); - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public boolean hasNext() { - return iter.hasNext(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public String next() { - return iter.next(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public List getUnderlyingElements() { - // The returned value is already unmodifiable. - return list.getUnderlyingElements(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public void mergeFrom(LazyStringList other) { - throw new UnsupportedOperationException(); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public List asByteArrayList() { - return Collections.unmodifiableList(list.asByteArrayList()); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public List asByteStringList() { - return Collections.unmodifiableList(list.asByteStringList()); - } - - //@Override (Java 1.6 override semantics, but we must support 1.5) - public LazyStringList getUnmodifiableView() { - return this; - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/Utf8.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/Utf8.java deleted file mode 100644 index 66cefab42b..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/Utf8.java +++ /dev/null @@ -1,349 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -/** - * A set of low-level, high-performance static utility methods related - * to the UTF-8 character encoding. This class has no dependencies - * outside of the core JDK libraries. - * - *

There are several variants of UTF-8. The one implemented by - * this class is the restricted definition of UTF-8 introduced in - * Unicode 3.1, which mandates the rejection of "overlong" byte - * sequences as well as rejection of 3-byte surrogate codepoint byte - * sequences. Note that the UTF-8 decoder included in Oracle's JDK - * has been modified to also reject "overlong" byte sequences, but (as - * of 2011) still accepts 3-byte surrogate codepoint byte sequences. - * - *

The byte sequences considered valid by this class are exactly - * those that can be roundtrip converted to Strings and back to bytes - * using the UTF-8 charset, without loss:

 {@code
- * Arrays.equals(bytes, new String(bytes, "UTF-8").getBytes("UTF-8"))
- * }
- * - *

See the Unicode Standard,
- * Table 3-6. UTF-8 Bit Distribution,
- * Table 3-7. Well Formed UTF-8 Byte Sequences. - * - *

This class supports decoding of partial byte sequences, so that the - * bytes in a complete UTF-8 byte sequences can be stored in multiple - * segments. Methods typically return {@link #MALFORMED} if the partial - * byte sequence is definitely not well-formed, {@link #COMPLETE} if it is - * well-formed in the absence of additional input, or if the byte sequence - * apparently terminated in the middle of a character, an opaque integer - * "state" value containing enough information to decode the character when - * passed to a subsequent invocation of a partial decoding method. - * - * @author martinrb@google.com (Martin Buchholz) - */ -final class Utf8 { - private Utf8() {} - - /** - * State value indicating that the byte sequence is well-formed and - * complete (no further bytes are needed to complete a character). - */ - public static final int COMPLETE = 0; - - /** - * State value indicating that the byte sequence is definitely not - * well-formed. - */ - public static final int MALFORMED = -1; - - // Other state values include the partial bytes of the incomplete - // character to be decoded in the simplest way: we pack the bytes - // into the state int in little-endian order. For example: - // - // int state = byte1 ^ (byte2 << 8) ^ (byte3 << 16); - // - // Such a state is unpacked thus (note the ~ operation for byte2 to - // undo byte1's sign-extension bits): - // - // int byte1 = (byte) state; - // int byte2 = (byte) ~(state >> 8); - // int byte3 = (byte) (state >> 16); - // - // We cannot store a zero byte in the state because it would be - // indistinguishable from the absence of a byte. But we don't need - // to, because partial bytes must always be negative. When building - // a state, we ensure that byte1 is negative and subsequent bytes - // are valid trailing bytes. - - /** - * Returns {@code true} if the given byte array is a well-formed - * UTF-8 byte sequence. - * - *

This is a convenience method, equivalent to a call to {@code - * isValidUtf8(bytes, 0, bytes.length)}. - */ - public static boolean isValidUtf8(byte[] bytes) { - return isValidUtf8(bytes, 0, bytes.length); - } - - /** - * Returns {@code true} if the given byte array slice is a - * well-formed UTF-8 byte sequence. The range of bytes to be - * checked extends from index {@code index}, inclusive, to {@code - * limit}, exclusive. - * - *

This is a convenience method, equivalent to {@code - * partialIsValidUtf8(bytes, index, limit) == Utf8.COMPLETE}. - */ - public static boolean isValidUtf8(byte[] bytes, int index, int limit) { - return partialIsValidUtf8(bytes, index, limit) == COMPLETE; - } - - /** - * Tells whether the given byte array slice is a well-formed, - * malformed, or incomplete UTF-8 byte sequence. The range of bytes - * to be checked extends from index {@code index}, inclusive, to - * {@code limit}, exclusive. - * - * @param state either {@link Utf8#COMPLETE} (if this is the initial decoding - * operation) or the value returned from a call to a partial decoding method - * for the previous bytes - * - * @return {@link #MALFORMED} if the partial byte sequence is - * definitely not well-formed, {@link #COMPLETE} if it is well-formed - * (no additional input needed), or if the byte sequence is - * "incomplete", i.e. apparently terminated in the middle of a character, - * an opaque integer "state" value containing enough information to - * decode the character when passed to a subsequent invocation of a - * partial decoding method. - */ - public static int partialIsValidUtf8( - int state, byte[] bytes, int index, int limit) { - if (state != COMPLETE) { - // The previous decoding operation was incomplete (or malformed). - // We look for a well-formed sequence consisting of bytes from - // the previous decoding operation (stored in state) together - // with bytes from the array slice. - // - // We expect such "straddler characters" to be rare. - - if (index >= limit) { // No bytes? No progress. - return state; - } - int byte1 = (byte) state; - // byte1 is never ASCII. - if (byte1 < (byte) 0xE0) { - // two-byte form - - // Simultaneously checks for illegal trailing-byte in - // leading position and overlong 2-byte form. - if (byte1 < (byte) 0xC2 || - // byte2 trailing-byte test - bytes[index++] > (byte) 0xBF) { - return MALFORMED; - } - } else if (byte1 < (byte) 0xF0) { - // three-byte form - - // Get byte2 from saved state or array - int byte2 = (byte) ~(state >> 8); - if (byte2 == 0) { - byte2 = bytes[index++]; - if (index >= limit) { - return incompleteStateFor(byte1, byte2); - } - } - if (byte2 > (byte) 0xBF || - // overlong? 5 most significant bits must not all be zero - (byte1 == (byte) 0xE0 && byte2 < (byte) 0xA0) || - // illegal surrogate codepoint? - (byte1 == (byte) 0xED && byte2 >= (byte) 0xA0) || - // byte3 trailing-byte test - bytes[index++] > (byte) 0xBF) { - return MALFORMED; - } - } else { - // four-byte form - - // Get byte2 and byte3 from saved state or array - int byte2 = (byte) ~(state >> 8); - int byte3 = 0; - if (byte2 == 0) { - byte2 = bytes[index++]; - if (index >= limit) { - return incompleteStateFor(byte1, byte2); - } - } else { - byte3 = (byte) (state >> 16); - } - if (byte3 == 0) { - byte3 = bytes[index++]; - if (index >= limit) { - return incompleteStateFor(byte1, byte2, byte3); - } - } - - // If we were called with state == MALFORMED, then byte1 is 0xFF, - // which never occurs in well-formed UTF-8, and so we will return - // MALFORMED again below. - - if (byte2 > (byte) 0xBF || - // Check that 1 <= plane <= 16. Tricky optimized form of: - // if (byte1 > (byte) 0xF4 || - // byte1 == (byte) 0xF0 && byte2 < (byte) 0x90 || - // byte1 == (byte) 0xF4 && byte2 > (byte) 0x8F) - (((byte1 << 28) + (byte2 - (byte) 0x90)) >> 30) != 0 || - // byte3 trailing-byte test - byte3 > (byte) 0xBF || - // byte4 trailing-byte test - bytes[index++] > (byte) 0xBF) { - return MALFORMED; - } - } - } - - return partialIsValidUtf8(bytes, index, limit); - } - - /** - * Tells whether the given byte array slice is a well-formed, - * malformed, or incomplete UTF-8 byte sequence. The range of bytes - * to be checked extends from index {@code index}, inclusive, to - * {@code limit}, exclusive. - * - *

This is a convenience method, equivalent to a call to {@code - * partialIsValidUtf8(Utf8.COMPLETE, bytes, index, limit)}. - * - * @return {@link #MALFORMED} if the partial byte sequence is - * definitely not well-formed, {@link #COMPLETE} if it is well-formed - * (no additional input needed), or if the byte sequence is - * "incomplete", i.e. apparently terminated in the middle of a character, - * an opaque integer "state" value containing enough information to - * decode the character when passed to a subsequent invocation of a - * partial decoding method. - */ - public static int partialIsValidUtf8( - byte[] bytes, int index, int limit) { - // Optimize for 100% ASCII. - // Hotspot loves small simple top-level loops like this. - while (index < limit && bytes[index] >= 0) { - index++; - } - - return (index >= limit) ? COMPLETE : - partialIsValidUtf8NonAscii(bytes, index, limit); - } - - private static int partialIsValidUtf8NonAscii( - byte[] bytes, int index, int limit) { - for (;;) { - int byte1, byte2; - - // Optimize for interior runs of ASCII bytes. - do { - if (index >= limit) { - return COMPLETE; - } - } while ((byte1 = bytes[index++]) >= 0); - - if (byte1 < (byte) 0xE0) { - // two-byte form - - if (index >= limit) { - return byte1; - } - - // Simultaneously checks for illegal trailing-byte in - // leading position and overlong 2-byte form. - if (byte1 < (byte) 0xC2 || - bytes[index++] > (byte) 0xBF) { - return MALFORMED; - } - } else if (byte1 < (byte) 0xF0) { - // three-byte form - - if (index >= limit - 1) { // incomplete sequence - return incompleteStateFor(bytes, index, limit); - } - if ((byte2 = bytes[index++]) > (byte) 0xBF || - // overlong? 5 most significant bits must not all be zero - (byte1 == (byte) 0xE0 && byte2 < (byte) 0xA0) || - // check for illegal surrogate codepoints - (byte1 == (byte) 0xED && byte2 >= (byte) 0xA0) || - // byte3 trailing-byte test - bytes[index++] > (byte) 0xBF) { - return MALFORMED; - } - } else { - // four-byte form - - if (index >= limit - 2) { // incomplete sequence - return incompleteStateFor(bytes, index, limit); - } - if ((byte2 = bytes[index++]) > (byte) 0xBF || - // Check that 1 <= plane <= 16. Tricky optimized form of: - // if (byte1 > (byte) 0xF4 || - // byte1 == (byte) 0xF0 && byte2 < (byte) 0x90 || - // byte1 == (byte) 0xF4 && byte2 > (byte) 0x8F) - (((byte1 << 28) + (byte2 - (byte) 0x90)) >> 30) != 0 || - // byte3 trailing-byte test - bytes[index++] > (byte) 0xBF || - // byte4 trailing-byte test - bytes[index++] > (byte) 0xBF) { - return MALFORMED; - } - } - } - } - - private static int incompleteStateFor(int byte1) { - return (byte1 > (byte) 0xF4) ? - MALFORMED : byte1; - } - - private static int incompleteStateFor(int byte1, int byte2) { - return (byte1 > (byte) 0xF4 || - byte2 > (byte) 0xBF) ? - MALFORMED : byte1 ^ (byte2 << 8); - } - - private static int incompleteStateFor(int byte1, int byte2, int byte3) { - return (byte1 > (byte) 0xF4 || - byte2 > (byte) 0xBF || - byte3 > (byte) 0xBF) ? - MALFORMED : byte1 ^ (byte2 << 8) ^ (byte3 << 16); - } - - private static int incompleteStateFor(byte[] bytes, int index, int limit) { - int byte1 = bytes[index - 1]; - switch (limit - index) { - case 0: return incompleteStateFor(byte1); - case 1: return incompleteStateFor(byte1, bytes[index]); - case 2: return incompleteStateFor(byte1, bytes[index], bytes[index + 1]); - default: throw new AssertionError(); - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlin/protobuf/WireFormat.java b/retrofit/src/main/java/retrofit2/kotlin/protobuf/WireFormat.java deleted file mode 100644 index 85d989ef3e..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlin/protobuf/WireFormat.java +++ /dev/null @@ -1,163 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package retrofit2.kotlin.protobuf; - -/** - * This class is used internally by the Protocol Buffer library and generated - * message implementations. It is public only because those generated messages - * do not reside in the {@code protobuf} package. Others should not use this - * class directly. - * - * This class contains constants and helper functions useful for dealing with - * the Protocol Buffer wire format. - * - * @author kenton@google.com Kenton Varda - */ -public final class WireFormat { - // Do not allow instantiation. - private WireFormat() {} - - public static final int WIRETYPE_VARINT = 0; - public static final int WIRETYPE_FIXED64 = 1; - public static final int WIRETYPE_LENGTH_DELIMITED = 2; - public static final int WIRETYPE_START_GROUP = 3; - public static final int WIRETYPE_END_GROUP = 4; - public static final int WIRETYPE_FIXED32 = 5; - - static final int TAG_TYPE_BITS = 3; - static final int TAG_TYPE_MASK = (1 << TAG_TYPE_BITS) - 1; - - /** Given a tag value, determines the wire type (the lower 3 bits). */ - static int getTagWireType(final int tag) { - return tag & TAG_TYPE_MASK; - } - - /** Given a tag value, determines the field number (the upper 29 bits). */ - public static int getTagFieldNumber(final int tag) { - return tag >>> TAG_TYPE_BITS; - } - - /** Makes a tag value given a field number and wire type. */ - static int makeTag(final int fieldNumber, final int wireType) { - return (fieldNumber << TAG_TYPE_BITS) | wireType; - } - - /** - * Lite equivalent to {@link Descriptors.FieldDescriptor.JavaType}. This is - * only here to support the lite runtime and should not be used by users. - */ - public enum JavaType { - INT(0), - LONG(0L), - FLOAT(0F), - DOUBLE(0D), - BOOLEAN(false), - STRING(""), - BYTE_STRING(ByteString.EMPTY), - ENUM(null), - MESSAGE(null); - - JavaType(final Object defaultDefault) { - this.defaultDefault = defaultDefault; - } - - /** - * The default default value for fields of this type, if it's a primitive - * type. - */ - Object getDefaultDefault() { - return defaultDefault; - } - - private final Object defaultDefault; - } - - /** - * Lite equivalent to {@link Descriptors.FieldDescriptor.Type}. This is - * only here to support the lite runtime and should not be used by users. - */ - public enum FieldType { - DOUBLE (JavaType.DOUBLE , WIRETYPE_FIXED64 ), - FLOAT (JavaType.FLOAT , WIRETYPE_FIXED32 ), - INT64 (JavaType.LONG , WIRETYPE_VARINT ), - UINT64 (JavaType.LONG , WIRETYPE_VARINT ), - INT32 (JavaType.INT , WIRETYPE_VARINT ), - FIXED64 (JavaType.LONG , WIRETYPE_FIXED64 ), - FIXED32 (JavaType.INT , WIRETYPE_FIXED32 ), - BOOL (JavaType.BOOLEAN , WIRETYPE_VARINT ), - STRING (JavaType.STRING , WIRETYPE_LENGTH_DELIMITED) { - public boolean isPackable() { return false; } - }, - GROUP (JavaType.MESSAGE , WIRETYPE_START_GROUP ) { - public boolean isPackable() { return false; } - }, - MESSAGE (JavaType.MESSAGE , WIRETYPE_LENGTH_DELIMITED) { - public boolean isPackable() { return false; } - }, - BYTES (JavaType.BYTE_STRING, WIRETYPE_LENGTH_DELIMITED) { - public boolean isPackable() { return false; } - }, - UINT32 (JavaType.INT , WIRETYPE_VARINT ), - ENUM (JavaType.ENUM , WIRETYPE_VARINT ), - SFIXED32(JavaType.INT , WIRETYPE_FIXED32 ), - SFIXED64(JavaType.LONG , WIRETYPE_FIXED64 ), - SINT32 (JavaType.INT , WIRETYPE_VARINT ), - SINT64 (JavaType.LONG , WIRETYPE_VARINT ); - - FieldType(final JavaType javaType, final int wireType) { - this.javaType = javaType; - this.wireType = wireType; - } - - private final JavaType javaType; - private final int wireType; - - public JavaType getJavaType() { return javaType; } - public int getWireType() { return wireType; } - - public boolean isPackable() { return true; } - } - - // Field numbers for fields in MessageSet wire format. - static final int MESSAGE_SET_ITEM = 1; - static final int MESSAGE_SET_TYPE_ID = 2; - static final int MESSAGE_SET_MESSAGE = 3; - - // Tag numbers. - static final int MESSAGE_SET_ITEM_TAG = - makeTag(MESSAGE_SET_ITEM, WIRETYPE_START_GROUP); - static final int MESSAGE_SET_ITEM_END_TAG = - makeTag(MESSAGE_SET_ITEM, WIRETYPE_END_GROUP); - static final int MESSAGE_SET_TYPE_ID_TAG = - makeTag(MESSAGE_SET_TYPE_ID, WIRETYPE_VARINT); - static final int MESSAGE_SET_MESSAGE_TAG = - makeTag(MESSAGE_SET_MESSAGE, WIRETYPE_LENGTH_DELIMITED); -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readUtils.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readUtils.kt deleted file mode 100644 index 9120c3f9de..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readUtils.kt +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.impl - -import retrofit2.kotlinx.metadata.ClassName -import retrofit2.kotlin.metadata.deserialization.NameResolver - -internal fun NameResolver.getClassName(index: Int): ClassName { - val name = getQualifiedClassName(index) - return if (isLocalClassName(index)) ".$name" else name -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readers.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readers.kt deleted file mode 100644 index 02e0ad1682..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata.impl/readers.kt +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.impl - -import retrofit2.kotlinx.metadata.impl.extensions.MetadataExtensions -import retrofit2.kotlin.metadata.ProtoBuf -import retrofit2.kotlin.metadata.deserialization.NameResolver -import retrofit2.kotlin.metadata.deserialization.TypeTable -import retrofit2.kotlin.metadata.deserialization.returnType -import retrofit2.kotlinx.metadata.* - -class ReadContext( - val strings: NameResolver, - val types: TypeTable -) { - internal val extensions = MetadataExtensions.INSTANCES - - operator fun get(index: Int): String = - strings.getString(index) - - fun className(index: Int): ClassName = - strings.getClassName(index) -} - -fun ProtoBuf.Class.accept( - v: KmClassVisitor, - strings: NameResolver -) { - val c = ReadContext( - strings, - TypeTable(typeTable) - ) - - for (function in functionList) { - v.visitFunction(function.flags, c[function.name])?.let { function.accept(it, c) } - } -} - -private fun ProtoBuf.Function.accept(v: KmFunctionVisitor, outer: ReadContext) { - returnType(outer.types).let { returnType -> - v.visitReturnType(returnType.typeFlags)?.let { returnType.accept(it, outer) } - } - - for (extension in outer.extensions) { - extension.readFunctionExtensions(v, this, outer) - } -} - -private fun ProtoBuf.Type.accept(v: KmTypeVisitor, c: ReadContext) { - when { - hasClassName() -> v.visitClass(c.className(className)) - else -> { - throw InconsistentKotlinMetadataException("No classifier (class, type alias or type parameter) recorded for Type") - } - } -} - -private val ProtoBuf.Type.typeFlags: Flags - get() = (if (nullable) 1 shl 0 else 0) + - (flags shl 1) diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/ClassName.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/ClassName.kt deleted file mode 100644 index faa8086bc9..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/ClassName.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:JvmName("ClassNameKt") - -package retrofit2.kotlinx.metadata - -/** - * A fully qualified name of a classifier from the Kotlin's point of view. May differ from the JVM name of the class - * which is the runtime representation of this Kotlin classifier (for example, Kotlin class "kotlin/Int" -> JVM class "java/lang/Integer") - * - * Package names in this name are separated by '/', and class names are separated by '.', for example: `"org/foo/bar/Baz.Nested"`. - * - * If this name starts with '.', it represents a local class or an anonymous object. This is used by the Kotlin compiler - * to prevent lookup of this name in the resolution. - */ -// TODO: use inline class in 1.3 -typealias ClassName = String diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flag.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flag.kt deleted file mode 100644 index ff16df6be3..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flag.kt +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata - -import retrofit2.kotlin.metadata.ProtoBuf.* -import retrofit2.kotlin.metadata.deserialization.Flags as F - -/** - * Represents a boolean flag that is either present or not in a Kotlin declaration. A "flag" is a boolean trait that is either present - * or not in a declaration. To check whether the flag is present in the bitmask, call [Flag.invoke] on the flag, passing the bitmask - * as the argument: - * - * override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? { - * if (Flag.Function.IS_INLINE(flags)) { - * ... - * } - * } - * - * To construct a bitmask out of several flags, call [flagsOf] on the needed flags: - * - * v.visitFunction(flagsOf(Flag.Function.IS_DECLARATION, Flag.Function.IS_INLINE), "foo") - * - * Flag common to multiple kinds of Kotlin declarations ("common flags") are declared in [Flag.Common]. - * Flag applicable to specific kinds of declarations ("declaration-specific flags") are declared in nested objects of the [Flag] object. - * - * Some flags are mutually exclusive, i.e. there are "flag groups" such that no more than one flag from each group can be present - * in the same bitmask. Among common flags, there are the following flag groups: - * * visibility flags: [IS_INTERNAL], [IS_PRIVATE], [IS_PROTECTED], [IS_PUBLIC], [IS_PRIVATE_TO_THIS], [IS_LOCAL] - * * modality flags: [IS_FINAL], [IS_OPEN], [IS_ABSTRACT], [IS_SEALED] - * - * Some declaration-specific flags form other flag groups, see the documentation of the corresponding containers for more information. - * - * @see Flags - * @see flagsOf - */ -class Flag(private val offset: Int, private val bitWidth: Int, private val value: Int) { - internal constructor(field: F.FlagField<*>, value: Int) : this(field.offset, field.bitWidth, value) - - internal constructor(field: F.BooleanFlagField) : this(field, 1) - - internal operator fun plus(flags: Flags): Flags = - (flags and (((1 shl bitWidth) - 1) shl offset).inv()) + (value shl offset) - - /** - * Checks whether the flag is present in the given bitmask. - */ - operator fun invoke(flags: Flags): Boolean = - (flags ushr offset) and ((1 shl bitWidth) - 1) == value - - /** - * A container of flags applicable to Kotlin types. - */ - object Type { - /** - * Signifies that the corresponding type is marked as nullable, i.e. has a question mark at the end of its notation. - */ - @JvmField - val IS_NULLABLE = Flag(0, 1, 1) - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flags.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flags.kt deleted file mode 100644 index 28390d96e0..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/Flags.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:JvmName("FlagsKt") - -package retrofit2.kotlinx.metadata - -/** - * Declaration flags are represented as bitmasks of this type. - * - * @see Flag - */ -typealias Flags = Int - -/** - * Combines several flags into an integer bitmask. - * - * Note that in case several mutually exclusive flags are passed (for example, several visibility flags), the resulting bitmask will - * hold the value of the latest flag. For example, `flagsOf(Flag.IS_PRIVATE, Flag.IS_PUBLIC, Flag.IS_INTERNAL)` is the same as - * `flagsOf(Flag.IS_INTERNAL)`. - */ -fun flagsOf(vararg flags: Flag): Flags = - flags.fold(0) { acc, flag -> flag + acc } diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/InconsistentKotlinMetadataException.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/InconsistentKotlinMetadataException.kt deleted file mode 100644 index 41c906710b..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/InconsistentKotlinMetadataException.kt +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata - -class InconsistentKotlinMetadataException(message: String, cause: Throwable? = null) : RuntimeException(message, cause) diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/extensions.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/extensions.kt deleted file mode 100644 index 3d578f67e8..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/extensions.kt +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata - -import kotlin.reflect.KClass - -/** - * A type of the extension visitor expected by the code that uses the visitor API. - * - * Each declaration which can have platform-specific extensions in the metadata has a method `visitExtensions` in its visitor, e.g.: - * - * open fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor? - * - * The client code is supposed to return the extension visitor corresponding to the given type, or to return `null` if the type is - * of no interest to that code. Each platform-specific extension visitor has a [KmExtensionType] instance declared in the `TYPE` property - * its companion object. For example, to load JVM extensions on a function, one could do: - * - * override fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor? { - * if (type != JvmFunctionExtensionVisitor.TYPE) return null - * - * return object : JvmFunctionExtensionVisitor() { - * ... - * } - * } - * - * In case an extension visitor of an unrelated type is returned, the code using the visitor API must ignore that visitor. - */ -class KmExtensionType(private val klass: KClass) { - override fun equals(other: Any?): Boolean = - other is KmExtensionType && klass == other.klass - - override fun hashCode(): Int = - klass.hashCode() - - override fun toString(): String = - klass.java.name -} - -/** - * A base interface for all extension visitors. - */ -interface KmExtensionVisitor { - /** - * Type of this extension visitor. - */ - val type: KmExtensionType -} - -/** - * A visitor to visit platform-specific extensions for a declaration container, such as a class or a package fragment. - */ -interface KmDeclarationContainerExtensionVisitor : KmExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a class. - */ -interface KmClassExtensionVisitor : KmDeclarationContainerExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a package fragment. - */ -interface KmPackageExtensionVisitor : KmDeclarationContainerExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a module fragment. - */ -interface KmModuleFragmentExtensionVisitor : KmExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a function. - */ -interface KmFunctionExtensionVisitor : KmExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a property. - */ -interface KmPropertyExtensionVisitor : KmExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a constructor. - */ -interface KmConstructorExtensionVisitor : KmExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a type parameter. - */ -interface KmTypeParameterExtensionVisitor : KmExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a type. - */ -interface KmTypeExtensionVisitor : KmExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a type alias. - */ -interface KmTypeAliasExtensionVisitor : KmExtensionVisitor - -/** - * A visitor to visit platform-specific extensions for a value parameter. - */ -interface KmValueParameterExtensionVisitor : KmExtensionVisitor diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/MetadataExtensions.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/MetadataExtensions.kt deleted file mode 100644 index 94282dcac4..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/MetadataExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.impl.extensions - -import retrofit2.kotlinx.metadata.impl.ReadContext -import retrofit2.kotlinx.metadata.jvm.impl.JvmMetadataExtensions -import retrofit2.kotlin.metadata.ProtoBuf -import retrofit2.kotlinx.metadata.KmFunctionVisitor - -interface MetadataExtensions { - - fun readFunctionExtensions(v: KmFunctionVisitor, proto: ProtoBuf.Function, c: ReadContext) - - fun createFunctionExtension(): KmFunctionExtension - - companion object { - val INSTANCES: List by lazy { - listOf(JvmMetadataExtensions()) - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionNodes.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionNodes.kt deleted file mode 100644 index aab0d756ea..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionNodes.kt +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.impl.extensions - -import retrofit2.kotlinx.metadata.KmExtensionVisitor -import retrofit2.kotlinx.metadata.KmFunctionExtensionVisitor - -interface KmExtension : KmExtensionVisitor { - fun accept(visitor: V) -} - -interface KmFunctionExtension : KmFunctionExtensionVisitor, KmExtension \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionUtils.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionUtils.kt deleted file mode 100644 index b33793aeac..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/impl/extensions/extensionUtils.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.impl.extensions - -import retrofit2.kotlinx.metadata.KmExtensionType - -internal fun > Collection.singleOfType(type: KmExtensionType): N { - var result: N? = null - for (node in this) { - if (node.type != type) continue - if (result != null) { - throw IllegalStateException("Multiple extensions handle the same extension type: $type") - } - result = node - } - if (result == null) { - throw IllegalStateException("No extensions handle the extension type: $type") - } - return result -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/JvmMemberSignature.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/JvmMemberSignature.kt deleted file mode 100644 index 0d7fdae955..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/JvmMemberSignature.kt +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.jvm - -import retrofit2.kotlin.metadata.jvm.deserialization.JvmMemberSignature as JvmMemberSignatureImpl - -/** - * A signature of a JVM method or field. - * - * @property name name of method or field - * @property desc JVM descriptor of a method, e.g. `(Ljava/lang/Object;)Z`, or a field type, e.g. `Ljava/lang/String;` - */ -sealed class JvmMemberSignature { - - abstract val name: String - abstract val desc: String - - /** - * Returns a string representation of the signature. - * - * In case of a method it's just [name] and [desc] concatenated together, e.g. `equals(Ljava/lang/Object;)Z` - * - * In case of a field [name] and [desc] are concatenated with `:` separator, e.g. `value:Ljava/lang/String;` - */ - abstract fun asString(): String - - final override fun toString() = asString() -} - -/** - * A signature of a JVM method in the JVM-based format. - * - * Example: `JvmMethodSignature("equals", "(Ljava/lang/Object;)Z")`. - * - * @see JvmMemberSignature - */ -data class JvmMethodSignature(override val name: String, override val desc: String) : JvmMemberSignature() { - override fun asString() = name + desc -} - -internal fun JvmMemberSignatureImpl.Method.wrapAsPublic() = JvmMethodSignature(name, desc) diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassHeader.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassHeader.kt deleted file mode 100644 index bc3f6b253c..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassHeader.kt +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:Suppress("MemberVisibilityCanBePrivate") - -package retrofit2.kotlinx.metadata.jvm - -import retrofit2.kotlin.metadata.jvm.deserialization.JvmMetadataVersion - -/** - * A mirror to the [Metadata] annotation on a JVM class file, containing the metadata of Kotlin declarations declared in the class file. - * Properties of this class correspond 1:1 to the properties of [Metadata]. - * - * @param kind see [kind] - * @param metadataVersion see [metadataVersion] - * @param data1 see [data1] - * @param data2 see [data2] - * @param extraString see [extraString] - * @param packageName see [packageName] - * @param extraInt see [extraInt] - */ -class KotlinClassHeader -constructor( - kind: Int?, - metadataVersion: IntArray?, - data1: Array?, - data2: Array?, - extraString: String?, - packageName: String?, - extraInt: Int? -) { - - /** - * A kind of the metadata this header encodes. - * - * @see Metadata.kind - * @see CLASS_KIND - * @see FILE_FACADE_KIND - * @see SYNTHETIC_CLASS_KIND - * @see MULTI_FILE_CLASS_FACADE_KIND - * @see MULTI_FILE_CLASS_PART_KIND - */ - val kind: Int = kind ?: 1 - - /** - * The version of the metadata provided in other properties of this header. - * - * @see Metadata.metadataVersion - * @see COMPATIBLE_METADATA_VERSION - */ - val metadataVersion: IntArray = metadataVersion ?: intArrayOf() - - /** - * The first array of strings used to encode the metadata. - * - * @see Metadata.data1 - */ - val data1: Array = data1 ?: emptyArray() - - /** - * The second array of strings used to encode the metadata. - * - * @see Metadata.data2 - */ - val data2: Array = data2 ?: emptyArray() - - /** - * An extra string field for the metadata. - * - * @see Metadata.extraString - */ - val extraString: String = extraString ?: "" - - /** - * Fully qualified name of the Kotlin package of the corresponding class, in case [JvmPackageName] was used. - * - * @see Metadata.packageName - */ - val packageName: String = packageName ?: "" - - /** - * An extra int field for the metadata. - * - * @see Metadata.extraInt - */ - val extraInt: Int = extraInt ?: 0 - - companion object { - /** - * A class file kind signifying that the corresponding class file contains a declaration of a Kotlin class. - * - * @see kind - */ - const val CLASS_KIND = 1 - - /** - * A class file kind signifying that the corresponding class file is a compiled Kotlin file facade. - * - * @see kind - */ - const val FILE_FACADE_KIND = 2 - - /** - * A class file kind signifying that the corresponding class file is synthetic, e.g. it's a class for lambda, `$DefaultImpls` class - * for interface method implementations, `$WhenMappings` class for optimized `when` over enums, etc. - * - * @see kind - */ - const val SYNTHETIC_CLASS_KIND = 3 - - /** - * A class file kind signifying that the corresponding class file is a compiled multi-file class facade. - * - * @see kind - * @see JvmMultifileClass - */ - const val MULTI_FILE_CLASS_FACADE_KIND = 4 - - /** - * A class file kind signifying that the corresponding class file is a compiled multi-file class part, i.e. an internal class - * with method bodies and their metadata, accessed only from the corresponding facade. - * - * @see kind - * @see JvmMultifileClass - */ - const val MULTI_FILE_CLASS_PART_KIND = 5 - - /** - * The latest metadata version supported by this version of the library. - * - * @see metadataVersion - */ - @JvmField - val COMPATIBLE_METADATA_VERSION = JvmMetadataVersion.INSTANCE.toArray().copyOf() - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassMetadata.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassMetadata.kt deleted file mode 100644 index a86805bed2..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/KotlinClassMetadata.kt +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.jvm - -import retrofit2.kotlinx.* -import retrofit2.kotlinx.metadata.impl.accept -import retrofit2.kotlin.metadata.jvm.deserialization.JvmMetadataVersion -import retrofit2.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil -import retrofit2.kotlinx.metadata.InconsistentKotlinMetadataException -import retrofit2.kotlinx.metadata.KmClass -import retrofit2.kotlinx.metadata.KmClassVisitor -import kotlin.LazyThreadSafetyMode.PUBLICATION - -/** - * Represents the parsed metadata of a Kotlin JVM class file. - * - * To create an instance of [KotlinClassMetadata], first obtain a [KotlinClassHeader] instance by loading the contents - * of the [Metadata] annotation on a class file, and then call [KotlinClassMetadata.read]. - */ -sealed class KotlinClassMetadata(val header: KotlinClassHeader) { - /** - * Represents metadata of a class file containing a declaration of a Kotlin class. - */ - class Class internal constructor(header: KotlinClassHeader) : KotlinClassMetadata(header) { - private val classData by lazy(PUBLICATION) { - val data1 = (header.data1.takeIf(Array<*>::isNotEmpty) - ?: throw InconsistentKotlinMetadataException("data1 must not be empty")) - JvmProtoBufUtil.readClassDataFrom(data1, header.data2) - } - - /** - * Visits metadata of this class with a new [KmClass] instance and returns that instance. - */ - fun toKmClass(): KmClass = - KmClass().apply(this::accept) - - /** - * Makes the given visitor visit metadata of this class. - * - * @param v the visitor that must visit this class - */ - fun accept(v: KmClassVisitor) { - val (strings, proto) = classData - proto.accept(v, strings) - } - } - - companion object { - /** - * Reads and parses the given header of a Kotlin JVM class file and returns the correct type of [KotlinClassMetadata] encoded by - * this header, or `null` if this header encodes an unsupported kind of Kotlin classes or has an unsupported metadata version. - * - * Throws [InconsistentKotlinMetadataException] if the metadata has inconsistencies which signal that it may have been - * modified by a separate tool. - * - * @param header the header of a Kotlin JVM class file to be parsed - */ - @JvmStatic - fun read(header: KotlinClassHeader): KotlinClassMetadata? { - if (!JvmMetadataVersion( - header.metadataVersion, - (header.extraInt and (1 shl 3)/* see JvmAnnotationNames.METADATA_STRICT_VERSION_SEMANTICS_FLAG */) != 0 - ).isCompatible() - ) return null - - return try { - when (header.kind) { - KotlinClassHeader.CLASS_KIND -> Class(header) - else -> throw IllegalArgumentException("The metadata passed are not of a class") - } - } catch (e: InconsistentKotlinMetadataException) { - throw e - } catch (e: Throwable) { - throw InconsistentKotlinMetadataException("Exception occurred when reading Kotlin metadata", e) - } - } - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt deleted file mode 100644 index 6893d05d9f..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/JvmMetadataExtensions.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.jvm.impl - -import retrofit2.kotlin.metadata.ProtoBuf -import retrofit2.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil -import retrofit2.kotlinx.metadata.KmFunctionVisitor -import retrofit2.kotlinx.metadata.impl.ReadContext -import retrofit2.kotlinx.metadata.impl.extensions.KmFunctionExtension -import retrofit2.kotlinx.metadata.impl.extensions.MetadataExtensions -import retrofit2.kotlinx.metadata.jvm.JvmFunctionExtensionVisitor -import retrofit2.kotlinx.metadata.jvm.wrapAsPublic - -internal class JvmMetadataExtensions : MetadataExtensions { - - override fun readFunctionExtensions(v: KmFunctionVisitor, proto: ProtoBuf.Function, c: ReadContext) { - val ext = v.visitExtensions(JvmFunctionExtensionVisitor.TYPE) as? JvmFunctionExtensionVisitor ?: return - ext.visit(JvmProtoBufUtil.getJvmMethodSignature(proto, c.strings, c.types)?.wrapAsPublic()) - - ext.visitEnd() - } - - override fun createFunctionExtension(): KmFunctionExtension = JvmFunctionExtension() -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt deleted file mode 100644 index b3a1987c15..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/impl/jvmExtensionNodes.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.jvm.impl - -import retrofit2.kotlinx.metadata.KmFunction -import retrofit2.kotlinx.metadata.KmFunctionExtensionVisitor -import retrofit2.kotlinx.metadata.impl.extensions.KmFunctionExtension -import retrofit2.kotlinx.metadata.jvm.JvmFunctionExtensionVisitor -import retrofit2.kotlinx.metadata.jvm.JvmMethodSignature - -internal val KmFunction.jvm: JvmFunctionExtension - get() = visitExtensions(JvmFunctionExtensionVisitor.TYPE) as JvmFunctionExtension - -internal class JvmFunctionExtension : JvmFunctionExtensionVisitor(), KmFunctionExtension { - var signature: JvmMethodSignature? = null - - override fun visit(signature: JvmMethodSignature?) { - this.signature = signature - } - - - override fun accept(visitor: KmFunctionExtensionVisitor) { - require(visitor is JvmFunctionExtensionVisitor) - visitor.visit(signature) - visitor.visitEnd() - } -} - diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensionVisitors.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensionVisitors.kt deleted file mode 100644 index cbf6100476..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensionVisitors.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata.jvm - -import retrofit2.kotlinx.metadata.KmExtensionType -import retrofit2.kotlinx.metadata.KmFunctionExtensionVisitor - -/** - * A visitor to visit JVM extensions for a function. - */ -open class JvmFunctionExtensionVisitor @JvmOverloads constructor( - private val delegate: JvmFunctionExtensionVisitor? = null -) : KmFunctionExtensionVisitor { - final override val type: KmExtensionType - get() = TYPE - - /** - * Visits the JVM signature of the function, or null if the JVM signature of this function is unknown. - * - * Example: `JvmMethodSignature("equals", "(Ljava/lang/Object;)Z")` - * - * @param signature the signature of the function - */ - open fun visit(signature: JvmMethodSignature?) { - delegate?.visit(signature) - } - - /** - * Visits the end of JVM extensions for the function. - */ - open fun visitEnd() { - delegate?.visitEnd() - } - - companion object { - /** - * The type of this extension visitor. - * - * @see KmExtensionType - */ - @JvmField - val TYPE: KmExtensionType = KmExtensionType(JvmFunctionExtensionVisitor::class) - } -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensions.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensions.kt deleted file mode 100644 index 4438fb5a81..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/jvm/jvmExtensions.kt +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:Suppress("unused") - -package retrofit2.kotlinx.metadata.jvm - -import retrofit2.kotlinx.metadata.jvm.impl.jvm -import retrofit2.kotlinx.metadata.KmFunction - -/** - * JVM signature of the function, or null if the JVM signature of this function is unknown. - * - * Example: `JvmMethodSignature("equals", "(Ljava/lang/Object;)Z")`. - */ -var KmFunction.signature: JvmMethodSignature? - get() = jvm.signature - set(value) { - jvm.signature = value - } diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/nodes.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/nodes.kt deleted file mode 100644 index 90466295cb..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/nodes.kt +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:Suppress("MemberVisibilityCanBePrivate") - -package retrofit2.kotlinx.metadata - -import retrofit2.kotlinx.metadata.impl.extensions.* -import retrofit2.kotlinx.metadata.impl.extensions.KmFunctionExtension -import retrofit2.kotlinx.metadata.impl.extensions.MetadataExtensions -import retrofit2.kotlinx.metadata.impl.extensions.singleOfType -import java.lang.IllegalStateException - -/** - * Represents a Kotlin declaration container, such as a class or a package fragment. - */ -interface KmDeclarationContainer { - /** - * Functions in the container. - */ - val functions: MutableList -} - -/** - * Represents a Kotlin class. - */ -class KmClass : KmClassVisitor(), KmDeclarationContainer { - - /** - * Functions in the class. - */ - override val functions: MutableList = ArrayList() - - override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor = - KmFunction(flags, name).addTo(functions) - - /** - * Populates the given visitor with data in this class. - * - * @param visitor the visitor which will visit data in this class - */ - fun accept(visitor: KmClassVisitor) { - functions.forEach { visitor.visitFunction(it.flags, it.name)?.let(it::accept) } - } -} - -/** - * Represents a Kotlin function declaration. - * - * @property flags function flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Function] flags - * @property name the name of the function - */ -class KmFunction( - var flags: Flags, - var name: String -) : KmFunctionVisitor() { - - /** - * Return type of the function. - */ - lateinit var returnType: KmType - - private val extensions: List = - MetadataExtensions.INSTANCES.map(MetadataExtensions::createFunctionExtension) - - override fun visitReturnType(flags: Flags): KmTypeVisitor = - KmType(flags).also { returnType = it } - - override fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor = - extensions.singleOfType(type) - - /** - * Populates the given visitor with data in this function. - * - * @param visitor the visitor which will visit data in this function - */ - fun accept(visitor: KmFunctionVisitor) { - visitor.visitReturnType(returnType.flags)?.let(returnType::accept) - extensions.forEach { visitor.visitExtensions(it.type)?.let(it::accept) } - } -} - -/** - * Represents a type. - * - * @property flags type flags, consisting of [Flag.Type] flags - */ -class KmType(var flags: Flags) : KmTypeVisitor() { - /** - * Classifier of the type. - */ - lateinit var classifier: KmClassifier - - override fun visitClass(name: ClassName) { - classifier = KmClassifier.Class(name) - } - - /** - * Populates the given visitor with data in this type. - * - * @param visitor the visitor which will visit data in this type - */ - fun accept(visitor: KmTypeVisitor) { - when (val classifier = classifier) { - is KmClassifier.Class -> visitor.visitClass(classifier.name) - else -> throw IllegalStateException("Invalid classifier type: ${classifier::class}") - } - } -} - -/** - * Represents a classifier of a Kotlin type. A classifier is a class, type parameter or type alias. - * For example, in `MutableMap`, `MutableMap` is the classifier. - */ -sealed class KmClassifier { - /** - * Represents a class used as a classifier in a type. - * - * @property name the name of the class - */ - data class Class(val name: ClassName) : KmClassifier() -} - -internal fun T.addTo(collection: MutableCollection): T { - collection.add(this) - return this -} diff --git a/retrofit/src/main/java/retrofit2/kotlinx/metadata/visitors.kt b/retrofit/src/main/java/retrofit2/kotlinx/metadata/visitors.kt deleted file mode 100644 index dd03d99697..0000000000 --- a/retrofit/src/main/java/retrofit2/kotlinx/metadata/visitors.kt +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package retrofit2.kotlinx.metadata - -/** - * A visitor to visit Kotlin classes, including interfaces, objects, enum classes and annotation classes. - * - * When using this class, [visit] must be called first, followed by zero or more [visitTypeParameter] calls, followed by zero or more calls - * to other visit* methods, followed by [visitEnd]. - */ -abstract class KmClassVisitor @JvmOverloads constructor(private val delegate: KmClassVisitor? = null) { - - /** - * Visits a function in the container. - * - * @param flags function flags, consisting of [Flag.HAS_ANNOTATIONS], visibility flag, modality flag and [Flag.Function] flags - * @param name the name of the function - */ - open fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? = - delegate?.visitFunction(flags, name) -} - -/** - * A visitor to visit a Kotlin function declaration. - * - * When using this class, zero or more calls to [visitTypeParameter] must be done first, followed by zero or more calls - * to other visit* methods, followed by [visitEnd]. - */ -abstract class KmFunctionVisitor @JvmOverloads constructor(private val delegate: KmFunctionVisitor? = null) { - - /** - * Visits the return type of the function. - * - * @param flags type flags, consisting of [Flag.Type] flags - */ - open fun visitReturnType(flags: Flags): KmTypeVisitor? = - delegate?.visitReturnType(flags) - - /** - * Visits the extensions of the given type on the function. - * - * @param type the type of extension visitor to be returned - */ - open fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor? = - delegate?.visitExtensions(type) -} - -/** - * A visitor to visit a type. The type must have a classifier which is one of: a class [visitClass], type parameter [visitTypeParameter] - * or type alias [visitTypeAlias]. If the type's classifier is a class or a type alias, it can have type arguments ([visitArgument] and - * [visitStarProjection]). If the type's classifier is an inner class, it can have the outer type ([visitOuterType]), which captures - * the generic type arguments of the outer class. Also, each type can have an abbreviation ([visitAbbreviatedType]) in case a type alias - * was used originally at this site in the declaration (all types are expanded by default for metadata produced by the Kotlin compiler). - * If [visitFlexibleTypeUpperBound] is called, this type is regarded as a flexible type, and its contents represent the lower bound, - * and the result of the call represents the upper bound. - * - * When using this class, [visitEnd] must be called exactly once and after calls to all other visit* methods. - */ -abstract class KmTypeVisitor @JvmOverloads constructor(private val delegate: KmTypeVisitor? = null) { - /** - * Visits the name of the class, if this type's classifier is a class. - * - * @param name the name of the class - */ - open fun visitClass(name: ClassName) { - delegate?.visitClass(name) - } -} diff --git a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt index 5f96eea3a0..d8d509d2cd 100644 --- a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt +++ b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt @@ -26,8 +26,7 @@ import okhttp3.mockwebserver.MockWebServer import okhttp3.mockwebserver.SocketPolicy.DISCONNECT_AFTER_REQUEST import okhttp3.mockwebserver.SocketPolicy.NO_RESPONSE import org.assertj.core.api.Assertions.assertThat -import org.junit.Assert.assertTrue -import org.junit.Assert.fail +import org.junit.Assert.* import org.junit.Ignore import org.junit.Rule import org.junit.Test @@ -35,6 +34,7 @@ import retrofit2.helpers.ToStringConverterFactory import retrofit2.http.GET import retrofit2.http.Path import retrofit2.http.Query +import retrofit2.kotlin.metadata.deserialization.readRawVarint32 import java.io.IOException import java.lang.reflect.ParameterizedType import java.lang.reflect.Type @@ -136,6 +136,50 @@ class KotlinSuspendTest { } } + @Test fun protobuf() { + val bytes1 = byteArrayOf(74) + val varint1 = bytes1.inputStream().readRawVarint32() + assertEquals(74, varint1) + + val bytes2 = byteArrayOf(0x96.toByte(), 0x15) + val varint2 = bytes2.inputStream().readRawVarint32() + assertEquals(2710, varint2) + + val bytes3 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x15) + val varint3 = bytes3.inputStream().readRawVarint32() + assertEquals(346902, varint3) + + val bytes4 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x15) + val varint4 = bytes4.inputStream().readRawVarint32() + assertEquals(44403478, varint4) + + val bytes5 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x15) + val varint5 = bytes5.inputStream().readRawVarint32() + assertEquals(1388677910, varint5) + + val bytes6 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + val varint6 = bytes6.inputStream().readRawVarint32() + assertEquals(1388677910, varint6) + + val bytes7 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),) + try { + println("expecting error") + bytes7.inputStream().readRawVarint32() + fail() + } catch (e: Exception) { + println("exception: $e") + } + + val bytes8 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),) + try { + println("expecting error2") + bytes8.inputStream().readRawVarint32() + fail() + } catch (e: Exception) { + println("exception: $e") + } + } + @Test fun bodyNullable() { val retrofit = Retrofit.Builder() .baseUrl(server.url("/")) From c21bbe80ca1e9e3a99f24cecbafa6df20e744bbe Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Wed, 21 Apr 2021 01:36:44 +0200 Subject: [PATCH 06/15] Remove temporary protobuf test --- .../test/java/retrofit2/KotlinSuspendTest.kt | 44 ------------------- 1 file changed, 44 deletions(-) diff --git a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt index d8d509d2cd..4c3e50583b 100644 --- a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt +++ b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt @@ -136,50 +136,6 @@ class KotlinSuspendTest { } } - @Test fun protobuf() { - val bytes1 = byteArrayOf(74) - val varint1 = bytes1.inputStream().readRawVarint32() - assertEquals(74, varint1) - - val bytes2 = byteArrayOf(0x96.toByte(), 0x15) - val varint2 = bytes2.inputStream().readRawVarint32() - assertEquals(2710, varint2) - - val bytes3 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x15) - val varint3 = bytes3.inputStream().readRawVarint32() - assertEquals(346902, varint3) - - val bytes4 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x15) - val varint4 = bytes4.inputStream().readRawVarint32() - assertEquals(44403478, varint4) - - val bytes5 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x15) - val varint5 = bytes5.inputStream().readRawVarint32() - assertEquals(1388677910, varint5) - - val bytes6 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - val varint6 = bytes6.inputStream().readRawVarint32() - assertEquals(1388677910, varint6) - - val bytes7 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),) - try { - println("expecting error") - bytes7.inputStream().readRawVarint32() - fail() - } catch (e: Exception) { - println("exception: $e") - } - - val bytes8 = byteArrayOf(0x96.toByte(), 0x96.toByte(), 0x96.toByte(), 0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),0x96.toByte(),) - try { - println("expecting error2") - bytes8.inputStream().readRawVarint32() - fail() - } catch (e: Exception) { - println("exception: $e") - } - } - @Test fun bodyNullable() { val retrofit = Retrofit.Builder() .baseUrl(server.url("/")) From c9227d2aef551cf224244989ff91f3924c35b4a9 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Wed, 21 Apr 2021 08:22:25 +0200 Subject: [PATCH 07/15] Convert data classes to regular ones to pass animal sniffer check --- .../kotlin/metadata/deserialization/MetadataParser.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt index 229480f8c6..22b73097df 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt @@ -5,7 +5,7 @@ import java.io.ByteArrayInputStream class MetadataParser(val strings: Array, val input: ByteArrayInputStream) { - data class Record(val range: Int, val predefinedIndex: Int, val operation: Int) + class Record(val range: Int, val predefinedIndex: Int, val operation: Int) companion object { private val PREDEFINED_STRINGS = listOf( @@ -106,7 +106,7 @@ class MetadataParser(val strings: Array, val input: ByteArrayInputStream return KotlinMetadata.ReturnType(nullable, name == "kotlin/Unit") } - data class Signature(val nameIndex: Int, val desc: String) + class Signature(val nameIndex: Int, val desc: String) private fun parseSignature(): Signature { var nameIndex = -1 From af306efa99e8746e570b18c4291db345a06842df Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Wed, 21 Apr 2021 08:30:39 +0200 Subject: [PATCH 08/15] Handle missing metadata annotation --- retrofit/src/main/java/retrofit2/KotlinMetadata.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt index fd2d493dc6..7b5ca6fbac 100644 --- a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt +++ b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt @@ -13,6 +13,8 @@ object KotlinMetadata { private val kotlinFunctionsMap = ConcurrentHashMap, List>() @JvmStatic fun isReturnTypeNullable(method: Method): Boolean { + if (method.declaringClass.getAnnotation(Metadata::class.java) == null) return false + val javaMethodSignature = method.createSignature() val kotlinFunctions = loadKotlinFunctions(method.declaringClass) val candidates = kotlinFunctions.filter { it.signature == javaMethodSignature } From fef5457c24c3b369ddd08778ba54167752c4bd6d Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Wed, 21 Apr 2021 08:32:33 +0200 Subject: [PATCH 09/15] Run googleJavaFormat --- .../metadata/deserialization/BitEncoding.java | 213 +++++++++--------- .../ToNullStringResponseConverterFactory.java | 7 +- 2 files changed, 111 insertions(+), 109 deletions(-) diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java index db32eabd1b..69547fdc7d 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java @@ -5,124 +5,127 @@ package retrofit2.kotlin.metadata.deserialization; -import org.jetbrains.annotations.NotNull; - import static retrofit2.kotlin.metadata.deserialization.UtfEncodingKt.MAX_UTF8_INFO_LENGTH; +import org.jetbrains.annotations.NotNull; public class BitEncoding { - private static final char _8TO7_MODE_MARKER = (char) -1; + private static final char _8TO7_MODE_MARKER = (char) -1; - private BitEncoding() { - } + private BitEncoding() {} - private static void addModuloByte(@NotNull byte[] data, int increment) { - for (int i = 0, n = data.length; i < n; i++) { - data[i] = (byte) ((data[i] + increment) & 0x7f); - } + private static void addModuloByte(@NotNull byte[] data, int increment) { + for (int i = 0, n = data.length; i < n; i++) { + data[i] = (byte) ((data[i] + increment) & 0x7f); } - - /** - * Converts encoded array of {@code String} obtained by {@link BitEncoding#encodeBytes(byte[])} back to a byte array. - */ - @NotNull - public static byte[] decodeBytes(@NotNull String[] data) { - if (data.length > 0 && !data[0].isEmpty()) { - char possibleMarker = data[0].charAt(0); - if (possibleMarker == UtfEncodingKt.UTF8_MODE_MARKER) { - return UtfEncodingKt.stringsToBytes(dropMarker(data)); - } - if (possibleMarker == _8TO7_MODE_MARKER) { - data = dropMarker(data); - } - } - - byte[] bytes = combineStringArrayIntoBytes(data); - // Adding 0x7f modulo max byte value is equivalent to subtracting 1 the same modulo, which is inverse to what happens in encodeBytes - addModuloByte(bytes, 0x7f); - return decode7to8(bytes); + } + + /** + * Converts encoded array of {@code String} obtained by {@link BitEncoding#encodeBytes(byte[])} + * back to a byte array. + */ + @NotNull + public static byte[] decodeBytes(@NotNull String[] data) { + if (data.length > 0 && !data[0].isEmpty()) { + char possibleMarker = data[0].charAt(0); + if (possibleMarker == UtfEncodingKt.UTF8_MODE_MARKER) { + return UtfEncodingKt.stringsToBytes(dropMarker(data)); + } + if (possibleMarker == _8TO7_MODE_MARKER) { + data = dropMarker(data); + } } - @NotNull - private static String[] dropMarker(@NotNull String[] data) { - // Clone because the clients should be able to use the passed array for their own purposes. - // This is cheap because the size of the array is 1 or 2 almost always. - String[] result = data.clone(); - result[0] = result[0].substring(1); - return result; + byte[] bytes = combineStringArrayIntoBytes(data); + // Adding 0x7f modulo max byte value is equivalent to subtracting 1 the same modulo, which is + // inverse to what happens in encodeBytes + addModuloByte(bytes, 0x7f); + return decode7to8(bytes); + } + + @NotNull + private static String[] dropMarker(@NotNull String[] data) { + // Clone because the clients should be able to use the passed array for their own purposes. + // This is cheap because the size of the array is 1 or 2 almost always. + String[] result = data.clone(); + result[0] = result[0].substring(1); + return result; + } + + /** Combines the array of strings resulted from encodeBytes() into one long byte array */ + @NotNull + private static byte[] combineStringArrayIntoBytes(@NotNull String[] data) { + int resultLength = 0; + for (String s : data) { + assert s.length() <= MAX_UTF8_INFO_LENGTH : "String is too long: " + s.length(); + resultLength += s.length(); } - /** - * Combines the array of strings resulted from encodeBytes() into one long byte array - */ - @NotNull - private static byte[] combineStringArrayIntoBytes(@NotNull String[] data) { - int resultLength = 0; - for (String s : data) { - assert s.length() <= MAX_UTF8_INFO_LENGTH : "String is too long: " + s.length(); - resultLength += s.length(); - } - - byte[] result = new byte[resultLength]; - int p = 0; - for (String s : data) { - for (int i = 0, n = s.length(); i < n; i++) { - result[p++] = (byte) s.charAt(i); - } - } - - return result; + byte[] result = new byte[resultLength]; + int p = 0; + for (String s : data) { + for (int i = 0, n = s.length(); i < n; i++) { + result[p++] = (byte) s.charAt(i); + } } - /** - * Decodes the byte array resulted from encode8to7(). - * - * Each byte of the input array has at most 7 valuable bits of information. So the decoding is equivalent to the following: least - * significant 7 bits of all input bytes are combined into one long bit string. This bit string is then split into groups of 8 bits, - * each of which forms a byte in the output. If there are any leftovers, they are ignored, since they were added just as a padding and - * do not comprise a full byte. - * - * Suppose the following encoded byte array is given (bits are numbered the same way as in encode8to7() doc): - * - * 01234567 01234567 01234567 01234567 - * - * The output of the following form would be produced: - * - * 01234560 12345601 23456012 - * - * Note how all most significant bits and leftovers are dropped, since they don't contain any useful information - */ - @NotNull - private static byte[] decode7to8(@NotNull byte[] data) { - // floor(7 * data.length / 8) - int resultLength = 7 * data.length / 8; - - byte[] result = new byte[resultLength]; - - // We maintain a pointer to an input bit in the same fashion as in encode8to7(): it's represented as two numbers: index of the - // current byte in the input and index of the bit in the byte - int byteIndex = 0; - int bit = 0; - - // A resulting byte is comprised of 8 bits, starting from the current bit. Since each input byte only "contains 7 bytes", a - // resulting byte always consists of two parts: several most significant bits of the current byte and several least significant bits - // of the next byte - for (int i = 0; i < resultLength; i++) { - int firstPart = (data[byteIndex] & 0xff) >>> bit; - byteIndex++; - int secondPart = (data[byteIndex] & ((1 << (bit + 1)) - 1)) << 7 - bit; - result[i] = (byte) (firstPart + secondPart); - - if (bit == 6) { - byteIndex++; - bit = 0; - } - else { - bit++; - } - } - - return result; + return result; + } + + /** + * Decodes the byte array resulted from encode8to7(). + * + *

Each byte of the input array has at most 7 valuable bits of information. So the decoding is + * equivalent to the following: least significant 7 bits of all input bytes are combined into one + * long bit string. This bit string is then split into groups of 8 bits, each of which forms a + * byte in the output. If there are any leftovers, they are ignored, since they were added just as + * a padding and do not comprise a full byte. + * + *

Suppose the following encoded byte array is given (bits are numbered the same way as in + * encode8to7() doc): + * + *

01234567 01234567 01234567 01234567 + * + *

The output of the following form would be produced: + * + *

01234560 12345601 23456012 + * + *

Note how all most significant bits and leftovers are dropped, since they don't contain any + * useful information + */ + @NotNull + private static byte[] decode7to8(@NotNull byte[] data) { + // floor(7 * data.length / 8) + int resultLength = 7 * data.length / 8; + + byte[] result = new byte[resultLength]; + + // We maintain a pointer to an input bit in the same fashion as in encode8to7(): it's + // represented as two numbers: index of the + // current byte in the input and index of the bit in the byte + int byteIndex = 0; + int bit = 0; + + // A resulting byte is comprised of 8 bits, starting from the current bit. Since each input byte + // only "contains 7 bytes", a + // resulting byte always consists of two parts: several most significant bits of the current + // byte and several least significant bits + // of the next byte + for (int i = 0; i < resultLength; i++) { + int firstPart = (data[byteIndex] & 0xff) >>> bit; + byteIndex++; + int secondPart = (data[byteIndex] & ((1 << (bit + 1)) - 1)) << 7 - bit; + result[i] = (byte) (firstPart + secondPart); + + if (bit == 6) { + byteIndex++; + bit = 0; + } else { + bit++; + } } + + return result; + } } diff --git a/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java b/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java index 3b01544eca..4fbc8b6327 100644 --- a/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java +++ b/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java @@ -15,14 +15,13 @@ */ package retrofit2.helpers; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import javax.annotation.Nullable; import okhttp3.ResponseBody; import retrofit2.Converter; import retrofit2.Retrofit; -import javax.annotation.Nullable; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - public class ToNullStringResponseConverterFactory extends Converter.Factory { @Override From a9e210140f832c64c6364b8b80d385c321a5c0ab Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Fri, 15 Oct 2021 12:04:46 +0200 Subject: [PATCH 10/15] Add licenses to new files, update ones that were copied --- .../src/main/java/retrofit2/KotlinMetadata.kt | 19 ++++++++++++++++++- .../metadata/deserialization/BinaryVersion.kt | 16 +++++++++++++--- .../metadata/deserialization/BitEncoding.java | 19 ++++++++++++++----- .../deserialization/JvmMetadataVersion.kt | 18 +++++++++++++----- .../deserialization/MetadataParser.kt | 15 +++++++++++++++ .../metadata/deserialization/ProtobufUtils.kt | 15 +++++++++++++++ .../metadata/deserialization/utfEncoding.kt | 7 ++----- .../ToNullStringResponseConverterFactory.java | 2 +- 8 files changed, 91 insertions(+), 20 deletions(-) diff --git a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt index 7b5ca6fbac..2fc7c55194 100644 --- a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt +++ b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt @@ -1,6 +1,23 @@ +/* + * Copyright (C) 2021 Square, Inc. + * + * 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 retrofit2 -import retrofit2.kotlin.metadata.deserialization.* +import retrofit2.kotlin.metadata.deserialization.BitEncoding +import retrofit2.kotlin.metadata.deserialization.JvmMetadataVersion +import retrofit2.kotlin.metadata.deserialization.MetadataParser import java.io.ByteArrayInputStream import java.lang.reflect.Method import java.util.concurrent.ConcurrentHashMap diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt index 59b8367797..5ccd80343f 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt @@ -1,8 +1,18 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + * Copyright (C) 2021 Square, Inc. + * + * 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 retrofit2.kotlin.metadata.deserialization /** diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java index 69547fdc7d..a047fe1137 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java @@ -1,8 +1,18 @@ /* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + * Copyright (C) 2021 Square, Inc. + * + * 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 retrofit2.kotlin.metadata.deserialization; import static retrofit2.kotlin.metadata.deserialization.UtfEncodingKt.MAX_UTF8_INFO_LENGTH; @@ -22,8 +32,7 @@ private static void addModuloByte(@NotNull byte[] data, int increment) { } /** - * Converts encoded array of {@code String} obtained by {@link BitEncoding#encodeBytes(byte[])} - * back to a byte array. + * Converts encoded array of {@code String} back to a byte array. */ @NotNull public static byte[] decodeBytes(@NotNull String[] data) { diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt index 51153483d9..6fcb538f55 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt @@ -1,12 +1,20 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + * Copyright (C) 2021 Square, Inc. + * + * 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 retrofit2.kotlin.metadata.deserialization -import retrofit2.kotlin.metadata.deserialization.BinaryVersion - /** * The version of the metadata serialized by the compiler and deserialized by the compiler and reflection. * This version includes the version of the core protobuf messages (metadata.proto) as well as JVM extensions (jvm_metadata.proto). diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt index 22b73097df..24e4fed804 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2021 Square, Inc. + * + * 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 retrofit2.kotlin.metadata.deserialization import retrofit2.KotlinMetadata diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt index 2a280b6251..3423980cbc 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2021 Square, Inc. + * + * 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 retrofit2.kotlin.metadata.deserialization import java.io.ByteArrayInputStream diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt index 680be1ae2d..1ef14e97e8 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt @@ -1,11 +1,11 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. + * Copyright (C) 2021 Square, Inc. * * 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 + * 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, @@ -13,11 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package retrofit2.kotlin.metadata.deserialization -import java.util.* - // The maximum possible length of the byte array in the CONSTANT_Utf8_info structure in the bytecode, as per JVMS7 4.4.7 const val MAX_UTF8_INFO_LENGTH = 65535 diff --git a/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java b/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java index 4fbc8b6327..b7623a6dc0 100644 --- a/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java +++ b/retrofit/test-helpers/src/main/java/retrofit2/helpers/ToNullStringResponseConverterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Square, Inc. + * Copyright (C) 2021 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 164bcb6c3307ce3702aa52b1b809c9072acf479e Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Fri, 15 Oct 2021 13:33:59 +0200 Subject: [PATCH 11/15] Add links to originating files in kotlin-metadata --- .../metadata/deserialization/BinaryVersion.kt | 13 ++++++++++++- .../metadata/deserialization/BitEncoding.java | 5 +++++ .../metadata/deserialization/JvmMetadataVersion.kt | 7 ++++++- .../kotlin/metadata/deserialization/utfEncoding.kt | 5 +++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt index 5ccd80343f..005e105bb2 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BinaryVersion.kt @@ -15,6 +15,11 @@ */ package retrofit2.kotlin.metadata.deserialization +/** + * This file was adapted from https://github.com/JetBrains/kotlin/blob/af18b10da9d1e20b1b35831a3fb5e508048a2576/core/metadata/src/org/jetbrains/kotlin/metadata/deserialization/BinaryVersion.kt + * by removing unused parts. + */ + /** * Subclasses of this class are used to identify different versions of the binary output of the compiler and their compatibility guarantees. * - Major version should be increased only when the new binary format is neither forward- nor backward compatible. @@ -28,7 +33,12 @@ abstract class BinaryVersion(private vararg val numbers: Int) { val major: Int = numbers.getOrNull(0) ?: UNKNOWN val minor: Int = numbers.getOrNull(1) ?: UNKNOWN val patch: Int = numbers.getOrNull(2) ?: UNKNOWN - val rest: List = if (numbers.size > 3) numbers.asList().subList(3, numbers.size).toList() else emptyList() + val rest: List = if (numbers.size > 3) { + if (numbers.size > MAX_LENGTH) + throw IllegalArgumentException("BinaryVersion with length more than $MAX_LENGTH are not supported. Provided length ${numbers.size}.") + else + numbers.asList().subList(3, numbers.size).toList() + } else emptyList() abstract fun isCompatible(): Boolean @@ -64,6 +74,7 @@ abstract class BinaryVersion(private vararg val numbers: Int) { } companion object { + const val MAX_LENGTH = 1024 private const val UNKNOWN = -1 } } diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java index a047fe1137..9cf78b8101 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java @@ -19,6 +19,11 @@ import org.jetbrains.annotations.NotNull; +/** + * This file was adapted from https://github.com/JetBrains/kotlin/blob/af18b10da9d1e20b1b35831a3fb5e508048a2576/core/metadata.jvm/src/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java + * by removing the unused parts. + */ + public class BitEncoding { private static final char _8TO7_MODE_MARKER = (char) -1; diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt index 6fcb538f55..45cbd488a6 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmMetadataVersion.kt @@ -15,6 +15,11 @@ */ package retrofit2.kotlin.metadata.deserialization +/** + * This file was adapted from https://github.com/JetBrains/kotlin/blob/af18b10da9d1e20b1b35831a3fb5e508048a2576/core/metadata.jvm/src/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmMetadataVersion.kt + * by removing the unused parts. + */ + /** * The version of the metadata serialized by the compiler and deserialized by the compiler and reflection. * This version includes the version of the core protobuf messages (metadata.proto) as well as JVM extensions (jvm_metadata.proto). @@ -34,6 +39,6 @@ class JvmMetadataVersion(versionArray: IntArray, val isStrictSemantics: Boolean) companion object { @JvmField - val INSTANCE = JvmMetadataVersion(1, 5, 1) + val INSTANCE = JvmMetadataVersion(1, 6, 0) } } diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt index 1ef14e97e8..01880c71fc 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/utfEncoding.kt @@ -15,6 +15,11 @@ */ package retrofit2.kotlin.metadata.deserialization +/** + * This file was adapted from https://github.com/JetBrains/kotlin/blob/af18b10da9d1e20b1b35831a3fb5e508048a2576/core/metadata.jvm/src/org/jetbrains/kotlin/metadata/jvm/deserialization/utfEncoding.kt + * by removing the unused parts. + */ + // The maximum possible length of the byte array in the CONSTANT_Utf8_info structure in the bytecode, as per JVMS7 4.4.7 const val MAX_UTF8_INFO_LENGTH = 65535 From 4cf77b0ab6a7015fbac8156983e190d887d1e925 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Fri, 15 Oct 2021 16:04:11 +0200 Subject: [PATCH 12/15] Extract JvmNameResolver --- .../src/main/java/retrofit2/KotlinMetadata.kt | 6 +- .../deserialization/JvmNameResolver.kt | 156 ++++++++++++++++++ .../deserialization/MetadataParser.kt | 114 +------------ 3 files changed, 165 insertions(+), 111 deletions(-) create mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmNameResolver.kt diff --git a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt index 2fc7c55194..de82bf08a5 100644 --- a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt +++ b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt @@ -17,6 +17,7 @@ package retrofit2 import retrofit2.kotlin.metadata.deserialization.BitEncoding import retrofit2.kotlin.metadata.deserialization.JvmMetadataVersion +import retrofit2.kotlin.metadata.deserialization.JvmNameResolver import retrofit2.kotlin.metadata.deserialization.MetadataParser import java.io.ByteArrayInputStream import java.lang.reflect.Method @@ -80,9 +81,10 @@ object KotlinMetadata { require(metadataAnnotation.kind == 1) { "Metadata of wrong kind: ${metadataAnnotation.kind}" } require(metadataAnnotation.data1.isNotEmpty()) { "data1 must not be empty" } - val bytes = BitEncoding.decodeBytes(metadataAnnotation.data1) + val bytes: ByteArray = BitEncoding.decodeBytes(metadataAnnotation.data1) val stream = ByteArrayInputStream(bytes) - val parser = MetadataParser(metadataAnnotation.data2, stream) + val jvmNameResolver = JvmNameResolver(stream, metadataAnnotation.data2) + val parser = MetadataParser(stream, jvmNameResolver) return parser.parseClass() } diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmNameResolver.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmNameResolver.kt new file mode 100644 index 0000000000..37c580ed07 --- /dev/null +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmNameResolver.kt @@ -0,0 +1,156 @@ + +package retrofit2.kotlin.metadata.deserialization + +import java.io.ByteArrayInputStream + +class JvmNameResolver(private val input: ByteArrayInputStream, private val strings: Array) { + + class Record( + val range: Int, + val predefinedIndex: Int, + val operation: Int, + val string: String?, + val substringIndexList: List, + val replaceCharList: List + ) { + fun hasString() = string != null + fun hasPredefinedIndex() = predefinedIndex != -1 + } + + private val records = parseStringTableTypes() + + fun getString(index: Int): String { + val record = records[index] + + var string = when { + record.hasString() -> record.string + record.hasPredefinedIndex() && record.predefinedIndex in PREDEFINED_STRINGS.indices -> + PREDEFINED_STRINGS[record.predefinedIndex] + else -> strings[index] + } + requireNotNull(string) + + if (record.substringIndexList.size >= 2) { + val (begin, end) = record.substringIndexList + if (begin in 0..end && end <= string.length) { + string = string.substring(begin, end) + } + } + + if (record.replaceCharList.size >= 2) { + val (from, to) = record.replaceCharList + string = string.replace(from.toChar(), to.toChar()) + } + + when (record.operation) { + 0 -> { + // Do nothing + } + 1 -> { + string = string.replace('$', '.') + } + 2 -> { + if (string.length >= 2) { + string = string.substring(1, string.length - 1) + } + string = string.replace('$', '.') + } + } + + return string + } + + private fun parseStringTableTypes(): List { + val records = mutableListOf() + input.readMessage { field, wireType -> + when (field) { + 1 -> { + val record = parseRecord() + repeat(record.range) { records += record } + } + else -> { input.skipProto(wireType) } + } + } + + return records + } + + private fun parseRecord(): Record { + var range = 1 + var operation = 0 + var predefinedIndex = -1 + var string: String? = null + val substringIndexList = mutableListOf() + val replaceCharList = mutableListOf() + + input.readMessage { field, wireType -> + when (field) { + 1 -> { + range = input.readRawVarint32() + } + 2 -> { + predefinedIndex = input.readRawVarint32() + } + 3 -> { + operation = input.readRawVarint32() + } + 4 -> { + val length = input.readRawVarint32() + repeat(length) { + substringIndexList += input.readRawVarint32() + } + } + 5 -> { + val length = input.readRawVarint32() + repeat(length) { + replaceCharList += input.readRawVarint32() + } + } + 6 -> { + val length = input.readRawVarint32() + val array = ByteArray(length) + input.read(array) + string = String(array) + } + else -> { input.skipProto(wireType) } + } + } + + return Record(range, predefinedIndex, operation, string, substringIndexList, replaceCharList) + } + + companion object { + private 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/collections/Iterable", "kotlin/collections/MutableIterable", + "kotlin/collections/Collection", "kotlin/collections/MutableCollection", + "kotlin/collections/List", "kotlin/collections/MutableList", + "kotlin/collections/Set", "kotlin/collections/MutableSet", + "kotlin/collections/Map", "kotlin/collections/MutableMap", + "kotlin/collections/Map.Entry", "kotlin/collections/MutableMap.MutableEntry", + + "kotlin/collections/Iterator", "kotlin/collections/MutableIterator", + "kotlin/collections/ListIterator", "kotlin/collections/MutableListIterator" + ) + } +} \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt index 24e4fed804..78688c830d 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt @@ -18,46 +18,7 @@ package retrofit2.kotlin.metadata.deserialization import retrofit2.KotlinMetadata import java.io.ByteArrayInputStream -class MetadataParser(val strings: Array, val input: ByteArrayInputStream) { - - class Record(val range: Int, val predefinedIndex: Int, val operation: Int) - - companion object { - private 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/collections/Iterable", "kotlin/collections/MutableIterable", - "kotlin/collections/Collection", "kotlin/collections/MutableCollection", - "kotlin/collections/List", "kotlin/collections/MutableList", - "kotlin/collections/Set", "kotlin/collections/MutableSet", - "kotlin/collections/Map", "kotlin/collections/MutableMap", - "kotlin/collections/Map.Entry", "kotlin/collections/MutableMap.MutableEntry", - - "kotlin/collections/Iterator", "kotlin/collections/MutableIterator", - "kotlin/collections/ListIterator", "kotlin/collections/MutableListIterator" - ) - } - - private val records = parseStringTableTypes() +class MetadataParser(val input: ByteArrayInputStream, val nameResolver: JvmNameResolver) { fun parseClass(): List { val functions = mutableListOf() @@ -85,7 +46,7 @@ class MetadataParser(val strings: Array, val input: ByteArrayInputStream when (field) { 2 -> { val nameIndex = input.readRawVarint32() - name = getString(nameIndex) + name = nameResolver.getString(nameIndex) } 3 -> { returnType = parseReturnType() @@ -97,7 +58,7 @@ class MetadataParser(val strings: Array, val input: ByteArrayInputStream } } - val actualName = if (signature.nameIndex != -1) getString(signature.nameIndex) else name + val actualName = if (signature.nameIndex != -1) nameResolver.getString(signature.nameIndex) else name return KotlinMetadata.Function(actualName + signature.desc, returnType) } @@ -112,7 +73,7 @@ class MetadataParser(val strings: Array, val input: ByteArrayInputStream } 6 -> { val nameIndex = input.readRawVarint32() - name = getString(nameIndex) + name = nameResolver.getString(nameIndex) } else -> input.skipProto(wire) } @@ -132,7 +93,7 @@ class MetadataParser(val strings: Array, val input: ByteArrayInputStream nameIndex = input.readRawVarint32() } 2 -> { - desc = getString(input.readRawVarint32()) + desc = nameResolver.getString(input.readRawVarint32()) } else -> input.skipProto(wireType) } @@ -140,69 +101,4 @@ class MetadataParser(val strings: Array, val input: ByteArrayInputStream return Signature(nameIndex, desc) } - - private fun parseStringTableTypes(): List { - val records = mutableListOf() - input.readMessage { field, wireType -> - when (field) { - 1 -> { - val record = parseRecord() - repeat(record.range) { records += record } - } - else -> { input.skipProto(wireType) } - } - } - - return records - } - - private fun parseRecord(): Record { - var range = 1 - var operation = 0 - var predefinedIndex = -1 - - input.readMessage { field, wireType -> - when (field) { - 1 -> { - range = input.readRawVarint32() - } - 2 -> { - predefinedIndex = input.readRawVarint32() - } - 3 -> { - operation = input.readRawVarint32() - } - else -> { input.skipProto(wireType) } - } - } - - return Record(range, predefinedIndex, operation) - } - - private fun getString(index: Int): String { - val record = records[index] - - var string = when { - record.predefinedIndex != -1 && record.predefinedIndex in PREDEFINED_STRINGS.indices -> - PREDEFINED_STRINGS[record.predefinedIndex] - else -> strings[index] - } - - when (record.operation) { - 0 -> { - // Do nothing - } - 1 -> { - string = string.replace('$', '.') - } - 2 -> { - if (string.length >= 2) { - string = string.substring(1, string.length - 1) - } - string = string.replace('$', '.') - } - } - - return string - } } \ No newline at end of file From afb918817cf5ba70b8fdd7f0ad8a64cf01a881a1 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Sat, 16 Oct 2021 13:50:47 +0200 Subject: [PATCH 13/15] Use protobuf impl from kotlinx.serialization + clean up --- .../src/main/java/retrofit2/KotlinMetadata.kt | 11 +- .../deserialization/JvmNameResolver.kt | 104 ++---- .../deserialization/MetadataParser.kt | 87 +---- .../kotlin/metadata/deserialization/Models.kt | 246 +++++++++++++ .../metadata/deserialization/ProtobufUtils.kt | 324 ++++++++++++++---- .../test/java/retrofit2/KotlinSuspendTest.kt | 2 - 6 files changed, 541 insertions(+), 233 deletions(-) create mode 100644 retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Models.kt diff --git a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt index de82bf08a5..6198343d27 100644 --- a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt +++ b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt @@ -16,10 +16,10 @@ package retrofit2 import retrofit2.kotlin.metadata.deserialization.BitEncoding +import retrofit2.kotlin.metadata.deserialization.ByteArrayInput import retrofit2.kotlin.metadata.deserialization.JvmMetadataVersion -import retrofit2.kotlin.metadata.deserialization.JvmNameResolver import retrofit2.kotlin.metadata.deserialization.MetadataParser -import java.io.ByteArrayInputStream +import retrofit2.kotlin.metadata.deserialization.ProtobufReader import java.lang.reflect.Method import java.util.concurrent.ConcurrentHashMap @@ -82,11 +82,10 @@ object KotlinMetadata { require(metadataAnnotation.data1.isNotEmpty()) { "data1 must not be empty" } val bytes: ByteArray = BitEncoding.decodeBytes(metadataAnnotation.data1) - val stream = ByteArrayInputStream(bytes) - val jvmNameResolver = JvmNameResolver(stream, metadataAnnotation.data2) - val parser = MetadataParser(stream, jvmNameResolver) + val reader = ProtobufReader(ByteArrayInput(bytes)) + val parser = MetadataParser(reader, metadataAnnotation.data2) - return parser.parseClass() + return parser.parse() } private fun Class<*>.typeToSignature() = when { diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmNameResolver.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmNameResolver.kt index 37c580ed07..d3c10f19ea 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmNameResolver.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/JvmNameResolver.kt @@ -1,26 +1,29 @@ - +/* + * Copyright (C) 2021 Square, Inc. + * + * 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 retrofit2.kotlin.metadata.deserialization -import java.io.ByteArrayInputStream - -class JvmNameResolver(private val input: ByteArrayInputStream, private val strings: Array) { - - class Record( - val range: Int, - val predefinedIndex: Int, - val operation: Int, - val string: String?, - val substringIndexList: List, - val replaceCharList: List - ) { - fun hasString() = string != null - fun hasPredefinedIndex() = predefinedIndex != -1 - } +/** + * This file was adapted from https://github.com/JetBrains/kotlin/blob/26673d2b08f01dec1a9007b9b75436a50fa497e9/core/metadata.jvm/src/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt + * by removing the unused parts. + */ - private val records = parseStringTableTypes() +internal class JvmNameResolver(private val types: StringTableTypes, private val strings: Array) { fun getString(index: Int): String { - val record = records[index] + val record = types.records[index] var string = when { record.hasString() -> record.string @@ -43,13 +46,13 @@ class JvmNameResolver(private val input: ByteArrayInputStream, private val strin } when (record.operation) { - 0 -> { + Record.OPERATION_NONE -> { // Do nothing } - 1 -> { + Record.OPERATION_INTERNAL_TO_CLASS_ID -> { string = string.replace('$', '.') } - 2 -> { + Record.OPERATION_DESC_TO_CLASS_ID -> { if (string.length >= 2) { string = string.substring(1, string.length - 1) } @@ -60,65 +63,6 @@ class JvmNameResolver(private val input: ByteArrayInputStream, private val strin return string } - private fun parseStringTableTypes(): List { - val records = mutableListOf() - input.readMessage { field, wireType -> - when (field) { - 1 -> { - val record = parseRecord() - repeat(record.range) { records += record } - } - else -> { input.skipProto(wireType) } - } - } - - return records - } - - private fun parseRecord(): Record { - var range = 1 - var operation = 0 - var predefinedIndex = -1 - var string: String? = null - val substringIndexList = mutableListOf() - val replaceCharList = mutableListOf() - - input.readMessage { field, wireType -> - when (field) { - 1 -> { - range = input.readRawVarint32() - } - 2 -> { - predefinedIndex = input.readRawVarint32() - } - 3 -> { - operation = input.readRawVarint32() - } - 4 -> { - val length = input.readRawVarint32() - repeat(length) { - substringIndexList += input.readRawVarint32() - } - } - 5 -> { - val length = input.readRawVarint32() - repeat(length) { - replaceCharList += input.readRawVarint32() - } - } - 6 -> { - val length = input.readRawVarint32() - val array = ByteArray(length) - input.read(array) - string = String(array) - } - else -> { input.skipProto(wireType) } - } - } - - return Record(range, predefinedIndex, operation, string, substringIndexList, replaceCharList) - } - companion object { private val PREDEFINED_STRINGS = listOf( "kotlin/Any", diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt index 78688c830d..48d0840c80 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt @@ -16,89 +16,26 @@ package retrofit2.kotlin.metadata.deserialization import retrofit2.KotlinMetadata -import java.io.ByteArrayInputStream -class MetadataParser(val input: ByteArrayInputStream, val nameResolver: JvmNameResolver) { +internal class MetadataParser(private val reader: ProtobufReader, private val strings: Array) { - fun parseClass(): List { - val functions = mutableListOf() - while (true) { - val tag = input.readTag() - if (tag == 0) break - - val field = tag ushr 3 - val wire = tag and 7 - when (field) { - 9 -> { functions += parseFunction() } - else -> { input.skipProto(wire) } - } - } - - return functions - } + fun parse(): List { + val table = StringTableTypes.parse(makeDelimited(reader, true)) + val nameResolver = JvmNameResolver(table, strings) - private fun parseFunction(): KotlinMetadata.Function { - lateinit var returnType: KotlinMetadata.ReturnType - lateinit var name: String - lateinit var signature: Signature - - input.readMessage { field, wire -> - when (field) { - 2 -> { - val nameIndex = input.readRawVarint32() - name = nameResolver.getString(nameIndex) - } - 3 -> { - returnType = parseReturnType() - } - 100 -> { - signature = parseSignature() - } - else -> { input.skipProto(wire) } - } - } + val klass = Klass.parse(reader) - val actualName = if (signature.nameIndex != -1) nameResolver.getString(signature.nameIndex) else name - return KotlinMetadata.Function(actualName + signature.desc, returnType) - } - - private fun parseReturnType(): KotlinMetadata.ReturnType { - var nullable = false - lateinit var name: String - - input.readMessage { field, wire -> - when (field) { - 3 -> { - nullable = input.readRawVarint32() != 0 - } - 6 -> { - val nameIndex = input.readRawVarint32() - name = nameResolver.getString(nameIndex) - } - else -> input.skipProto(wire) - } - } + val functions = mutableListOf() - return KotlinMetadata.ReturnType(nullable, name == "kotlin/Unit") - } + klass.functions.forEach { f -> + val functionName = f.getName(nameResolver) + val signatureDesc = f.signature.getDesc(nameResolver) - class Signature(val nameIndex: Int, val desc: String) + val returnType = KotlinMetadata.ReturnType(f.returnType.isNullable, f.returnType.isUnit(nameResolver)) - private fun parseSignature(): Signature { - var nameIndex = -1 - var desc = "" - input.readMessage { field, wireType -> - when (field) { - 1 -> { - nameIndex = input.readRawVarint32() - } - 2 -> { - desc = nameResolver.getString(input.readRawVarint32()) - } - else -> input.skipProto(wireType) - } + functions += KotlinMetadata.Function(functionName + signatureDesc, returnType) } - return Signature(nameIndex, desc) + return functions } } \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Models.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Models.kt new file mode 100644 index 0000000000..06120322b8 --- /dev/null +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Models.kt @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2021 Square, Inc. + * + * 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 retrofit2.kotlin.metadata.deserialization + +/** + * These are classes representing https://github.com/JetBrains/kotlin/blob/c6697499153329c088b60404bc584bf4b85a105b/core/metadata.jvm/src/jvm_metadata.proto + * and https://github.com/JetBrains/kotlin/blob/92d200e093c693b3c06e53a39e0b0973b84c7ec5/core/metadata/src/metadata.proto + */ + +internal class StringTableTypes(val records: List) { + + companion object { + private const val ID_RECORD = 1 + + fun parse(reader: ProtobufReader): StringTableTypes { + val records = mutableListOf() + + while (reader.readTag() != -1) { + when (reader.currentId) { + ID_RECORD -> { + val record = Record.parse(makeDelimited(reader)) + repeat(record.range) { records += record } + } + else -> { reader.skipElement() } + } + } + + return StringTableTypes(records) + } + } +} + +internal class Record( + val range: Int, + val predefinedIndex: Int, + val operation: Int, + val string: String?, + val substringIndexList: List, + val replaceCharList: List +) { + fun hasString() = string != null + fun hasPredefinedIndex() = predefinedIndex != -1 + + companion object { + private const val ID_RANGE = 1 + private const val ID_PREDEFINED_INDEX = 2 + private const val ID_STRING = 6 + private const val ID_OPERATION = 3 + private const val ID_SUBSTRING_INDEX = 4 + private const val ID_REPLACE_CHAR = 5 + + internal const val OPERATION_NONE = 0 + internal const val OPERATION_INTERNAL_TO_CLASS_ID = 1 + internal const val OPERATION_DESC_TO_CLASS_ID = 2 + + fun parse(reader: ProtobufReader): Record { + var range = 1 + var operation = 0 + var predefinedIndex = -1 + var string: String? = null + val substringIndexList = mutableListOf() + val replaceCharList = mutableListOf() + + while (reader.readTag() != -1) { + when (reader.currentId) { + ID_RANGE -> { + range = reader.readInt(ProtoIntegerType.DEFAULT) + } + ID_PREDEFINED_INDEX -> { + predefinedIndex = reader.readInt(ProtoIntegerType.DEFAULT) + } + ID_OPERATION -> { + operation = reader.readInt(ProtoIntegerType.DEFAULT) + } + ID_SUBSTRING_INDEX -> { + readIntoList(reader, substringIndexList) + } + ID_REPLACE_CHAR -> { + readIntoList(reader, replaceCharList) + } + ID_STRING -> { + string = reader.readString() + } + else -> { reader.skipElement() } + } + } + + return Record(range, predefinedIndex, operation, string, substringIndexList, replaceCharList) + } + } +} + +internal class Klass(val functions: List) { + + companion object { + private const val ID_FUNCTION = 9 + + fun parse(reader: ProtobufReader): Klass { + val functions = mutableListOf() + + while (reader.readTag() != -1) { + if (reader.currentId == ID_FUNCTION) { + functions += Function.parse(makeDelimited(reader)) + } else { + reader.skipElement() + } + } + + return Klass(functions) + } + } +} + +internal class Function(val nameIndex: Int, val returnType: Type, val signature: JvmMethodSignature) { + + fun getName(nameResolver: JvmNameResolver): String { + return signature.getName(nameResolver) ?: nameResolver.getString(nameIndex) + } + + companion object { + private const val ID_NAME = 2 + private const val ID_RETURN_TYPE = 3 + private const val ID_SIGNATURE = 100 + + fun parse(reader: ProtobufReader): Function { + lateinit var returnType: Type + var nameIndex = -1 + lateinit var signature: JvmMethodSignature + + while (reader.readTag() != -1) { + when (reader.currentId) { + ID_NAME -> { + nameIndex = reader.readInt(ProtoIntegerType.DEFAULT) + } + ID_RETURN_TYPE -> { + returnType = Type.parse(makeDelimited(reader)) + } + ID_SIGNATURE -> { + signature = JvmMethodSignature.parse(makeDelimited(reader)) + } + else -> { + reader.skipElement() + } + } + } + + return Function(nameIndex, returnType, signature) + } + } +} + +internal class Type(val isNullable: Boolean, private val nameIndex: Int) { + + fun isUnit(nameResolver: JvmNameResolver): Boolean = nameResolver.getString(nameIndex) == "kotlin/Unit" + + companion object { + private const val ID_NULLABLE = 3 + private const val ID_CLASS_NAME = 6 + + fun parse(reader: ProtobufReader): Type { + var nullable = false + var nameIndex = -1 + + while (reader.readTag() != -1) { + when (reader.currentId) { + ID_NULLABLE -> { + nullable = reader.readInt(ProtoIntegerType.DEFAULT) != 0 + } + ID_CLASS_NAME -> { + nameIndex = reader.readInt(ProtoIntegerType.DEFAULT) + } + else -> { + reader.skipElement() + } + } + } + + return Type(nullable, nameIndex) + } + } +} + +internal class JvmMethodSignature(val nameIndex: Int, val descIndex: Int) { + + fun getName(nameResolver: JvmNameResolver): String? { + return if (nameIndex != -1) nameResolver.getString(nameIndex) else null + } + + fun getDesc(nameResolver: JvmNameResolver): String = nameResolver.getString(descIndex) + + + companion object { + private const val ID_NAME = 1 + private const val ID_DESC = 2 + + fun parse(reader: ProtobufReader): JvmMethodSignature { + var nameIndex = -1 + var descIndex = -1 + while (reader.readTag() != -1) { + when (reader.currentId) { + ID_NAME -> { + nameIndex = reader.readInt(ProtoIntegerType.DEFAULT) + } + ID_DESC -> { + descIndex = reader.readInt(ProtoIntegerType.DEFAULT) + } + else -> reader.skipElement() + } + } + + return JvmMethodSignature(nameIndex, descIndex) + } + } +} + +internal fun makeDelimited(decoder: ProtobufReader, tagless: Boolean = false): ProtobufReader { + val input = if (tagless) decoder.objectTaglessInput() else decoder.objectInput() + return ProtobufReader(input) +} + +private fun readIntoList( + reader: ProtobufReader, + mutableList: MutableList +) { + if (reader.currentType == VARINT) { + mutableList += reader.readInt(ProtoIntegerType.DEFAULT) + } else { + val arrayReader = ProtobufReader(reader.objectInput()) + while (0 < arrayReader.availableBytes) { + mutableList += arrayReader.readInt(ProtoIntegerType.DEFAULT) + } + } +} \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt index 3423980cbc..482f269259 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/ProtobufUtils.kt @@ -15,96 +15,280 @@ */ package retrofit2.kotlin.metadata.deserialization -import java.io.ByteArrayInputStream +/** + * This file was adapted from https://github.com/Kotlin/kotlinx.serialization/blob/1814a92b871dac128db67c765c9df2b6be8405c7/formats/protobuf/commonMain/src/kotlinx/serialization/protobuf/internal/Streams.kt + * and https://github.com/Kotlin/kotlinx.serialization/blob/1814a92b871dac128db67c765c9df2b6be8405c7/formats/protobuf/commonMain/src/kotlinx/serialization/protobuf/internal/ProtobufReader.kt + * by removing the unused parts. + */ + +internal open class SerializationException(message: String?) : IllegalArgumentException(message) + +internal class ProtobufDecodingException(message: String) : SerializationException(message) -fun ByteArrayInputStream.skipProto(wire: Int) { - when (wire) { - 0 -> readRawVarint32() - 1 -> skip(8L) - 2 -> skip(readRawVarint32().toLong()) - 5 -> skip(4L) - else -> throw IllegalStateException("Invalid wire type: $wire") +class ByteArrayInput(private var array: ByteArray, private val endIndex: Int = array.size) { + private var position: Int = 0 + val availableBytes: Int get() = endIndex - position + + fun slice(size: Int): ByteArrayInput { + ensureEnoughBytes(size) + val result = ByteArrayInput(array, position + size) + result.position = position + position += size + return result + } + + fun read(): Int { + return if (position < endIndex) array[position++].toInt() and 0xFF else -1 + } + + fun readExactNBytes(bytesCount: Int): ByteArray { + ensureEnoughBytes(bytesCount) + val b = ByteArray(bytesCount) + val length = b.size + // Are there any bytes available? + val copied = if (endIndex - position < length) endIndex - position else length + array.copyInto(destination = b, destinationOffset = 0, startIndex = position, endIndex = position + copied) + position += copied + return b } -} -inline fun ByteArrayInputStream.readMessage(block: (Int, Int) -> Unit) { - val size = readRawVarint32() + private fun ensureEnoughBytes(bytesCount: Int) { + if (bytesCount > availableBytes) { + throw SerializationException("Unexpected EOF, available $availableBytes bytes, requested: $bytesCount") + } + } - val start = available() - while (true) { - if (start - available() >= size) break + fun readString(length: Int): String { + val result = array.decodeToString(position, position + length) + position += length + return result + } - val tag = readTag() - if (tag == 0) break + fun readVarint32(): Int { + if (position == endIndex) { + eof() + } - val wire = tag and 7 - val field = tag ushr 3 - block(field, wire) + // Fast-path: unrolled loop for single and two byte values + var currentPosition = position + var result = array[currentPosition++].toInt() + if (result >= 0) { + position = currentPosition + return result + } else if (endIndex - position > 1) { + result = result xor (array[currentPosition++].toInt() shl 7) + if (result < 0) { + position = currentPosition + return result xor (0.inv() shl 7) + } + } + + return readVarint32SlowPath() } -} -fun ByteArrayInputStream.readTag(): Int { - if (available() == 0) { - return 0 + fun readVarint64(eofAllowed: Boolean): Long { + if (position == endIndex) { + if (eofAllowed) return -1 + else eof() + } + + // Fast-path: single and two byte values + var currentPosition = position + var result = array[currentPosition++].toLong() + if (result >= 0) { + position = currentPosition + return result + } else if (endIndex - position > 1) { + result = result xor (array[currentPosition++].toLong() shl 7) + if (result < 0) { + position = currentPosition + return result xor (0L.inv() shl 7) + } + } + + return readVarint64SlowPath() } - val result = readRawVarint32() - if (result ushr 3 == 0) { - // If we actually read zero (or any tag number corresponding to field - // number zero), that's not a valid tag. - throw IllegalStateException("Invalid tag") + private fun eof() { + throw SerializationException("Unexpected EOF") } - return result -} -fun ByteArrayInputStream.readRawVarint32(): Int { - // See implementation notes for readRawVarint64 - fastpath@while (true) { - if (available() == 0) { - reset() - break@fastpath + private fun readVarint64SlowPath(): Long { + var result = 0L + var shift = 0 + while (shift < 64) { + val byte = read() + result = result or ((byte and 0x7F).toLong() shl shift) + if (byte and 0x80 == 0) { + return result + } + shift += 7 } - mark(0) - var x: Int - if (readByte().also { x = it.toInt() } >= 0) { - return x - } else if (available() < 9) { - reset() - break@fastpath - } else if ((readByte().toInt() shl 7).let { x = x xor it; x } < 0L) { - x = x xor (0L.inv() shl 7).toInt() - } else if ((readByte().toInt() shl 14).let { x = x xor it; x } >= 0L) { - x = x xor (0L.inv() shl 7 xor (0L.inv() shl 14)).toInt() - } else if ((readByte().toInt() shl 21).let { x = x xor it; x } < 0L) { - x = x xor (0L.inv() shl 7 xor (0L.inv() shl 14) xor (0L.inv() shl 21)).toInt() - } else { - val y = readByte().toInt() - x = x xor (y shl 28) - x = x xor (0L.inv() shl 7 xor (0L.inv() shl 14) xor (0L.inv() shl 21) xor (0L.inv() shl 28)).toInt() - if (y < 0 && readByte() < 0 && readByte() < 0 && readByte() < 0 && readByte() < 0 && readByte() < 0) { - reset() - break@fastpath // Will throw malformedVarint() + throw SerializationException("Input stream is malformed: Varint too long (exceeded 64 bits)") + } + + private fun readVarint32SlowPath(): Int { + var result = 0 + var shift = 0 + while (shift < 32) { + val byte = read() + result = result or ((byte and 0x7F) shl shift) + if (byte and 0x80 == 0) { + return result } + shift += 7 } - return x + throw SerializationException("Input stream is malformed: Varint too long (exceeded 32 bits)") } +} - return readRawVarint64SlowPath().toInt() +internal enum class ProtoIntegerType { + DEFAULT, + SIGNED, + FIXED; } +internal const val VARINT = 0 +internal const val i64 = 1 +internal const val SIZE_DELIMITED = 2 +internal const val i32 = 5 -fun ByteArrayInputStream.readRawVarint64SlowPath(): Long { - var result: Long = 0 - var shift = 0 - while (shift < 64) { - val b = read().toLong() - result = result or ((b and 0x7F) shl shift) - if ((b and 0x80) == 0L) { - return result +internal class ProtobufReader(private val input: ByteArrayInput) { + @JvmField + var currentId = -1 + @JvmField + var currentType = -1 + + val availableBytes: Int + get() = input.availableBytes + + fun readTag(): Int { + val header = input.readVarint64(true).toInt() + return if (header == -1) { + currentId = -1 + currentType = -1 + -1 + } else { + currentId = header ushr 3 + currentType = header and 0b111 + currentId + } + } + + fun skipElement() { + when (currentType) { + VARINT -> readInt(ProtoIntegerType.DEFAULT) + i64 -> readLong(ProtoIntegerType.FIXED) + SIZE_DELIMITED -> readByteArray() + i32 -> readInt(ProtoIntegerType.FIXED) + else -> throw ProtobufDecodingException("Unsupported start group or end group wire type: $currentType") + } + } + + @Suppress("NOTHING_TO_INLINE") + private inline fun assertWireType(expected: Int) { + if (currentType != expected) throw ProtobufDecodingException("Expected wire type $expected, but found $currentType") + } + + private fun readByteArray(): ByteArray { + assertWireType(SIZE_DELIMITED) + return readByteArrayNoTag() + } + + private fun readByteArrayNoTag(): ByteArray { + val length = decode32() + checkLength(length) + return input.readExactNBytes(length) + } + + fun objectInput(): ByteArrayInput { + assertWireType(SIZE_DELIMITED) + return objectTaglessInput() + } + + fun objectTaglessInput(): ByteArrayInput { + val length = decode32() + checkLength(length) + return input.slice(length) + } + + fun readInt(format: ProtoIntegerType): Int { + val wireType = if (format == ProtoIntegerType.FIXED) i32 else VARINT + assertWireType(wireType) + return decode32(format) + } + + private fun readLong(format: ProtoIntegerType): Long { + val wireType = if (format == ProtoIntegerType.FIXED) i64 else VARINT + assertWireType(wireType) + return decode64(format) + } + + private fun readIntLittleEndian(): Int { + // TODO this could be optimized by extracting method to the IS + var result = 0 + for (i in 0..3) { + val byte = input.read() and 0x000000FF + result = result or (byte shl (i * 8)) + } + return result + } + + private fun readLongLittleEndian(): Long { + // TODO this could be optimized by extracting method to the IS + var result = 0L + for (i in 0..7) { + val byte = (input.read() and 0x000000FF).toLong() + result = result or (byte shl (i * 8)) + } + return result + } + + fun readString(): String { + assertWireType(SIZE_DELIMITED) + val length = decode32() + checkLength(length) + return input.readString(length) + } + + private fun checkLength(length: Int) { + if (length < 0) { + throw ProtobufDecodingException("Unexpected negative length: $length") } - shift += 7 } - throw IllegalStateException("Malformed varint") -} -fun ByteArrayInputStream.readByte(): Byte = read().toByte() \ No newline at end of file + private fun decode32(format: ProtoIntegerType = ProtoIntegerType.DEFAULT): Int = when (format) { + ProtoIntegerType.DEFAULT -> input.readVarint64(false).toInt() + ProtoIntegerType.SIGNED -> decodeSignedVarintInt(input) + ProtoIntegerType.FIXED -> readIntLittleEndian() + } + + private fun decode64(format: ProtoIntegerType = ProtoIntegerType.DEFAULT): Long = when (format) { + ProtoIntegerType.DEFAULT -> input.readVarint64(false) + ProtoIntegerType.SIGNED -> decodeSignedVarintLong(input) + ProtoIntegerType.FIXED -> readLongLittleEndian() + } + + /** + * Source for all varint operations: + * https://github.com/addthis/stream-lib/blob/master/src/main/java/com/clearspring/analytics/util/Varint.java + */ + private fun decodeSignedVarintInt(input: ByteArrayInput): Int { + val raw = input.readVarint32() + val temp = raw shl 31 shr 31 xor raw shr 1 + // This extra step lets us deal with the largest signed values by treating + // negative results from read unsigned methods as like unsigned values. + // Must re-flip the top bit if the original read value had it set. + return temp xor (raw and (1 shl 31)) + } + + private fun decodeSignedVarintLong(input: ByteArrayInput): Long { + val raw = input.readVarint64(false) + val temp = raw shl 63 shr 63 xor raw shr 1 + // This extra step lets us deal with the largest signed values by treating + // negative results from read unsigned methods as like unsigned values + // Must re-flip the top bit if the original read value had it set. + return temp xor (raw and (1L shl 63)) + + } +} diff --git a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt index 4c3e50583b..aeafb982b3 100644 --- a/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt +++ b/retrofit/src/test/java/retrofit2/KotlinSuspendTest.kt @@ -27,14 +27,12 @@ import okhttp3.mockwebserver.SocketPolicy.DISCONNECT_AFTER_REQUEST import okhttp3.mockwebserver.SocketPolicy.NO_RESPONSE import org.assertj.core.api.Assertions.assertThat import org.junit.Assert.* -import org.junit.Ignore import org.junit.Rule import org.junit.Test import retrofit2.helpers.ToStringConverterFactory import retrofit2.http.GET import retrofit2.http.Path import retrofit2.http.Query -import retrofit2.kotlin.metadata.deserialization.readRawVarint32 import java.io.IOException import java.lang.reflect.ParameterizedType import java.lang.reflect.Type From 25766411503a88b3d39be9c1ba527cd051136e32 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Sat, 16 Oct 2021 14:11:13 +0200 Subject: [PATCH 14/15] Run googleJavaFormat --- .../kotlin/metadata/deserialization/BitEncoding.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java index 9cf78b8101..2382306e64 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/BitEncoding.java @@ -20,10 +20,10 @@ import org.jetbrains.annotations.NotNull; /** - * This file was adapted from https://github.com/JetBrains/kotlin/blob/af18b10da9d1e20b1b35831a3fb5e508048a2576/core/metadata.jvm/src/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java + * This file was adapted from + * https://github.com/JetBrains/kotlin/blob/af18b10da9d1e20b1b35831a3fb5e508048a2576/core/metadata.jvm/src/org/jetbrains/kotlin/metadata/jvm/deserialization/BitEncoding.java * by removing the unused parts. */ - public class BitEncoding { private static final char _8TO7_MODE_MARKER = (char) -1; @@ -36,9 +36,7 @@ private static void addModuloByte(@NotNull byte[] data, int increment) { } } - /** - * Converts encoded array of {@code String} back to a byte array. - */ + /** Converts encoded array of {@code String} back to a byte array. */ @NotNull public static byte[] decodeBytes(@NotNull String[] data) { if (data.length > 0 && !data[0].isEmpty()) { From a8736e3061366b896e3ad3b864c763cb2b9a3ac8 Mon Sep 17 00:00:00 2001 From: Frantisek Nagy Date: Sat, 16 Oct 2021 23:12:36 +0200 Subject: [PATCH 15/15] Document most important methods --- .../src/main/java/retrofit2/KotlinMetadata.kt | 36 +++++++++++++++++++ .../deserialization/MetadataParser.kt | 11 +++--- .../kotlin/metadata/deserialization/Models.kt | 7 +++- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt index 6198343d27..84132f656b 100644 --- a/retrofit/src/main/java/retrofit2/KotlinMetadata.kt +++ b/retrofit/src/main/java/retrofit2/KotlinMetadata.kt @@ -22,6 +22,7 @@ import retrofit2.kotlin.metadata.deserialization.MetadataParser import retrofit2.kotlin.metadata.deserialization.ProtobufReader import java.lang.reflect.Method import java.util.concurrent.ConcurrentHashMap +import kotlin.coroutines.Continuation object KotlinMetadata { @@ -30,6 +31,41 @@ object KotlinMetadata { private val kotlinFunctionsMap = ConcurrentHashMap, List>() + /** + * This helps to parse kotlin metadata of a compiled class to find out the nullability of a suspending method return + * type. + * + * For example a suspending method with following declaration: + * + * ``` + * @GET("/") suspend fun foo(@Query("x") arg: IntArray): String? + * ``` + * + * Will be compiled as a method returning [Object] and with injected [Continuation] argument with following java + * method: + * + * ``` + * public Object foo(int[], Continuation) + * ``` + * + * The information about the return type and its nullability is stored in a [Metadata] annotation of the containing + * class. We process the metadata of a class the first time [isReturnTypeNullable] is called on one of its methods. + * We extract necessary information about all of its methods and store this info in cache, so each class is + * processed only once. Then we try to match the currently inspected [Method] to one extracted from metadata by + * comparing their signatures. + * + * We use the method signature because: + * - it uniquely identifies a method + * - it requires just comparing 2 strings + * - it is already stored in kotlin metadata + * - it is trivial to create one from java reflection's [Method] instance + * + * For example the previous method's signature would be: + * + * ``` + * foo([ILkotlin/coroutines/Continuation;)Ljava/lang/Object; + * ``` + */ @JvmStatic fun isReturnTypeNullable(method: Method): Boolean { if (method.declaringClass.getAnnotation(Metadata::class.java) == null) return false diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt index 48d0840c80..1238674752 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/MetadataParser.kt @@ -17,14 +17,17 @@ package retrofit2.kotlin.metadata.deserialization import retrofit2.KotlinMetadata +/** + * The class metadata is in protobuf format with [StringTableTypes] object followed by [Klass] object. + */ internal class MetadataParser(private val reader: ProtobufReader, private val strings: Array) { fun parse(): List { - val table = StringTableTypes.parse(makeDelimited(reader, true)) - val nameResolver = JvmNameResolver(table, strings) - + val table = StringTableTypes.parse(makeDelimited(reader, tagless = true)) val klass = Klass.parse(reader) + val nameResolver = JvmNameResolver(table, strings) + val functions = mutableListOf() klass.functions.forEach { f -> @@ -38,4 +41,4 @@ internal class MetadataParser(private val reader: ProtobufReader, private val st return functions } -} \ No newline at end of file +} diff --git a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Models.kt b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Models.kt index 06120322b8..9913230311 100644 --- a/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Models.kt +++ b/retrofit/src/main/java/retrofit2/kotlin/metadata/deserialization/Models.kt @@ -103,6 +103,11 @@ internal class Record( } } +/** + * Renamed from `Class` in .proto definition to [Klass] to avoid conflicting with [java.lang.Class]. We only parse the + * info needed to determine nullability of the method's return type and skip other stuff. Thanks to + * the protobuf format we will also be able to skip any new fields added in the future. + */ internal class Klass(val functions: List) { companion object { @@ -243,4 +248,4 @@ private fun readIntoList( mutableList += arrayReader.readInt(ProtoIntegerType.DEFAULT) } } -} \ No newline at end of file +}