From 63bfa004fd1d861dcdece803a82b35c16ed0601f Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 28 Nov 2014 23:24:54 +0300 Subject: [PATCH] Introduce binary representation for annotations Will be used where annotations can't be stored elsewhere: for example, built-ins, JS, type annotations on JDK<8 --- .../src/BuiltInsSerializer.kt | 46 +- compiler/builtins-serializer/src/run.kt | 4 +- .../annotationArguments/annotation.kt | 14 + .../annotationArguments/annotation.txt | 23 + .../serialization/annotationArguments/enum.kt | 18 + .../annotationArguments/enum.txt | 72 + .../annotationArguments/primitiveArrays.kt | 36 + .../annotationArguments/primitiveArrays.txt | 21 + .../annotationArguments/primitives.kt | 24 + .../annotationArguments/primitives.txt | 17 + .../annotationArguments/string.kt | 12 + .../annotationArguments/string.txt | 19 + .../serialization/annotationTargets.kt | 37 + .../serialization/annotationTargets.txt | 27 + .../serialization/BuiltInsSerializerTest.kt | 34 +- .../serialization/DebugBuiltInsProtoBuf.java | 54 +- .../serialization/DebugProtoBuf.java | 3478 ++++++++++++++++- ...aryClassAnnotationAndConstantLoaderImpl.kt | 7 +- .../lang/resolve/constants/ArrayValue.java | 2 + .../BuiltInsAnnotationAndConstantLoader.kt | 68 + .../types/lang/BuiltinsPackageFragment.kt | 6 +- core/serialization/src/builtins.proto | 12 + core/serialization/src/descriptors.proto | 60 +- .../serialization/AnnotationDeserializer.kt | 164 + .../serialization/AnnotationSerializer.kt | 145 + .../serialization/BuiltInsProtoBuf.java | 48 + .../serialization/DescriptorSerializer.java | 2 + .../descriptors/serialization/ProtoBuf.java | 2611 ++++++++++++- .../serialization/SerializerExtension.java | 8 + .../AnnotationAndConstantLoader.java | 53 - 30 files changed, 6958 insertions(+), 164 deletions(-) create mode 100644 compiler/testData/serialization/annotationArguments/annotation.kt create mode 100644 compiler/testData/serialization/annotationArguments/annotation.txt create mode 100644 compiler/testData/serialization/annotationArguments/enum.kt create mode 100644 compiler/testData/serialization/annotationArguments/enum.txt create mode 100644 compiler/testData/serialization/annotationArguments/primitiveArrays.kt create mode 100644 compiler/testData/serialization/annotationArguments/primitiveArrays.txt create mode 100644 compiler/testData/serialization/annotationArguments/primitives.kt create mode 100644 compiler/testData/serialization/annotationArguments/primitives.txt create mode 100644 compiler/testData/serialization/annotationArguments/string.kt create mode 100644 compiler/testData/serialization/annotationArguments/string.txt create mode 100644 compiler/testData/serialization/annotationTargets.kt create mode 100644 compiler/testData/serialization/annotationTargets.txt create mode 100644 core/descriptors/src/org/jetbrains/jet/lang/types/lang/BuiltInsAnnotationAndConstantLoader.kt create mode 100644 core/serialization/src/org/jetbrains/jet/descriptors/serialization/AnnotationDeserializer.kt create mode 100644 core/serialization/src/org/jetbrains/jet/descriptors/serialization/AnnotationSerializer.kt diff --git a/compiler/builtins-serializer/src/BuiltInsSerializer.kt b/compiler/builtins-serializer/src/BuiltInsSerializer.kt index 8b16a6e84a0..b61932e5ea9 100644 --- a/compiler/builtins-serializer/src/BuiltInsSerializer.kt +++ b/compiler/builtins-serializer/src/BuiltInsSerializer.kt @@ -21,7 +21,7 @@ import com.intellij.openapi.util.Disposer import org.jetbrains.jet.config.CompilerConfiguration import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment import org.jetbrains.jet.descriptors.serialization.* -import org.jetbrains.jet.lang.descriptors.ClassDescriptor +import org.jetbrains.jet.lang.descriptors.* import org.jetbrains.jet.lang.resolve.name.Name import java.io.ByteArrayOutputStream import org.jetbrains.jet.lang.types.lang.BuiltInsSerializationUtil @@ -29,7 +29,6 @@ import com.intellij.openapi.Disposable import org.jetbrains.jet.cli.common.CLIConfigurationKeys import org.jetbrains.jet.config.CommonConfigurationKeys import org.jetbrains.jet.cli.common.messages.MessageCollector -import org.jetbrains.jet.lang.descriptors.ModuleDescriptor import org.jetbrains.jet.lang.resolve.name.FqName import org.jetbrains.jet.utils.recursePostOrder import com.intellij.psi.search.GlobalSearchScope @@ -41,9 +40,15 @@ import org.jetbrains.jet.analyzer.ModuleContent import org.jetbrains.jet.lang.resolve.kotlin.DeserializedResolverUtils import org.jetbrains.jet.lang.resolve.scopes.DescriptorKindFilter import org.jetbrains.jet.cli.jvm.compiler.EnvironmentConfigFiles -import org.jetbrains.jet.lang.descriptors.PackageFragmentDescriptor +import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys private object BuiltInsSerializerExtension : SerializerExtension() { + override fun serializeClass(descriptor: ClassDescriptor, proto: ProtoBuf.Class.Builder, stringTable: StringTable) { + for (annotation in descriptor.getAnnotations()) { + proto.addExtension(BuiltInsProtoBuf.classAnnotation, AnnotationSerializer.serializeAnnotation(annotation, stringTable)) + } + } + override fun serializePackage( packageFragments: Collection, proto: ProtoBuf.Package.Builder, @@ -57,16 +62,41 @@ private object BuiltInsSerializerExtension : SerializerExtension() { proto.addExtension(BuiltInsProtoBuf.className, stringTable.getSimpleNameIndex(descriptor.getName())) } } + + override fun serializeCallable( + callable: CallableMemberDescriptor, + proto: ProtoBuf.Callable.Builder, + stringTable: StringTable + ) { + for (annotation in callable.getAnnotations()) { + proto.addExtension(BuiltInsProtoBuf.callableAnnotation, AnnotationSerializer.serializeAnnotation(annotation, stringTable)) + } + } + + override fun serializeValueParameter( + descriptor: ValueParameterDescriptor, + proto: ProtoBuf.Callable.ValueParameter.Builder, + stringTable: StringTable + ) { + for (annotation in descriptor.getAnnotations()) { + proto.addExtension(BuiltInsProtoBuf.parameterAnnotation, AnnotationSerializer.serializeAnnotation(annotation, stringTable)) + } + } } public class BuiltInsSerializer(private val dependOnOldBuiltIns: Boolean) { private var totalSize = 0 private var totalFiles = 0 - public fun serialize(destDir: File, srcDirs: Collection, onComplete: (totalSize: Int, totalFiles: Int) -> Unit) { + public fun serialize( + destDir: File, + srcDirs: Collection, + extraClassPath: Collection, + onComplete: (totalSize: Int, totalFiles: Int) -> Unit + ) { val rootDisposable = Disposer.newDisposable() try { - serialize(rootDisposable, destDir, srcDirs) + serialize(rootDisposable, destDir, srcDirs, extraClassPath) onComplete(totalSize, totalFiles) } finally { @@ -81,13 +111,17 @@ public class BuiltInsSerializer(private val dependOnOldBuiltIns: Boolean) { if (dependOnOldBuiltIns) ModuleInfo.DependenciesOnBuiltins.LAST else ModuleInfo.DependenciesOnBuiltins.NONE } - fun serialize(disposable: Disposable, destDir: File, srcDirs: Collection) { + fun serialize(disposable: Disposable, destDir: File, srcDirs: Collection, extraClassPath: Collection) { val configuration = CompilerConfiguration() configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE) val sourceRoots = srcDirs map { it.path } configuration.put(CommonConfigurationKeys.SOURCE_ROOTS_KEY, sourceRoots) + for (path in extraClassPath) { + configuration.add(JVMConfigurationKeys.CLASSPATH_KEY, path) + } + val environment = JetCoreEnvironment.createForTests(disposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES) val files = environment.getSourceFiles() diff --git a/compiler/builtins-serializer/src/run.kt b/compiler/builtins-serializer/src/run.kt index bcb8706880c..8232bea6a48 100644 --- a/compiler/builtins-serializer/src/run.kt +++ b/compiler/builtins-serializer/src/run.kt @@ -21,7 +21,7 @@ import java.io.File fun main(args: Array) { System.setProperty("java.awt.headless", "true") - if (args.size < 2) { + if (args.size() < 2) { println( """Kotlin built-ins serializer @@ -42,7 +42,7 @@ found top-level declarations to (files such as val missing = srcDirs filterNot { it.exists() } assert(missing.isEmpty()) { "These source directories are missing: $missing" } - BuiltInsSerializer(dependOnOldBuiltIns = false).serialize(destDir, srcDirs) { (totalSize, totalFiles) -> + BuiltInsSerializer(dependOnOldBuiltIns = false).serialize(destDir, srcDirs, listOf()) { (totalSize, totalFiles) -> println("Total bytes written: $totalSize to $totalFiles files") } } diff --git a/compiler/testData/serialization/annotationArguments/annotation.kt b/compiler/testData/serialization/annotationArguments/annotation.kt new file mode 100644 index 00000000000..052a4c82d38 --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/annotation.kt @@ -0,0 +1,14 @@ +package test + +annotation class Empty + +annotation class JustAnnotation(val annotation: Empty) + +annotation class AnnotationArray(val annotationArray: Array) + +JustAnnotation(Empty()) +AnnotationArray(array()) +class C1 + +AnnotationArray(array(JustAnnotation(Empty()), JustAnnotation(Empty()))) +class C2 diff --git a/compiler/testData/serialization/annotationArguments/annotation.txt b/compiler/testData/serialization/annotationArguments/annotation.txt new file mode 100644 index 00000000000..21a09b7ba85 --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/annotation.txt @@ -0,0 +1,23 @@ +package test + +internal final annotation class AnnotationArray : kotlin.Annotation { + public constructor AnnotationArray(/*0*/ annotationArray: kotlin.Array) + internal final val annotationArray: kotlin.Array +} + +test.JustAnnotation(annotation = test.Empty(): test.Empty) test.AnnotationArray(annotationArray = {}: kotlin.Array) internal final class C1 { + public constructor C1() +} + +test.AnnotationArray(annotationArray = {test.JustAnnotation(annotation = test.Empty(): test.Empty), test.JustAnnotation(annotation = test.Empty(): test.Empty)}: kotlin.Array) internal final class C2 { + public constructor C2() +} + +internal final annotation class Empty : kotlin.Annotation { + public constructor Empty() +} + +internal final annotation class JustAnnotation : kotlin.Annotation { + public constructor JustAnnotation(/*0*/ annotation: test.Empty) + internal final val annotation: test.Empty +} diff --git a/compiler/testData/serialization/annotationArguments/enum.kt b/compiler/testData/serialization/annotationArguments/enum.kt new file mode 100644 index 00000000000..eb8163fcdac --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/enum.kt @@ -0,0 +1,18 @@ +package test + +enum class Weapon { + ROCK + PAPER + SCISSORS +} + +annotation class JustEnum(val weapon: Weapon) + +annotation class EnumArray(val enumArray: Array) + +JustEnum(Weapon.SCISSORS) +EnumArray(array()) +class C1 + +EnumArray(array(Weapon.PAPER, Weapon.ROCK)) +class C2 diff --git a/compiler/testData/serialization/annotationArguments/enum.txt b/compiler/testData/serialization/annotationArguments/enum.txt new file mode 100644 index 00000000000..124ddd9c61a --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/enum.txt @@ -0,0 +1,72 @@ +package test + +test.JustEnum(weapon = Weapon.SCISSORS: test.Weapon) test.EnumArray(enumArray = {}: kotlin.Array) internal final class C1 { + public constructor C1() +} + +test.EnumArray(enumArray = {Weapon.PAPER, Weapon.ROCK}: kotlin.Array) internal final class C2 { + public constructor C2() +} + +internal final annotation class EnumArray : kotlin.Annotation { + public constructor EnumArray(/*0*/ enumArray: kotlin.Array) + internal final val enumArray: kotlin.Array +} + +internal final annotation class JustEnum : kotlin.Annotation { + public constructor JustEnum(/*0*/ weapon: test.Weapon) + internal final val weapon: test.Weapon +} + +internal final enum class Weapon : kotlin.Enum { + public enum entry ROCK : test.Weapon { + private constructor ROCK() + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.Weapon): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + + public class object : test.Weapon.ROCK { + private constructor () + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.Weapon): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + } + } + + public enum entry PAPER : test.Weapon { + private constructor PAPER() + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.Weapon): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + + public class object : test.Weapon.PAPER { + private constructor () + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.Weapon): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + } + } + + public enum entry SCISSORS : test.Weapon { + private constructor SCISSORS() + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.Weapon): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + + public class object : test.Weapon.SCISSORS { + private constructor () + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.Weapon): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + } + } + + private constructor Weapon() + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.Weapon): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + + // Static members + public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.Weapon + public final /*synthesized*/ fun values(): kotlin.Array +} diff --git a/compiler/testData/serialization/annotationArguments/primitiveArrays.kt b/compiler/testData/serialization/annotationArguments/primitiveArrays.kt new file mode 100644 index 00000000000..d2381182aa1 --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/primitiveArrays.kt @@ -0,0 +1,36 @@ +package test + +annotation class PrimitiveArrays( + val byteArray: ByteArray + val charArray: CharArray, + val shortArray: ShortArray, + val intArray: IntArray, + val longArray: LongArray, + val floatArray: FloatArray, + val doubleArray: DoubleArray, + val booleanArray: BooleanArray +) + +PrimitiveArrays( + byteArray = byteArray(-7, 7), + charArray = charArray('%', 'z'), + shortArray = shortArray(239), + intArray = intArray(239017, -1), + longArray = longArray(123456789123456789L), + floatArray = floatArray(2.72f, 0f), + doubleArray = doubleArray(-3.14), + booleanArray = booleanArray(true, false, true) +) +class C1 + +PrimitiveArrays( + byteArray = byteArray(), + charArray = charArray(), + shortArray = shortArray(), + intArray = intArray(), + longArray = longArray(), + floatArray = floatArray(), + doubleArray = doubleArray(), + booleanArray = booleanArray() +) +class C2 diff --git a/compiler/testData/serialization/annotationArguments/primitiveArrays.txt b/compiler/testData/serialization/annotationArguments/primitiveArrays.txt new file mode 100644 index 00000000000..05d523cf1ff --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/primitiveArrays.txt @@ -0,0 +1,21 @@ +package test + +test.PrimitiveArrays(booleanArray = {true, false, true}: kotlin.BooleanArray, byteArray = {-7.toByte(), 7.toByte()}: kotlin.ByteArray, charArray = {\u0025 ('%'), \u007A ('z')}: kotlin.CharArray, doubleArray = {-3.14.toDouble()}: kotlin.DoubleArray, floatArray = {2.72.toFloat(), 0.0.toFloat()}: kotlin.FloatArray, intArray = {239017, -1}: kotlin.IntArray, longArray = {123456789123456789.toLong()}: kotlin.LongArray, shortArray = {239.toShort()}: kotlin.ShortArray) internal final class C1 { + public constructor C1() +} + +test.PrimitiveArrays(booleanArray = {}: kotlin.BooleanArray, byteArray = {}: kotlin.ByteArray, charArray = {}: kotlin.CharArray, doubleArray = {}: kotlin.DoubleArray, floatArray = {}: kotlin.FloatArray, intArray = {}: kotlin.IntArray, longArray = {}: kotlin.LongArray, shortArray = {}: kotlin.ShortArray) internal final class C2 { + public constructor C2() +} + +internal final annotation class PrimitiveArrays : kotlin.Annotation { + public constructor PrimitiveArrays(/*0*/ byteArray: kotlin.ByteArray, /*1*/ charArray: kotlin.CharArray, /*2*/ shortArray: kotlin.ShortArray, /*3*/ intArray: kotlin.IntArray, /*4*/ longArray: kotlin.LongArray, /*5*/ floatArray: kotlin.FloatArray, /*6*/ doubleArray: kotlin.DoubleArray, /*7*/ booleanArray: kotlin.BooleanArray) + internal final val booleanArray: kotlin.BooleanArray + internal final val byteArray: kotlin.ByteArray + internal final val charArray: kotlin.CharArray + internal final val doubleArray: kotlin.DoubleArray + internal final val floatArray: kotlin.FloatArray + internal final val intArray: kotlin.IntArray + internal final val longArray: kotlin.LongArray + internal final val shortArray: kotlin.ShortArray +} diff --git a/compiler/testData/serialization/annotationArguments/primitives.kt b/compiler/testData/serialization/annotationArguments/primitives.kt new file mode 100644 index 00000000000..f2a51dec0d1 --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/primitives.kt @@ -0,0 +1,24 @@ +package test + +annotation class Primitives( + val byte: Byte, + val char: Char, + val short: Short, + val int: Int, + val long: Long, + val float: Float, + val double: Double, + val boolean: Boolean +) + +Primitives( + byte = 7, + char = '%', + short = 239, + int = 239017, + long = 123456789123456789L, + float = 2.72f, + double = -3.14, + boolean = true +) +class C diff --git a/compiler/testData/serialization/annotationArguments/primitives.txt b/compiler/testData/serialization/annotationArguments/primitives.txt new file mode 100644 index 00000000000..3bfc157328b --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/primitives.txt @@ -0,0 +1,17 @@ +package test + +test.Primitives(boolean = true: kotlin.Boolean, byte = 7.toByte(): kotlin.Byte, char = \u0025 ('%'): kotlin.Char, double = -3.14.toDouble(): kotlin.Double, float = 2.72.toFloat(): kotlin.Float, int = 239017: kotlin.Int, long = 123456789123456789.toLong(): kotlin.Long, short = 239.toShort(): kotlin.Short) internal final class C { + public constructor C() +} + +internal final annotation class Primitives : kotlin.Annotation { + public constructor Primitives(/*0*/ byte: kotlin.Byte, /*1*/ char: kotlin.Char, /*2*/ short: kotlin.Short, /*3*/ int: kotlin.Int, /*4*/ long: kotlin.Long, /*5*/ float: kotlin.Float, /*6*/ double: kotlin.Double, /*7*/ boolean: kotlin.Boolean) + internal final val boolean: kotlin.Boolean + internal final val byte: kotlin.Byte + internal final val char: kotlin.Char + internal final val double: kotlin.Double + internal final val float: kotlin.Float + internal final val int: kotlin.Int + internal final val long: kotlin.Long + internal final val short: kotlin.Short +} diff --git a/compiler/testData/serialization/annotationArguments/string.kt b/compiler/testData/serialization/annotationArguments/string.kt new file mode 100644 index 00000000000..68ad6a1ab51 --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/string.kt @@ -0,0 +1,12 @@ +package test + +annotation class JustString(val string: String) + +annotation class StringArray(val stringArray: Array) + +JustString("kotlin") +StringArray(array()) +class C1 + +StringArray(array("java", "")) +class C2 diff --git a/compiler/testData/serialization/annotationArguments/string.txt b/compiler/testData/serialization/annotationArguments/string.txt new file mode 100644 index 00000000000..e63e087ebb1 --- /dev/null +++ b/compiler/testData/serialization/annotationArguments/string.txt @@ -0,0 +1,19 @@ +package test + +test.JustString(string = "kotlin": kotlin.String) test.StringArray(stringArray = {}: kotlin.Array) internal final class C1 { + public constructor C1() +} + +test.StringArray(stringArray = {"java", ""}: kotlin.Array) internal final class C2 { + public constructor C2() +} + +internal final annotation class JustString : kotlin.Annotation { + public constructor JustString(/*0*/ string: kotlin.String) + internal final val string: kotlin.String +} + +internal final annotation class StringArray : kotlin.Annotation { + public constructor StringArray(/*0*/ stringArray: kotlin.Array) + internal final val stringArray: kotlin.Array +} diff --git a/compiler/testData/serialization/annotationTargets.kt b/compiler/testData/serialization/annotationTargets.kt new file mode 100644 index 00000000000..8073f7d9a10 --- /dev/null +++ b/compiler/testData/serialization/annotationTargets.kt @@ -0,0 +1,37 @@ +package test + +annotation class anno(val x: String) + + +anno("top level function") +fun f1(anno("top level function parameter") p: Int) {} + +anno("top level property") +val p1 = null + +anno("extension function") +fun Long.f2(anno("extension function parameter") p: Int) {} + +anno("extension property") +val Double.p2: Double get() = null + +anno("top level class") +class C1 [anno("constructor")] () { + anno("member function") + fun f3(anno("member function parameter") p: Int) {} + + anno("member property") + val p3 = null + + anno("member extension function") + fun String.f4() {} + + anno("member extension property") + val Int.v4: Int get() = this + + anno("nested class") + class C2 + + anno("class object") + class object {} +} diff --git a/compiler/testData/serialization/annotationTargets.txt b/compiler/testData/serialization/annotationTargets.txt new file mode 100644 index 00000000000..f00aded30e4 --- /dev/null +++ b/compiler/testData/serialization/annotationTargets.txt @@ -0,0 +1,27 @@ +package test + +test.anno(x = "top level property": kotlin.String) internal val p1: kotlin.Nothing? +test.anno(x = "extension property": kotlin.String) internal val kotlin.Double.p2: kotlin.Double +test.anno(x = "top level function": kotlin.String) internal fun f1(/*0*/ test.anno(x = "top level function parameter": kotlin.String) p: kotlin.Int): kotlin.Unit +test.anno(x = "extension function": kotlin.String) internal fun kotlin.Long.f2(/*0*/ test.anno(x = "extension function parameter": kotlin.String) p: kotlin.Int): kotlin.Unit + +test.anno(x = "top level class": kotlin.String) internal final class C1 { + test.anno(x = "constructor": kotlin.String) public constructor C1() + test.anno(x = "member property": kotlin.String) internal final val p3: kotlin.Nothing? + test.anno(x = "member extension property": kotlin.String) internal final val kotlin.Int.v4: kotlin.Int + test.anno(x = "member function": kotlin.String) internal final fun f3(/*0*/ test.anno(x = "member function parameter": kotlin.String) p: kotlin.Int): kotlin.Unit + test.anno(x = "member extension function": kotlin.String) internal final fun kotlin.String.f4(): kotlin.Unit + + test.anno(x = "class object": kotlin.String) internal class object { + private constructor () + } + + test.anno(x = "nested class": kotlin.String) internal final class C2 { + public constructor C2() + } +} + +internal final annotation class anno : kotlin.Annotation { + public constructor anno(/*0*/ x: kotlin.String) + internal final val x: kotlin.String +} diff --git a/compiler/tests/org/jetbrains/jet/descriptors/serialization/BuiltInsSerializerTest.kt b/compiler/tests/org/jetbrains/jet/descriptors/serialization/BuiltInsSerializerTest.kt index 9016f95778f..fea639563b9 100644 --- a/compiler/tests/org/jetbrains/jet/descriptors/serialization/BuiltInsSerializerTest.kt +++ b/compiler/tests/org/jetbrains/jet/descriptors/serialization/BuiltInsSerializerTest.kt @@ -26,20 +26,24 @@ import org.jetbrains.jet.JetTestUtils import java.io.FileInputStream import org.jetbrains.jet.test.util.RecursiveDescriptorComparator import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns +import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime public class BuiltInsSerializerTest : TestCaseWithTmpdir() { private fun doTest(fileName: String) { val source = "compiler/testData/serialization/$fileName" BuiltInsSerializer(dependOnOldBuiltIns = true).serialize( tmpdir, - listOf(File(source)), - { totalSize, totalFiles -> } + srcDirs = listOf(File(source)), + extraClassPath = listOf(ForTestCompileRuntime.runtimeJarForTests()), + onComplete = { totalSize, totalFiles -> } ) val module = JetTestUtils.createEmptyModule("") val packageFragment = BuiltinsPackageFragment(TEST_PACKAGE_FQNAME, LockBasedStorageManager(), module) { - path -> FileInputStream(File(tmpdir, path)) + path -> + val file = File(tmpdir, path) + if (file.exists()) FileInputStream(file) else null } module.initialize(packageFragment.provider) @@ -57,4 +61,28 @@ public class BuiltInsSerializerTest : TestCaseWithTmpdir() { fun testSimple() { doTest("simple.kt") } + + fun testAnnotationTargets() { + doTest("annotationTargets.kt") + } + + fun testPrimitives() { + doTest("annotationArguments/primitives.kt") + } + + fun testPrimitiveArrays() { + doTest("annotationArguments/primitiveArrays.kt") + } + + fun testString() { + doTest("annotationArguments/string.kt") + } + + fun testAnnotation() { + doTest("annotationArguments/annotation.kt") + } + + fun testEnum() { + doTest("annotationArguments/enum.kt") + } } diff --git a/compiler/tests/org/jetbrains/jet/descriptors/serialization/DebugBuiltInsProtoBuf.java b/compiler/tests/org/jetbrains/jet/descriptors/serialization/DebugBuiltInsProtoBuf.java index 079b1a4c9cb..afa75b3cc80 100644 --- a/compiler/tests/org/jetbrains/jet/descriptors/serialization/DebugBuiltInsProtoBuf.java +++ b/compiler/tests/org/jetbrains/jet/descriptors/serialization/DebugBuiltInsProtoBuf.java @@ -8,6 +8,9 @@ public final class DebugBuiltInsProtoBuf { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registry.add(org.jetbrains.jet.descriptors.serialization.DebugBuiltInsProtoBuf.className); + registry.add(org.jetbrains.jet.descriptors.serialization.DebugBuiltInsProtoBuf.classAnnotation); + registry.add(org.jetbrains.jet.descriptors.serialization.DebugBuiltInsProtoBuf.callableAnnotation); + registry.add(org.jetbrains.jet.descriptors.serialization.DebugBuiltInsProtoBuf.parameterAnnotation); } public static final int CLASS_NAME_FIELD_NUMBER = 150; /** @@ -20,6 +23,39 @@ public final class DebugBuiltInsProtoBuf { .newFileScopedGeneratedExtension( java.lang.Integer.class, null); + public static final int CLASS_ANNOTATION_FIELD_NUMBER = 150; + /** + * extend .org.jetbrains.jet.descriptors.serialization.Class { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Class, + java.util.List> classAnnotation = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.class, + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance()); + public static final int CALLABLE_ANNOTATION_FIELD_NUMBER = 150; + /** + * extend .org.jetbrains.jet.descriptors.serialization.Callable { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Callable, + java.util.List> callableAnnotation = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.class, + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance()); + public static final int PARAMETER_ANNOTATION_FIELD_NUMBER = 150; + /** + * extend .org.jetbrains.jet.descriptors.serialization.Callable.ValueParameter { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Callable.ValueParameter, + java.util.List> parameterAnnotation = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.class, + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance()); public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -34,8 +70,19 @@ public final class DebugBuiltInsProtoBuf { "ialization\032.core/serialization/src/descr" + "iptors.debug.proto:M\n\nclass_name\0224.org.j" + "etbrains.jet.descriptors.serialization.P" + - "ackage\030\226\001 \003(\005B\002\020\001B\027B\025DebugBuiltInsProtoB" + - "uf" + "ackage\030\226\001 \003(\005B\002\020\001:\206\001\n\020class_annotation\0222" + + ".org.jetbrains.jet.descriptors.serializa" + + "tion.Class\030\226\001 \003(\01327.org.jetbrains.jet.de" + + "scriptors.serialization.Annotation:\214\001\n\023c" + + "allable_annotation\0225.org.jetbrains.jet.d", + "escriptors.serialization.Callable\030\226\001 \003(\013" + + "27.org.jetbrains.jet.descriptors.seriali" + + "zation.Annotation:\234\001\n\024parameter_annotati" + + "on\022D.org.jetbrains.jet.descriptors.seria" + + "lization.Callable.ValueParameter\030\226\001 \003(\0132" + + "7.org.jetbrains.jet.descriptors.serializ" + + "ation.AnnotationB\027B\025DebugBuiltInsProtoBu" + + "f" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -43,6 +90,9 @@ public final class DebugBuiltInsProtoBuf { com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; className.internalInit(descriptor.getExtensions().get(0)); + classAnnotation.internalInit(descriptor.getExtensions().get(1)); + callableAnnotation.internalInit(descriptor.getExtensions().get(2)); + parameterAnnotation.internalInit(descriptor.getExtensions().get(3)); return null; } }; diff --git a/compiler/tests/org/jetbrains/jet/descriptors/serialization/DebugProtoBuf.java b/compiler/tests/org/jetbrains/jet/descriptors/serialization/DebugProtoBuf.java index be8f708b5ea..7e99d8958d8 100644 --- a/compiler/tests/org/jetbrains/jet/descriptors/serialization/DebugProtoBuf.java +++ b/compiler/tests/org/jetbrains/jet/descriptors/serialization/DebugProtoBuf.java @@ -2104,6 +2104,3254 @@ public final class DebugProtoBuf { // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.QualifiedNameTable) } + public interface AnnotationOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required int32 id = 1; + /** + * required int32 id = 1; + * + *
+     * Class FQ name id
+     * 
+ */ + boolean hasId(); + /** + * required int32 id = 1; + * + *
+     * Class FQ name id
+     * 
+ */ + int getId(); + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + java.util.List + getArgumentList(); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument getArgument(int index); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + int getArgumentCount(); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + java.util.List + getArgumentOrBuilderList(); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.ArgumentOrBuilder getArgumentOrBuilder( + int index); + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation} + */ + public static final class Annotation extends + com.google.protobuf.GeneratedMessage + implements AnnotationOrBuilder { + // Use Annotation.newBuilder() to construct. + private Annotation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Annotation(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Annotation defaultInstance; + public static Annotation getDefaultInstance() { + return defaultInstance; + } + + public Annotation getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.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.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + 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.jet.descriptors.serialization.DebugProtoBuf.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_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.class, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + 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 com.google.protobuf.MessageOrBuilder { + + // required int32 name_id = 1; + /** + * required int32 name_id = 1; + * + *
+       * id in StringTable
+       * 
+ */ + boolean hasNameId(); + /** + * required int32 name_id = 1; + * + *
+       * id in StringTable
+       * 
+ */ + int getNameId(); + + // required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + boolean hasValue(); + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value getValue(); + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder getValueOrBuilder(); + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation.Argument} + */ + public static final class Argument extends + com.google.protobuf.GeneratedMessage + implements ArgumentOrBuilder { + // Use Argument.newBuilder() to construct. + private Argument(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Argument(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Argument defaultInstance; + public static Argument getDefaultInstance() { + return defaultInstance; + } + + public Argument getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Argument( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + nameId_ = input.readInt32(); + break; + } + case 18: { + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = value_.toBuilder(); + } + value_ = input.readMessage(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.class, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder.class); + } + + 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; + } + + public interface ValueOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value.Type type = 1; + /** + * optional .org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type getType(); + + // optional sint64 int_value = 2; + /** + * optional sint64 int_value = 2; + */ + boolean hasIntValue(); + /** + * optional sint64 int_value = 2; + */ + long getIntValue(); + + // optional float float_value = 3; + /** + * optional float float_value = 3; + */ + boolean hasFloatValue(); + /** + * optional float float_value = 3; + */ + float getFloatValue(); + + // optional double double_value = 4; + /** + * optional double double_value = 4; + */ + boolean hasDoubleValue(); + /** + * optional double double_value = 4; + */ + double getDoubleValue(); + + // optional int32 string_value = 5; + /** + * optional int32 string_value = 5; + * + *
+         * id in StringTable
+         * 
+ */ + boolean hasStringValue(); + /** + * optional int32 string_value = 5; + * + *
+         * id in StringTable
+         * 
+ */ + int getStringValue(); + + // optional int32 class_id = 6; + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+         * 
+ */ + boolean hasClassId(); + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+         * 
+ */ + int getClassId(); + + // optional int32 enum_value_id = 7; + /** + * optional int32 enum_value_id = 7; + * + *
+         * id in StringTable
+         * 
+ */ + boolean hasEnumValueId(); + /** + * optional int32 enum_value_id = 7; + * + *
+         * id in StringTable
+         * 
+ */ + int getEnumValueId(); + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + boolean hasAnnotation(); + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation getAnnotation(); + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder(); + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + java.util.List + getArrayElementList(); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value getArrayElement(int index); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + int getArrayElementCount(); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + java.util.List + getArrayElementOrBuilderList(); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder getArrayElementOrBuilder( + int index); + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value} + */ + public static final class Value extends + com.google.protobuf.GeneratedMessage + implements ValueOrBuilder { + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Value(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Value defaultInstance; + public static Value getDefaultInstance() { + return defaultInstance; + } + + public Value getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.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.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type value = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, 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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = annotation_.toBuilder(); + } + annotation_ = input.readMessage(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.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_ & 0x00000100) == 0x00000100)) { + arrayElement_ = java.util.Collections.unmodifiableList(arrayElement_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.class, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + 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.jet.descriptors.serialization.Annotation.Argument.Value.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + * 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; + + + 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() { + public Type findValueByNumber(int number) { + return Type.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private Type(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value.Type) + } + + private int bitField0_; + // optional .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value.Type type = 1; + public static final int TYPE_FIELD_NUMBER = 1; + private org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type type_; + /** + * optional .org.jetbrains.jet.descriptors.serialization.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 boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.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 org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type getType() { + return type_; + } + + // optional sint64 int_value = 2; + public static final int INT_VALUE_FIELD_NUMBER = 2; + private long intValue_; + /** + * optional sint64 int_value = 2; + */ + public boolean hasIntValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional sint64 int_value = 2; + */ + public long getIntValue() { + return intValue_; + } + + // optional float float_value = 3; + public static final int FLOAT_VALUE_FIELD_NUMBER = 3; + private float floatValue_; + /** + * optional float float_value = 3; + */ + public boolean hasFloatValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional float float_value = 3; + */ + public float getFloatValue() { + return floatValue_; + } + + // optional double double_value = 4; + public static final int DOUBLE_VALUE_FIELD_NUMBER = 4; + private double doubleValue_; + /** + * optional double double_value = 4; + */ + public boolean hasDoubleValue() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional double double_value = 4; + */ + public double getDoubleValue() { + return doubleValue_; + } + + // optional int32 string_value = 5; + public static final int STRING_VALUE_FIELD_NUMBER = 5; + private int stringValue_; + /** + * optional int32 string_value = 5; + * + *
+         * id in StringTable
+         * 
+ */ + public boolean hasStringValue() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 string_value = 5; + * + *
+         * id in StringTable
+         * 
+ */ + public int getStringValue() { + return stringValue_; + } + + // optional int32 class_id = 6; + public static final int CLASS_ID_FIELD_NUMBER = 6; + private int classId_; + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+         * 
+ */ + public boolean hasClassId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+         * 
+ */ + public int getClassId() { + return classId_; + } + + // optional int32 enum_value_id = 7; + public static final int ENUM_VALUE_ID_FIELD_NUMBER = 7; + private int enumValueId_; + /** + * optional int32 enum_value_id = 7; + * + *
+         * id in StringTable
+         * 
+ */ + public boolean hasEnumValueId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 enum_value_id = 7; + * + *
+         * id in StringTable
+         * 
+ */ + public int getEnumValueId() { + return enumValueId_; + } + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + public static final int ANNOTATION_FIELD_NUMBER = 8; + private org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation annotation_; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public boolean hasAnnotation() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation getAnnotation() { + return annotation_; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder() { + return annotation_; + } + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + public static final int ARRAY_ELEMENT_FIELD_NUMBER = 9; + private java.util.List arrayElement_; + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public java.util.List getArrayElementList() { + return arrayElement_; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public java.util.List + getArrayElementOrBuilderList() { + return arrayElement_; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public int getArrayElementCount() { + return arrayElement_.size(); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value getArrayElement(int index) { + return arrayElement_.get(index); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder getArrayElementOrBuilder( + int index) { + return arrayElement_.get(index); + } + + private void initFields() { + type_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type.BYTE; + intValue_ = 0L; + floatValue_ = 0F; + doubleValue_ = 0D; + stringValue_ = 0; + classId_ = 0; + enumValueId_ = 0; + annotation_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance(); + arrayElement_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + 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; + } + + 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)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .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)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.class, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder.class); + } + + // Construct using org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getAnnotationFieldBuilder(); + getArrayElementFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + type_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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); + if (annotationBuilder_ == null) { + annotation_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance(); + } else { + annotationBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + if (arrayElementBuilder_ == null) { + arrayElement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + } else { + arrayElementBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_descriptor; + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value getDefaultInstanceForType() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value build() { + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value buildPartial() { + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value result = new org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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; + } + if (annotationBuilder_ == null) { + result.annotation_ = annotation_; + } else { + result.annotation_ = annotationBuilder_.build(); + } + if (arrayElementBuilder_ == null) { + if (((bitField0_ & 0x00000100) == 0x00000100)) { + arrayElement_ = java.util.Collections.unmodifiableList(arrayElement_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.arrayElement_ = arrayElement_; + } else { + result.arrayElement_ = arrayElementBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value) { + return mergeFrom((org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value other) { + if (other == org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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 (arrayElementBuilder_ == null) { + if (!other.arrayElement_.isEmpty()) { + if (arrayElement_.isEmpty()) { + arrayElement_ = other.arrayElement_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureArrayElementIsMutable(); + arrayElement_.addAll(other.arrayElement_); + } + onChanged(); + } + } else { + if (!other.arrayElement_.isEmpty()) { + if (arrayElementBuilder_.isEmpty()) { + arrayElementBuilder_.dispose(); + arrayElementBuilder_ = null; + arrayElement_ = other.arrayElement_; + bitField0_ = (bitField0_ & ~0x00000100); + arrayElementBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getArrayElementFieldBuilder() : null; + } else { + arrayElementBuilder_.addAllMessages(other.arrayElement_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + 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; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value.Type type = 1; + private org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type type_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type.BYTE; + /** + * optional .org.jetbrains.jet.descriptors.serialization.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 boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.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 org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type getType() { + return type_; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value; + onChanged(); + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Type.BYTE; + onChanged(); + return this; + } + + // optional sint64 int_value = 2; + private long intValue_ ; + /** + * optional sint64 int_value = 2; + */ + public boolean hasIntValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional sint64 int_value = 2; + */ + public long getIntValue() { + return intValue_; + } + /** + * optional sint64 int_value = 2; + */ + public Builder setIntValue(long value) { + bitField0_ |= 0x00000002; + intValue_ = value; + onChanged(); + return this; + } + /** + * optional sint64 int_value = 2; + */ + public Builder clearIntValue() { + bitField0_ = (bitField0_ & ~0x00000002); + intValue_ = 0L; + onChanged(); + return this; + } + + // optional float float_value = 3; + private float floatValue_ ; + /** + * optional float float_value = 3; + */ + public boolean hasFloatValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional float float_value = 3; + */ + public float getFloatValue() { + return floatValue_; + } + /** + * optional float float_value = 3; + */ + public Builder setFloatValue(float value) { + bitField0_ |= 0x00000004; + floatValue_ = value; + onChanged(); + return this; + } + /** + * optional float float_value = 3; + */ + public Builder clearFloatValue() { + bitField0_ = (bitField0_ & ~0x00000004); + floatValue_ = 0F; + onChanged(); + return this; + } + + // optional double double_value = 4; + private double doubleValue_ ; + /** + * optional double double_value = 4; + */ + public boolean hasDoubleValue() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional double double_value = 4; + */ + public double getDoubleValue() { + return doubleValue_; + } + /** + * optional double double_value = 4; + */ + public Builder setDoubleValue(double value) { + bitField0_ |= 0x00000008; + doubleValue_ = value; + onChanged(); + return this; + } + /** + * optional double double_value = 4; + */ + public Builder clearDoubleValue() { + bitField0_ = (bitField0_ & ~0x00000008); + doubleValue_ = 0D; + onChanged(); + return this; + } + + // optional int32 string_value = 5; + private int stringValue_ ; + /** + * optional int32 string_value = 5; + * + *
+           * id in StringTable
+           * 
+ */ + public boolean hasStringValue() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 string_value = 5; + * + *
+           * id in StringTable
+           * 
+ */ + public int getStringValue() { + return stringValue_; + } + /** + * optional int32 string_value = 5; + * + *
+           * id in StringTable
+           * 
+ */ + public Builder setStringValue(int value) { + bitField0_ |= 0x00000010; + stringValue_ = value; + onChanged(); + return this; + } + /** + * optional int32 string_value = 5; + * + *
+           * id in StringTable
+           * 
+ */ + public Builder clearStringValue() { + bitField0_ = (bitField0_ & ~0x00000010); + stringValue_ = 0; + onChanged(); + return this; + } + + // optional int32 class_id = 6; + private int classId_ ; + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+           * 
+ */ + public boolean hasClassId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+           * 
+ */ + public int getClassId() { + return classId_; + } + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+           * 
+ */ + public Builder setClassId(int value) { + bitField0_ |= 0x00000020; + classId_ = value; + onChanged(); + return this; + } + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+           * 
+ */ + public Builder clearClassId() { + bitField0_ = (bitField0_ & ~0x00000020); + classId_ = 0; + onChanged(); + return this; + } + + // optional int32 enum_value_id = 7; + private int enumValueId_ ; + /** + * optional int32 enum_value_id = 7; + * + *
+           * id in StringTable
+           * 
+ */ + public boolean hasEnumValueId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 enum_value_id = 7; + * + *
+           * id in StringTable
+           * 
+ */ + public int getEnumValueId() { + return enumValueId_; + } + /** + * optional int32 enum_value_id = 7; + * + *
+           * id in StringTable
+           * 
+ */ + public Builder setEnumValueId(int value) { + bitField0_ |= 0x00000040; + enumValueId_ = value; + onChanged(); + return this; + } + /** + * optional int32 enum_value_id = 7; + * + *
+           * id in StringTable
+           * 
+ */ + public Builder clearEnumValueId() { + bitField0_ = (bitField0_ & ~0x00000040); + enumValueId_ = 0; + onChanged(); + return this; + } + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + private org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation annotation_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.AnnotationOrBuilder> annotationBuilder_; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public boolean hasAnnotation() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation getAnnotation() { + if (annotationBuilder_ == null) { + return annotation_; + } else { + return annotationBuilder_.getMessage(); + } + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public Builder setAnnotation(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation value) { + if (annotationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + annotation_ = value; + onChanged(); + } else { + annotationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public Builder setAnnotation( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Builder builderForValue) { + if (annotationBuilder_ == null) { + annotation_ = builderForValue.build(); + onChanged(); + } else { + annotationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public Builder mergeAnnotation(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation value) { + if (annotationBuilder_ == null) { + if (((bitField0_ & 0x00000080) == 0x00000080) && + annotation_ != org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance()) { + annotation_ = + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.newBuilder(annotation_).mergeFrom(value).buildPartial(); + } else { + annotation_ = value; + } + onChanged(); + } else { + annotationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public Builder clearAnnotation() { + if (annotationBuilder_ == null) { + annotation_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance(); + onChanged(); + } else { + annotationBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Builder getAnnotationBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getAnnotationFieldBuilder().getBuilder(); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder() { + if (annotationBuilder_ != null) { + return annotationBuilder_.getMessageOrBuilder(); + } else { + return annotation_; + } + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.AnnotationOrBuilder> + getAnnotationFieldBuilder() { + if (annotationBuilder_ == null) { + annotationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.AnnotationOrBuilder>( + annotation_, + getParentForChildren(), + isClean()); + annotation_ = null; + } + return annotationBuilder_; + } + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + private java.util.List arrayElement_ = + java.util.Collections.emptyList(); + private void ensureArrayElementIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + arrayElement_ = new java.util.ArrayList(arrayElement_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder> arrayElementBuilder_; + + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public java.util.List getArrayElementList() { + if (arrayElementBuilder_ == null) { + return java.util.Collections.unmodifiableList(arrayElement_); + } else { + return arrayElementBuilder_.getMessageList(); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public int getArrayElementCount() { + if (arrayElementBuilder_ == null) { + return arrayElement_.size(); + } else { + return arrayElementBuilder_.getCount(); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value getArrayElement(int index) { + if (arrayElementBuilder_ == null) { + return arrayElement_.get(index); + } else { + return arrayElementBuilder_.getMessage(index); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder setArrayElement( + int index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value value) { + if (arrayElementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.set(index, value); + onChanged(); + } else { + arrayElementBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder setArrayElement( + int index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + if (arrayElementBuilder_ == null) { + ensureArrayElementIsMutable(); + arrayElement_.set(index, builderForValue.build()); + onChanged(); + } else { + arrayElementBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value value) { + if (arrayElementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.add(value); + onChanged(); + } else { + arrayElementBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + int index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value value) { + if (arrayElementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.add(index, value); + onChanged(); + } else { + arrayElementBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + if (arrayElementBuilder_ == null) { + ensureArrayElementIsMutable(); + arrayElement_.add(builderForValue.build()); + onChanged(); + } else { + arrayElementBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + int index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + if (arrayElementBuilder_ == null) { + ensureArrayElementIsMutable(); + arrayElement_.add(index, builderForValue.build()); + onChanged(); + } else { + arrayElementBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addAllArrayElement( + java.lang.Iterable values) { + if (arrayElementBuilder_ == null) { + ensureArrayElementIsMutable(); + super.addAll(values, arrayElement_); + onChanged(); + } else { + arrayElementBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder clearArrayElement() { + if (arrayElementBuilder_ == null) { + arrayElement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + arrayElementBuilder_.clear(); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder removeArrayElement(int index) { + if (arrayElementBuilder_ == null) { + ensureArrayElementIsMutable(); + arrayElement_.remove(index); + onChanged(); + } else { + arrayElementBuilder_.remove(index); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder getArrayElementBuilder( + int index) { + return getArrayElementFieldBuilder().getBuilder(index); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder getArrayElementOrBuilder( + int index) { + if (arrayElementBuilder_ == null) { + return arrayElement_.get(index); } else { + return arrayElementBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public java.util.List + getArrayElementOrBuilderList() { + if (arrayElementBuilder_ != null) { + return arrayElementBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(arrayElement_); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder addArrayElementBuilder() { + return getArrayElementFieldBuilder().addBuilder( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDefaultInstance()); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder addArrayElementBuilder( + int index) { + return getArrayElementFieldBuilder().addBuilder( + index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDefaultInstance()); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public java.util.List + getArrayElementBuilderList() { + return getArrayElementFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder> + getArrayElementFieldBuilder() { + if (arrayElementBuilder_ == null) { + arrayElementBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder>( + arrayElement_, + ((bitField0_ & 0x00000100) == 0x00000100), + getParentForChildren(), + isClean()); + arrayElement_ = null; + } + return arrayElementBuilder_; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value) + } + + static { + defaultInstance = new Value(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value) + } + + private int bitField0_; + // required int32 name_id = 1; + public static final int NAME_ID_FIELD_NUMBER = 1; + private int nameId_; + /** + * required int32 name_id = 1; + * + *
+       * id in StringTable
+       * 
+ */ + public boolean hasNameId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 name_id = 1; + * + *
+       * id in StringTable
+       * 
+ */ + public int getNameId() { + return nameId_; + } + + // required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + public static final int VALUE_FIELD_NUMBER = 2; + private org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value value_; + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value getValue() { + return value_; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder getValueOrBuilder() { + return value_; + } + + private void initFields() { + nameId_ = 0; + value_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasNameId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasValue()) { + memoizedIsInitialized = 0; + return false; + } + if (!getValue().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, nameId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, value_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, nameId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation.Argument} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.ArgumentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.class, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder.class); + } + + // Construct using org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getValueFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + nameId_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + if (valueBuilder_ == null) { + value_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + } else { + valueBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_descriptor; + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument getDefaultInstanceForType() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.getDefaultInstance(); + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument build() { + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument buildPartial() { + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument result = new org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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; + } + if (valueBuilder_ == null) { + result.value_ = value_; + } else { + result.value_ = valueBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument) { + return mergeFrom((org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument other) { + if (other == org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.getDefaultInstance()) return this; + if (other.hasNameId()) { + setNameId(other.getNameId()); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required int32 name_id = 1; + private int nameId_ ; + /** + * required int32 name_id = 1; + * + *
+         * id in StringTable
+         * 
+ */ + public boolean hasNameId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 name_id = 1; + * + *
+         * id in StringTable
+         * 
+ */ + public int getNameId() { + return nameId_; + } + /** + * required int32 name_id = 1; + * + *
+         * id in StringTable
+         * 
+ */ + public Builder setNameId(int value) { + bitField0_ |= 0x00000001; + nameId_ = value; + onChanged(); + return this; + } + /** + * required int32 name_id = 1; + * + *
+         * id in StringTable
+         * 
+ */ + public Builder clearNameId() { + bitField0_ = (bitField0_ & ~0x00000001); + nameId_ = 0; + onChanged(); + return this; + } + + // required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + private org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value value_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder> valueBuilder_; + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value getValue() { + if (valueBuilder_ == null) { + return value_; + } else { + return valueBuilder_.getMessage(); + } + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public Builder setValue(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + valueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public Builder setValue( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + if (valueBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public Builder mergeValue(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value value) { + if (valueBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + value_ != org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDefaultInstance()) { + value_ = + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.newBuilder(value_).mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + valueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public Builder clearValue() { + if (valueBuilder_ == null) { + value_ = org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + onChanged(); + } else { + valueBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder getValueBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getValueFieldBuilder().getBuilder(); + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder getValueOrBuilder() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilder(); + } else { + return value_; + } + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Value.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.ValueOrBuilder>( + value_, + getParentForChildren(), + isClean()); + value_ = null; + } + return valueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument) + } + + static { + defaultInstance = new Argument(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument) + } + + private int bitField0_; + // required int32 id = 1; + public static final int ID_FIELD_NUMBER = 1; + private int id_; + /** + * required int32 id = 1; + * + *
+     * Class FQ name id
+     * 
+ */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 id = 1; + * + *
+     * Class FQ name id
+     * 
+ */ + public int getId() { + return id_; + } + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + public static final int ARGUMENT_FIELD_NUMBER = 2; + private java.util.List argument_; + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public java.util.List getArgumentList() { + return argument_; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public java.util.List + getArgumentOrBuilderList() { + return argument_; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument getArgument(int index) { + return argument_.get(index); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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 isInitialized == 1; + + 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)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, id_); + } + for (int i = 0; i < argument_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, argument_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.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.jet.descriptors.serialization.DebugProtoBuf.Annotation prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.AnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.class, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Builder.class); + } + + // Construct using org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getArgumentFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + id_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + if (argumentBuilder_ == null) { + argument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + argumentBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_descriptor; + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation getDefaultInstanceForType() { + return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance(); + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation build() { + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation buildPartial() { + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation result = new org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (argumentBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + argument_ = java.util.Collections.unmodifiableList(argument_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.argument_ = argument_; + } else { + result.argument_ = argumentBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation) { + return mergeFrom((org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation other) { + if (other == org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (argumentBuilder_ == null) { + if (!other.argument_.isEmpty()) { + if (argument_.isEmpty()) { + argument_ = other.argument_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureArgumentIsMutable(); + argument_.addAll(other.argument_); + } + onChanged(); + } + } else { + if (!other.argument_.isEmpty()) { + if (argumentBuilder_.isEmpty()) { + argumentBuilder_.dispose(); + argumentBuilder_ = null; + argument_ = other.argument_; + bitField0_ = (bitField0_ & ~0x00000002); + argumentBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getArgumentFieldBuilder() : null; + } else { + argumentBuilder_.addAllMessages(other.argument_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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.jet.descriptors.serialization.DebugProtoBuf.Annotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required int32 id = 1; + private int id_ ; + /** + * required int32 id = 1; + * + *
+       * Class FQ name id
+       * 
+ */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 id = 1; + * + *
+       * Class FQ name id
+       * 
+ */ + public int getId() { + return id_; + } + /** + * required int32 id = 1; + * + *
+       * Class FQ name id
+       * 
+ */ + public Builder setId(int value) { + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + /** + * required int32 id = 1; + * + *
+       * Class FQ name id
+       * 
+ */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0; + onChanged(); + return this; + } + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + private java.util.List argument_ = + java.util.Collections.emptyList(); + private void ensureArgumentIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + argument_ = new java.util.ArrayList(argument_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.ArgumentOrBuilder> argumentBuilder_; + + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public java.util.List getArgumentList() { + if (argumentBuilder_ == null) { + return java.util.Collections.unmodifiableList(argument_); + } else { + return argumentBuilder_.getMessageList(); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public int getArgumentCount() { + if (argumentBuilder_ == null) { + return argument_.size(); + } else { + return argumentBuilder_.getCount(); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument getArgument(int index) { + if (argumentBuilder_ == null) { + return argument_.get(index); + } else { + return argumentBuilder_.getMessage(index); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder setArgument( + int index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument value) { + if (argumentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.set(index, value); + onChanged(); + } else { + argumentBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder setArgument( + int index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder builderForValue) { + if (argumentBuilder_ == null) { + ensureArgumentIsMutable(); + argument_.set(index, builderForValue.build()); + onChanged(); + } else { + argumentBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addArgument(org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument value) { + if (argumentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.add(value); + onChanged(); + } else { + argumentBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addArgument( + int index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument value) { + if (argumentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.add(index, value); + onChanged(); + } else { + argumentBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addArgument( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder builderForValue) { + if (argumentBuilder_ == null) { + ensureArgumentIsMutable(); + argument_.add(builderForValue.build()); + onChanged(); + } else { + argumentBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addArgument( + int index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder builderForValue) { + if (argumentBuilder_ == null) { + ensureArgumentIsMutable(); + argument_.add(index, builderForValue.build()); + onChanged(); + } else { + argumentBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addAllArgument( + java.lang.Iterable values) { + if (argumentBuilder_ == null) { + ensureArgumentIsMutable(); + super.addAll(values, argument_); + onChanged(); + } else { + argumentBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder clearArgument() { + if (argumentBuilder_ == null) { + argument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + argumentBuilder_.clear(); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder removeArgument(int index) { + if (argumentBuilder_ == null) { + ensureArgumentIsMutable(); + argument_.remove(index); + onChanged(); + } else { + argumentBuilder_.remove(index); + } + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder getArgumentBuilder( + int index) { + return getArgumentFieldBuilder().getBuilder(index); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.ArgumentOrBuilder getArgumentOrBuilder( + int index) { + if (argumentBuilder_ == null) { + return argument_.get(index); } else { + return argumentBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public java.util.List + getArgumentOrBuilderList() { + if (argumentBuilder_ != null) { + return argumentBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(argument_); + } + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder addArgumentBuilder() { + return getArgumentFieldBuilder().addBuilder( + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.getDefaultInstance()); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder addArgumentBuilder( + int index) { + return getArgumentFieldBuilder().addBuilder( + index, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.getDefaultInstance()); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public java.util.List + getArgumentBuilderList() { + return getArgumentFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.ArgumentOrBuilder> + getArgumentFieldBuilder() { + if (argumentBuilder_ == null) { + argumentBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.Argument.Builder, org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Annotation.ArgumentOrBuilder>( + argument_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + argument_ = null; + } + return argumentBuilder_; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Annotation) + } + + static { + defaultInstance = new Annotation(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.Annotation) + } + public interface TypeOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -5978,8 +9226,9 @@ public final class DebugProtoBuf { // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.TypeParameter) } - public interface ClassOrBuilder - extends com.google.protobuf.MessageOrBuilder { + public interface ClassOrBuilder extends + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { // optional int32 flags = 1 [default = 0]; /** @@ -6220,10 +9469,10 @@ public final class DebugProtoBuf { * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Class} */ public static final class Class extends - com.google.protobuf.GeneratedMessage - implements ClassOrBuilder { + com.google.protobuf.GeneratedMessage.ExtendableMessage< + Class> implements ClassOrBuilder { // Use Class.newBuilder() to construct. - private Class(com.google.protobuf.GeneratedMessage.Builder builder) { + private Class(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } @@ -8145,6 +11394,10 @@ public final class DebugProtoBuf { return false; } } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -8152,6 +11405,9 @@ public final class DebugProtoBuf { public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionWriter extensionWriter = + newExtensionWriter(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, flags_); } @@ -8182,6 +11438,7 @@ public final class DebugProtoBuf { if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeMessage(13, primaryConstructor_); } + extensionWriter.writeUntil(200, output); getUnknownFields().writeTo(output); } @@ -8241,6 +11498,7 @@ public final class DebugProtoBuf { size += com.google.protobuf.CodedOutputStream .computeMessageSize(13, primaryConstructor_); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -8323,8 +11581,8 @@ public final class DebugProtoBuf { * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Class} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.ClassOrBuilder { + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.Class, Builder> implements org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.ClassOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jetbrains.jet.descriptors.serialization.DebugProtoBuf.internal_static_org_jetbrains_jet_descriptors_serialization_Class_descriptor; @@ -8626,6 +11884,7 @@ public final class DebugProtoBuf { if (other.hasPrimaryConstructor()) { mergePrimaryConstructor(other.getPrimaryConstructor()); } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -8665,6 +11924,10 @@ public final class DebugProtoBuf { return false; } } + if (!extensionsAreInitialized()) { + + return false; + } return true; } @@ -14345,6 +17608,21 @@ public final class DebugProtoBuf { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_jetbrains_jet_descriptors_serialization_QualifiedNameTable_QualifiedName_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_org_jetbrains_jet_descriptors_serialization_Type_descriptor; private static @@ -14415,77 +17693,97 @@ public final class DebugProtoBuf { "\002(\005\022i\n\004kind\030\003 \001(\0162R.org.jetbrains.jet.de" + "scriptors.serialization.QualifiedNameTab", "le.QualifiedName.Kind:\007PACKAGE\"\036\n\004Kind\022\t" + - "\n\005CLASS\020\000\022\013\n\007PACKAGE\020\001\"\253\005\n\004Type\022R\n\013const" + - "ructor\030\001 \002(\0132=.org.jetbrains.jet.descrip" + - "tors.serialization.Type.Constructor\022L\n\010a" + - "rgument\030\002 \003(\0132:.org.jetbrains.jet.descri" + - "ptors.serialization.Type.Argument\022\027\n\010nul" + - "lable\030\003 \001(\010:\005false\022%\n\035flexible_type_capa" + - "bilities_id\030\004 \001(\005\022O\n\024flexible_upper_boun" + - "d\030\005 \001(\01321.org.jetbrains.jet.descriptors." + - "serialization.Type\032\231\001\n\013Constructor\022W\n\004ki", - "nd\030\001 \001(\0162B.org.jetbrains.jet.descriptors" + - ".serialization.Type.Constructor.Kind:\005CL" + - "ASS\022\n\n\002id\030\002 \002(\005\"%\n\004Kind\022\t\n\005CLASS\020\000\022\022\n\016TY" + - "PE_PARAMETER\020\001\032\323\001\n\010Argument\022^\n\nprojectio" + - "n\030\001 \001(\0162E.org.jetbrains.jet.descriptors." + - "serialization.Type.Argument.Projection:\003" + - "INV\022?\n\004type\030\002 \002(\01321.org.jetbrains.jet.de" + - "scriptors.serialization.Type\"&\n\nProjecti" + - "on\022\006\n\002IN\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002\"\213\002\n\rTypePar" + - "ameter\022\n\n\002id\030\001 \002(\005\022\014\n\004name\030\002 \002(\005\022\026\n\007reif", - "ied\030\003 \001(\010:\005false\022Z\n\010variance\030\004 \001(\0162C.org" + + "\n\005CLASS\020\000\022\013\n\007PACKAGE\020\001\"\212\006\n\nAnnotation\022\n\n" + + "\002id\030\001 \002(\005\022R\n\010argument\030\002 \003(\0132@.org.jetbra" + + "ins.jet.descriptors.serialization.Annota" + + "tion.Argument\032\233\005\n\010Argument\022\017\n\007name_id\030\001 " + + "\002(\005\022U\n\005value\030\002 \002(\0132F.org.jetbrains.jet.d" + + "escriptors.serialization.Annotation.Argu" + + "ment.Value\032\246\004\n\005Value\022Y\n\004type\030\001 \001(\0162K.org" + ".jetbrains.jet.descriptors.serialization" + - ".TypeParameter.Variance:\003INV\022F\n\013upper_bo" + - "und\030\005 \003(\01321.org.jetbrains.jet.descriptor" + - "s.serialization.Type\"$\n\010Variance\022\006\n\002IN\020\000" + - "\022\007\n\003OUT\020\001\022\007\n\003INV\020\002\"\254\006\n\005Class\022\020\n\005flags\030\001 " + - "\001(\005:\0010\022\030\n\020extra_visibility\030\002 \001(\t\022\017\n\007fq_n" + - "ame\030\003 \002(\005\022T\n\014class_object\030\004 \001(\0132>.org.je" + - "tbrains.jet.descriptors.serialization.Cl" + - "ass.ClassObject\022R\n\016type_parameter\030\005 \003(\0132", - ":.org.jetbrains.jet.descriptors.serializ" + - "ation.TypeParameter\022D\n\tsupertype\030\006 \003(\01321" + - ".org.jetbrains.jet.descriptors.serializa" + - "tion.Type\022\031\n\021nested_class_name\030\007 \003(\005\022E\n\006" + - "member\030\013 \003(\01325.org.jetbrains.jet.descrip" + - "tors.serialization.Callable\022\022\n\nenum_entr" + - "y\030\014 \003(\005\022b\n\023primary_constructor\030\r \001(\0132E.o" + - "rg.jetbrains.jet.descriptors.serializati" + - "on.Class.PrimaryConstructor\032O\n\013ClassObje" + - "ct\022@\n\004data\030\001 \001(\01322.org.jetbrains.jet.des", - "criptors.serialization.Class\032Y\n\022PrimaryC" + - "onstructor\022C\n\004data\030\001 \001(\01325.org.jetbrains" + - ".jet.descriptors.serialization.Callable\"" + - "p\n\004Kind\022\t\n\005CLASS\020\000\022\t\n\005TRAIT\020\001\022\016\n\nENUM_CL" + - "ASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CLAS" + - "S\020\004\022\n\n\006OBJECT\020\005\022\020\n\014CLASS_OBJECT\020\006\"W\n\007Pac" + - "kage\022E\n\006member\030\001 \003(\01325.org.jetbrains.jet" + - ".descriptors.serialization.Callable*\005\010d\020" + - "\310\001\"\220\006\n\010Callable\022\r\n\005flags\030\001 \001(\005\022\030\n\020extra_" + - "visibility\030\002 \001(\t\022\024\n\014getter_flags\030\t \001(\005\022\024", - "\n\014setter_flags\030\n \001(\005\022R\n\016type_parameter\030\004" + - " \003(\0132:.org.jetbrains.jet.descriptors.ser" + - "ialization.TypeParameter\022H\n\rreceiver_typ" + - "e\030\005 \001(\01321.org.jetbrains.jet.descriptors." + - "serialization.Type\022\014\n\004name\030\006 \002(\005\022]\n\017valu" + - "e_parameter\030\007 \003(\0132D.org.jetbrains.jet.de" + - "scriptors.serialization.Callable.ValuePa" + - "rameter\022F\n\013return_type\030\010 \002(\01321.org.jetbr" + + ".Annotation.Argument.Value.Type\022\021\n\tint_v", + "alue\030\002 \001(\022\022\023\n\013float_value\030\003 \001(\002\022\024\n\014doubl" + + "e_value\030\004 \001(\001\022\024\n\014string_value\030\005 \001(\005\022\020\n\010c" + + "lass_id\030\006 \001(\005\022\025\n\renum_value_id\030\007 \001(\005\022K\n\n" + + "annotation\030\010 \001(\01327.org.jetbrains.jet.des" + + "criptors.serialization.Annotation\022]\n\rarr" + + "ay_element\030\t \003(\0132F.org.jetbrains.jet.des" + + "criptors.serialization.Annotation.Argume" + + "nt.Value\"\230\001\n\004Type\022\010\n\004BYTE\020\000\022\010\n\004CHAR\020\001\022\t\n" + + "\005SHORT\020\002\022\007\n\003INT\020\003\022\010\n\004LONG\020\004\022\t\n\005FLOAT\020\005\022\n" + + "\n\006DOUBLE\020\006\022\013\n\007BOOLEAN\020\007\022\n\n\006STRING\020\010\022\t\n\005C", + "LASS\020\t\022\010\n\004ENUM\020\n\022\016\n\nANNOTATION\020\013\022\t\n\005ARRA" + + "Y\020\014\"\253\005\n\004Type\022R\n\013constructor\030\001 \002(\0132=.org." + + "jetbrains.jet.descriptors.serialization." + + "Type.Constructor\022L\n\010argument\030\002 \003(\0132:.org" + + ".jetbrains.jet.descriptors.serialization" + + ".Type.Argument\022\027\n\010nullable\030\003 \001(\010:\005false\022" + + "%\n\035flexible_type_capabilities_id\030\004 \001(\005\022O" + + "\n\024flexible_upper_bound\030\005 \001(\01321.org.jetbr" + "ains.jet.descriptors.serialization.Type\032" + - "\305\001\n\016ValueParameter\022\r\n\005flags\030\001 \001(\005\022\014\n\004nam", - "e\030\002 \002(\005\022?\n\004type\030\003 \002(\01321.org.jetbrains.je" + - "t.descriptors.serialization.Type\022N\n\023vara" + - "rg_element_type\030\004 \001(\01321.org.jetbrains.je" + - "t.descriptors.serialization.Type*\005\010d\020\310\001\"" + - "Q\n\nMemberKind\022\017\n\013DECLARATION\020\000\022\021\n\rFAKE_O" + - "VERRIDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SYNTHESIZED" + - "\020\003\":\n\014CallableKind\022\007\n\003FUN\020\000\022\007\n\003VAL\020\001\022\007\n\003" + - "VAR\020\002\022\017\n\013CONSTRUCTOR\020\003*\005\010d\020\310\001*-\n\010Modalit" + - "y\022\t\n\005FINAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002*M\n\n" + - "Visibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020\001\022\r\n", - "\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\t\n\005EXTRA\020\004B\022B\rD" + - "ebugProtoBuf\210\001\000" + "\231\001\n\013Constructor\022W\n\004kind\030\001 \001(\0162B.org.jetb", + "rains.jet.descriptors.serialization.Type" + + ".Constructor.Kind:\005CLASS\022\n\n\002id\030\002 \002(\005\"%\n\004" + + "Kind\022\t\n\005CLASS\020\000\022\022\n\016TYPE_PARAMETER\020\001\032\323\001\n\010" + + "Argument\022^\n\nprojection\030\001 \001(\0162E.org.jetbr" + + "ains.jet.descriptors.serialization.Type." + + "Argument.Projection:\003INV\022?\n\004type\030\002 \002(\01321" + + ".org.jetbrains.jet.descriptors.serializa" + + "tion.Type\"&\n\nProjection\022\006\n\002IN\020\000\022\007\n\003OUT\020\001" + + "\022\007\n\003INV\020\002\"\213\002\n\rTypeParameter\022\n\n\002id\030\001 \002(\005\022" + + "\014\n\004name\030\002 \002(\005\022\026\n\007reified\030\003 \001(\010:\005false\022Z\n", + "\010variance\030\004 \001(\0162C.org.jetbrains.jet.desc" + + "riptors.serialization.TypeParameter.Vari" + + "ance:\003INV\022F\n\013upper_bound\030\005 \003(\01321.org.jet" + + "brains.jet.descriptors.serialization.Typ" + + "e\"$\n\010Variance\022\006\n\002IN\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002\"" + + "\263\006\n\005Class\022\020\n\005flags\030\001 \001(\005:\0010\022\030\n\020extra_vis" + + "ibility\030\002 \001(\t\022\017\n\007fq_name\030\003 \002(\005\022T\n\014class_" + + "object\030\004 \001(\0132>.org.jetbrains.jet.descrip" + + "tors.serialization.Class.ClassObject\022R\n\016" + + "type_parameter\030\005 \003(\0132:.org.jetbrains.jet", + ".descriptors.serialization.TypeParameter" + + "\022D\n\tsupertype\030\006 \003(\01321.org.jetbrains.jet." + + "descriptors.serialization.Type\022\031\n\021nested" + + "_class_name\030\007 \003(\005\022E\n\006member\030\013 \003(\01325.org." + + "jetbrains.jet.descriptors.serialization." + + "Callable\022\022\n\nenum_entry\030\014 \003(\005\022b\n\023primary_" + + "constructor\030\r \001(\0132E.org.jetbrains.jet.de" + + "scriptors.serialization.Class.PrimaryCon" + + "structor\032O\n\013ClassObject\022@\n\004data\030\001 \001(\01322." + + "org.jetbrains.jet.descriptors.serializat", + "ion.Class\032Y\n\022PrimaryConstructor\022C\n\004data\030" + + "\001 \001(\01325.org.jetbrains.jet.descriptors.se" + + "rialization.Callable\"p\n\004Kind\022\t\n\005CLASS\020\000\022" + + "\t\n\005TRAIT\020\001\022\016\n\nENUM_CLASS\020\002\022\016\n\nENUM_ENTRY" + + "\020\003\022\024\n\020ANNOTATION_CLASS\020\004\022\n\n\006OBJECT\020\005\022\020\n\014" + + "CLASS_OBJECT\020\006*\005\010d\020\310\001\"W\n\007Package\022E\n\006memb" + + "er\030\001 \003(\01325.org.jetbrains.jet.descriptors" + + ".serialization.Callable*\005\010d\020\310\001\"\220\006\n\010Calla" + + "ble\022\r\n\005flags\030\001 \001(\005\022\030\n\020extra_visibility\030\002" + + " \001(\t\022\024\n\014getter_flags\030\t \001(\005\022\024\n\014setter_fla", + "gs\030\n \001(\005\022R\n\016type_parameter\030\004 \003(\0132:.org.j" + + "etbrains.jet.descriptors.serialization.T" + + "ypeParameter\022H\n\rreceiver_type\030\005 \001(\01321.or" + + "g.jetbrains.jet.descriptors.serializatio" + + "n.Type\022\014\n\004name\030\006 \002(\005\022]\n\017value_parameter\030" + + "\007 \003(\0132D.org.jetbrains.jet.descriptors.se" + + "rialization.Callable.ValueParameter\022F\n\013r" + + "eturn_type\030\010 \002(\01321.org.jetbrains.jet.des" + + "criptors.serialization.Type\032\305\001\n\016ValuePar" + + "ameter\022\r\n\005flags\030\001 \001(\005\022\014\n\004name\030\002 \002(\005\022?\n\004t", + "ype\030\003 \002(\01321.org.jetbrains.jet.descriptor" + + "s.serialization.Type\022N\n\023vararg_element_t" + + "ype\030\004 \001(\01321.org.jetbrains.jet.descriptor" + + "s.serialization.Type*\005\010d\020\310\001\"Q\n\nMemberKin" + + "d\022\017\n\013DECLARATION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n" + + "\nDELEGATION\020\002\022\017\n\013SYNTHESIZED\020\003\":\n\014Callab" + + "leKind\022\007\n\003FUN\020\000\022\007\n\003VAL\020\001\022\007\n\003VAR\020\002\022\017\n\013CON" + + "STRUCTOR\020\003*\005\010d\020\310\001*-\n\010Modality\022\t\n\005FINAL\020\000" + + "\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002*M\n\nVisibility\022\014" + + "\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tPROTECTED\020\002", + "\022\n\n\006PUBLIC\020\003\022\t\n\005EXTRA\020\004B\022B\rDebugProtoBuf" + + "\210\001\000" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -14510,8 +17808,26 @@ public final class DebugProtoBuf { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_jet_descriptors_serialization_QualifiedNameTable_QualifiedName_descriptor, new java.lang.String[] { "ParentQualifiedName", "ShortName", "Kind", }); - internal_static_org_jetbrains_jet_descriptors_serialization_Type_descriptor = + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_descriptor, + new java.lang.String[] { "Id", "Argument", }); + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_descriptor = + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_descriptor.getNestedTypes().get(0); + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_descriptor, + new java.lang.String[] { "NameId", "Value", }); + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_descriptor = + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_descriptor.getNestedTypes().get(0); + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_jetbrains_jet_descriptors_serialization_Annotation_Argument_Value_descriptor, + new java.lang.String[] { "Type", "IntValue", "FloatValue", "DoubleValue", "StringValue", "ClassId", "EnumValueId", "Annotation", "ArrayElement", }); + internal_static_org_jetbrains_jet_descriptors_serialization_Type_descriptor = + getDescriptor().getMessageTypes().get(3); internal_static_org_jetbrains_jet_descriptors_serialization_Type_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_jet_descriptors_serialization_Type_descriptor, @@ -14529,13 +17845,13 @@ public final class DebugProtoBuf { internal_static_org_jetbrains_jet_descriptors_serialization_Type_Argument_descriptor, new java.lang.String[] { "Projection", "Type", }); internal_static_org_jetbrains_jet_descriptors_serialization_TypeParameter_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(4); internal_static_org_jetbrains_jet_descriptors_serialization_TypeParameter_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_jet_descriptors_serialization_TypeParameter_descriptor, new java.lang.String[] { "Id", "Name", "Reified", "Variance", "UpperBound", }); internal_static_org_jetbrains_jet_descriptors_serialization_Class_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_org_jetbrains_jet_descriptors_serialization_Class_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_jet_descriptors_serialization_Class_descriptor, @@ -14553,13 +17869,13 @@ public final class DebugProtoBuf { internal_static_org_jetbrains_jet_descriptors_serialization_Class_PrimaryConstructor_descriptor, new java.lang.String[] { "Data", }); internal_static_org_jetbrains_jet_descriptors_serialization_Package_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_org_jetbrains_jet_descriptors_serialization_Package_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_jet_descriptors_serialization_Package_descriptor, new java.lang.String[] { "Member", }); internal_static_org_jetbrains_jet_descriptors_serialization_Callable_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_org_jetbrains_jet_descriptors_serialization_Callable_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_jetbrains_jet_descriptors_serialization_Callable_descriptor, diff --git a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/BinaryClassAnnotationAndConstantLoaderImpl.kt b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/BinaryClassAnnotationAndConstantLoaderImpl.kt index 35f4c509d3e..76fdda6979a 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/BinaryClassAnnotationAndConstantLoaderImpl.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/kotlin/BinaryClassAnnotationAndConstantLoaderImpl.kt @@ -22,16 +22,12 @@ import org.jetbrains.jet.lang.resolve.kotlin.KotlinJvmBinaryClass.AnnotationArra import org.jetbrains.jet.lang.types.ErrorUtils import org.jetbrains.jet.lang.resolve.kotlin.DeserializedResolverUtils.javaClassIdToKotlinClassId import org.jetbrains.jet.storage.StorageManager - import java.util.* -import org.jetbrains.jet.lang.descriptors.ModuleDescriptor +import org.jetbrains.jet.lang.descriptors.* import org.jetbrains.jet.lang.resolve.name.ClassId import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor -import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor import org.jetbrains.jet.lang.resolve.name.Name import org.jetbrains.jet.lang.resolve.constants.ArrayValue -import org.jetbrains.jet.lang.descriptors.ClassKind -import org.jetbrains.jet.lang.descriptors.ClassDescriptor import org.jetbrains.jet.lang.resolve.constants.EnumValue import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptorImpl import org.jetbrains.jet.lang.resolve.constants.ErrorValue @@ -112,6 +108,7 @@ public class BinaryClassAnnotationAndConstantLoaderImpl( } } + // NOTE: see analogous code in AnnotationDeserializer private fun enumEntryValue(enumClassId: ClassId, name: Name): CompileTimeConstant<*> { val enumClass = resolveClass(enumClassId) if (enumClass.getKind() == ClassKind.ENUM_CLASS) { diff --git a/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/ArrayValue.java b/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/ArrayValue.java index a62af0666b8..aa278a4fb36 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/ArrayValue.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/ArrayValue.java @@ -32,6 +32,8 @@ public class ArrayValue extends CompileTimeConstant> boolean canBeUsedInAnnotations, boolean usesVariableAsConstant) { super(value, canBeUsedInAnnotations, false, usesVariableAsConstant); + assert KotlinBuiltIns.getInstance().isArray(type) || + KotlinBuiltIns.getInstance().isPrimitiveArray(type) : "Type should be an array, but was " + type + ": " + value; this.type = type; } diff --git a/core/descriptors/src/org/jetbrains/jet/lang/types/lang/BuiltInsAnnotationAndConstantLoader.kt b/core/descriptors/src/org/jetbrains/jet/lang/types/lang/BuiltInsAnnotationAndConstantLoader.kt new file mode 100644 index 00000000000..40ad7107e97 --- /dev/null +++ b/core/descriptors/src/org/jetbrains/jet/lang/types/lang/BuiltInsAnnotationAndConstantLoader.kt @@ -0,0 +1,68 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.types.lang + +import org.jetbrains.jet.descriptors.serialization.* +import org.jetbrains.jet.descriptors.serialization.descriptors.* +import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant +import org.jetbrains.jet.lang.descriptors.ModuleDescriptor +import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor + +class BuiltInsAnnotationAndConstantLoader( + module: ModuleDescriptor +) : AnnotationAndConstantLoader> { + private val deserializer = AnnotationDeserializer(module) + + override fun loadClassAnnotations( + classProto: ProtoBuf.Class, + nameResolver: NameResolver + ): List { + val annotations = classProto.getExtension(BuiltInsProtoBuf.classAnnotation).orEmpty() + return annotations.map { proto -> deserializer.deserializeAnnotation(proto, nameResolver) } + } + + override fun loadCallableAnnotations( + container: ProtoContainer, + proto: ProtoBuf.Callable, + nameResolver: NameResolver, + kind: AnnotatedCallableKind + ): List { + val annotations = proto.getExtension(BuiltInsProtoBuf.callableAnnotation).orEmpty() + return annotations.map { proto -> deserializer.deserializeAnnotation(proto, nameResolver) } + } + + override fun loadValueParameterAnnotations( + container: ProtoContainer, + callable: ProtoBuf.Callable, + nameResolver: NameResolver, + kind: AnnotatedCallableKind, + proto: ProtoBuf.Callable.ValueParameter + ): List { + val annotations = proto.getExtension(BuiltInsProtoBuf.parameterAnnotation).orEmpty() + return annotations.map { proto -> deserializer.deserializeAnnotation(proto, nameResolver) } + } + + override fun loadPropertyConstant( + container: ProtoContainer, + proto: ProtoBuf.Callable, + nameResolver: NameResolver, + kind: AnnotatedCallableKind + ): CompileTimeConstant<*>? { + // TODO: support deserialization of compile time constants in built-ins when needed + throw UnsupportedOperationException() + } +} diff --git a/core/descriptors/src/org/jetbrains/jet/lang/types/lang/BuiltinsPackageFragment.kt b/core/descriptors/src/org/jetbrains/jet/lang/types/lang/BuiltinsPackageFragment.kt index 3f6cc05bb5a..0a69c9bdd1b 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/types/lang/BuiltinsPackageFragment.kt +++ b/core/descriptors/src/org/jetbrains/jet/lang/types/lang/BuiltinsPackageFragment.kt @@ -17,7 +17,6 @@ package org.jetbrains.jet.lang.types.lang import org.jetbrains.jet.descriptors.serialization.* -import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationAndConstantLoader import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedPackageMemberScope import org.jetbrains.jet.lang.descriptors.ModuleDescriptor import org.jetbrains.jet.lang.descriptors.PackageFragmentProvider @@ -59,7 +58,8 @@ public class BuiltinsPackageFragment( proto, nameResolver, DeserializationComponents( - storageManager, module, BuiltInsClassDataFinder(), AnnotationAndConstantLoader.UNSUPPORTED, // TODO: support annotations + storageManager, module, BuiltInsClassDataFinder(), + BuiltInsAnnotationAndConstantLoader(getContainingDeclaration()), provider, FlexibleTypeCapabilitiesDeserializer.ThrowException ), { readClassNames(proto) } @@ -99,7 +99,7 @@ public class BuiltinsPackageFragment( val metadataPath = BuiltInsSerializationUtil.getClassMetadataPath(classId) ?: return null val stream = loadResource(metadataPath) ?: return null - val classProto = ProtoBuf.Class.parseFrom(stream) + val classProto = ProtoBuf.Class.parseFrom(stream, extensionRegistry) val expectedShortName = classId.getRelativeClassName().shortName() val actualShortName = nameResolver.getClassId(classProto.getFqName()).getRelativeClassName().shortName() diff --git a/core/serialization/src/builtins.proto b/core/serialization/src/builtins.proto index d8cb5332b92..e392242a436 100644 --- a/core/serialization/src/builtins.proto +++ b/core/serialization/src/builtins.proto @@ -25,3 +25,15 @@ extend Package { // id in StringTable repeated int32 class_name = 150 [packed = true]; } + +extend Class { + repeated Annotation class_annotation = 150; +} + +extend Callable { + repeated Annotation callable_annotation = 150; +} + +extend Callable.ValueParameter { + repeated Annotation parameter_annotation = 150; +} diff --git a/core/serialization/src/descriptors.proto b/core/serialization/src/descriptors.proto index ad878ae2178..81d35edf72e 100644 --- a/core/serialization/src/descriptors.proto +++ b/core/serialization/src/descriptors.proto @@ -41,6 +41,62 @@ message QualifiedNameTable { repeated QualifiedName qualified_name = 1; } +message Annotation { + message Argument { + message Value { + enum Type { + BYTE = 0; + CHAR = 1; + SHORT = 2; + INT = 3; + LONG = 4; + FLOAT = 5; + DOUBLE = 6; + BOOLEAN = 7; + + STRING = 8; + CLASS = 9; + ENUM = 10; + ANNOTATION = 11; + ARRAY = 12; + } + + // 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 + optional Type type = 1; + + // Only one of the following values should be present. Consider using `oneof` instead when we upgrade to protobuf 2.6.0+ + + optional sint64 int_value = 2; + optional float float_value = 3; + optional double double_value = 4; + + // id in StringTable + optional int32 string_value = 5; + + // If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class + optional int32 class_id = 6; + + // id in StringTable + optional int32 enum_value_id = 7; + + optional Annotation annotation = 8; + + repeated Value array_element = 9; + } + + // id in StringTable + required int32 name_id = 1; + required Value value = 2; + } + + // Class FQ name id + required int32 id = 1; + + repeated Argument argument = 2; +} + message Type { message Constructor { enum Kind { @@ -151,6 +207,8 @@ message Class { // This field is present if and only if the class has a primary constructor optional PrimaryConstructor primary_constructor = 13; // todo: other constructors? + + extensions 100 to 199; } message Package { @@ -189,7 +247,7 @@ message Callable { optional int32 flags = 1; optional string extra_visibility = 2; // for things like java-specific visibilities - /* + /* isNotDefault Visibility Modality diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/AnnotationDeserializer.kt b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/AnnotationDeserializer.kt new file mode 100644 index 00000000000..8916da54c87 --- /dev/null +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/AnnotationDeserializer.kt @@ -0,0 +1,164 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.descriptors.serialization + +import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor +import org.jetbrains.jet.lang.descriptors.ModuleDescriptor +import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptorImpl +import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor +import org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation +import org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument +import org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value +import org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type +import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns +import org.jetbrains.jet.lang.resolve.name.Name +import org.jetbrains.jet.lang.resolve.constants.* +import org.jetbrains.jet.lang.types.JetType +import org.jetbrains.jet.lang.descriptors.ClassDescriptor +import org.jetbrains.jet.lang.resolve.name.ClassId +import org.jetbrains.jet.lang.types.ErrorUtils +import org.jetbrains.jet.lang.descriptors.ClassKind + +public class AnnotationDeserializer(private val module: ModuleDescriptor) { + private val builtIns: KotlinBuiltIns + get() = module.builtIns + + public fun deserializeAnnotation(proto: Annotation, nameResolver: NameResolver): AnnotationDescriptor { + val annotationClass = resolveClass(nameResolver.getClassId(proto.getId())) + + val arguments = if (proto.getArgumentCount() == 0 || ErrorUtils.isError(annotationClass)) { + mapOf() + } + else { + val parameterByName = annotationClass.getConstructors().single().getValueParameters().toMap { it.getName() } + val arguments = proto.getArgumentList().map { resolveArgument(it, parameterByName, nameResolver) }.filterNotNull() + arguments.toMap() + } + + return AnnotationDescriptorImpl(annotationClass.getDefaultType(), arguments) + } + + private fun resolveArgument( + proto: Argument, + parameterByName: Map, + nameResolver: NameResolver + ): Pair>? { + val parameter = parameterByName[nameResolver.getName(proto.getNameId())] ?: return null + return Pair(parameter, resolveValue(parameter.getType(), proto.getValue(), nameResolver)) + } + + private fun resolveValue( + expectedType: JetType, + value: ProtoBuf.Annotation.Argument.Value, + nameResolver: NameResolver + ): CompileTimeConstant<*> { + val result = when (value.getType()) { + Type.BYTE -> ByteValue(value.getIntValue().toByte(), true, true, true) + Type.CHAR -> CharValue(value.getIntValue().toChar(), true, true, true) + Type.SHORT -> ShortValue(value.getIntValue().toShort(), true, true, true) + Type.INT -> IntValue(value.getIntValue().toInt(), true, true, true) + Type.LONG -> LongValue(value.getIntValue(), true, true, true) + Type.FLOAT -> FloatValue(value.getFloatValue(), true, true) + Type.DOUBLE -> DoubleValue(value.getDoubleValue(), true, true) + Type.BOOLEAN -> BooleanValue(value.getIntValue() != 0L, true, true) + Type.STRING -> { + StringValue(nameResolver.getString(value.getStringValue()), true, true) + } + Type.CLASS -> { + // TODO: support class literals + error("Class literal annotation arguments are not supported yet (${nameResolver.getClassId(value.getClassId())})") + } + Type.ENUM -> { + resolveEnumValue(nameResolver.getClassId(value.getClassId()), nameResolver.getName(value.getEnumValueId())) + } + Type.ANNOTATION -> { + AnnotationValue(deserializeAnnotation(value.getAnnotation(), nameResolver)) + } + Type.ARRAY -> { + if (!KotlinBuiltIns.isArray(expectedType) && + !KotlinBuiltIns.isPrimitiveArray(expectedType)) return ErrorValue.create("Unexpected argument value") + + val arrayElements = value.getArrayElementList() + + val actualArrayType = + if (arrayElements.isNotEmpty()) { + val actualElementType = resolveArrayElementType(arrayElements.first(), nameResolver) + builtIns.getPrimitiveArrayJetTypeByPrimitiveJetType(actualElementType) ?: builtIns.getArrayType(actualElementType) + } + else { + // In the case of empty array, no element has the element type, so we fall back to the expected type. + // This is not very accurate when annotation class has been changed without recompiling clients, + // but should not in fact matter because the value is empty anyway + expectedType + } + + val expectedElementType = builtIns.getArrayElementType(expectedType) + + ArrayValue( + arrayElements.map { resolveValue(expectedElementType, it, nameResolver) }, + actualArrayType, + true, true + ) + } + else -> error("Unsupported annotation argument type: ${value.getType()} (expected $expectedType)") + } + + if (result.getType(builtIns) != expectedType) { + // This means that an annotation class has been changed incompatibly without recompiling clients + return ErrorValue.create("Unexpected argument value") + } + + return result + } + + // NOTE: see analogous code in BinaryClassAnnotationAndConstantLoaderImpl + private fun resolveEnumValue(enumClassId: ClassId, enumEntryName: Name): CompileTimeConstant<*> { + val enumClass = resolveClass(enumClassId) + if (enumClass.getKind() == ClassKind.ENUM_CLASS) { + val enumEntry = enumClass.getUnsubstitutedInnerClassesScope().getClassifier(enumEntryName) + if (enumEntry is ClassDescriptor) { + return EnumValue(enumEntry, true) + } + } + return ErrorValue.create("Unresolved enum entry: $enumClassId.$enumEntryName") + } + + private fun resolveArrayElementType(value: Value, nameResolver: NameResolver): JetType = + with(builtIns) { + when (value.getType()) { + Type.BYTE -> getByteType() + Type.CHAR -> getCharType() + Type.SHORT -> getShortType() + Type.INT -> getIntType() + Type.LONG -> getLongType() + Type.FLOAT -> getFloatType() + Type.DOUBLE -> getDoubleType() + Type.BOOLEAN -> getBooleanType() + Type.STRING -> getStringType() + Type.CLASS -> error("Arrays of class literals are not supported yet") // TODO: support arrays of class literals + Type.ENUM -> resolveClass(nameResolver.getClassId(value.getClassId())).getDefaultType() + Type.ANNOTATION -> resolveClass(nameResolver.getClassId(value.getAnnotation().getId())).getDefaultType() + Type.ARRAY -> error("Array of arrays is impossible") + else -> error("Unknown type: ${value.getType()}") + } + } + + private fun resolveClass(classId: ClassId): ClassDescriptor { + return module.findClassAcrossModuleDependencies(classId) + ?: ErrorUtils.createErrorClass(classId.asSingleFqName().asString()) + } +} diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/AnnotationSerializer.kt b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/AnnotationSerializer.kt new file mode 100644 index 00000000000..8ecde5eba73 --- /dev/null +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/AnnotationSerializer.kt @@ -0,0 +1,145 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.descriptors.serialization + +import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor +import org.jetbrains.jet.lang.descriptors.ClassDescriptor +import org.jetbrains.jet.lang.descriptors.annotations.AnnotationArgumentVisitor +import org.jetbrains.jet.lang.resolve.constants.* +import org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value +import org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type +import org.jetbrains.jet.lang.types.JetType +import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns + +public object AnnotationSerializer { + public fun serializeAnnotation(annotation: AnnotationDescriptor, stringTable: StringTable): ProtoBuf.Annotation { + return with(ProtoBuf.Annotation.newBuilder()) { + val annotationClass = annotation.getType().getConstructor().getDeclarationDescriptor() as? ClassDescriptor + ?: error("Annotation type is not a class: ${annotation.getType()}") + + setId(stringTable.getFqNameIndex(annotationClass)) + + for ((parameter, value) in annotation.getAllValueArguments()) { + val argument = ProtoBuf.Annotation.Argument.newBuilder() + argument.setNameId(stringTable.getSimpleNameIndex(parameter.getName())) + argument.setValue(valueProto(value, parameter.getType(), stringTable)) + addArgument(argument) + } + + build() + } + } + + fun valueProto(constant: CompileTimeConstant<*>, type: JetType, nameTable: StringTable): Value.Builder = with(Value.newBuilder()) { + constant.accept(object : AnnotationArgumentVisitor { + override fun visitAnnotationValue(value: AnnotationValue, data: Unit) { + setType(Type.ANNOTATION) + setAnnotation(serializeAnnotation(value.getValue(), nameTable)) + } + + override fun visitArrayValue(value: ArrayValue, data: Unit) { + setType(Type.ARRAY) + for (element in value.getValue()) { + addArrayElement(valueProto(element, KotlinBuiltIns.getInstance().getArrayElementType(type), nameTable).build()) + } + } + + override fun visitBooleanValue(value: BooleanValue, data: Unit) { + setType(Type.BOOLEAN) + setIntValue(if (value.getValue()) 1 else 0) + } + + override fun visitByteValue(value: ByteValue, data: Unit) { + setType(Type.BYTE) + setIntValue(value.getValue().toLong()) + } + + override fun visitCharValue(value: CharValue, data: Unit) { + setType(Type.CHAR) + setIntValue(value.getValue().toLong()) + } + + override fun visitDoubleValue(value: DoubleValue, data: Unit) { + setType(Type.DOUBLE) + setDoubleValue(value.getValue()) + } + + override fun visitEnumValue(value: EnumValue, data: Unit) { + setType(Type.ENUM) + val enumEntry = value.getValue() + setClassId(nameTable.getFqNameIndex(enumEntry.getContainingDeclaration() as ClassDescriptor)) + setEnumValueId(nameTable.getSimpleNameIndex(enumEntry.getName())) + } + + override fun visitErrorValue(value: ErrorValue, data: Unit) { + throw UnsupportedOperationException("Error value: $value") + } + + override fun visitFloatValue(value: FloatValue, data: Unit) { + setType(Type.FLOAT) + setFloatValue(value.getValue()) + } + + override fun visitIntValue(value: IntValue, data: Unit) { + setType(Type.INT) + setIntValue(value.getValue().toLong()) + } + + override fun visitJavaClassValue(value: JavaClassValue, data: Unit) { + // TODO: support class literals + throw UnsupportedOperationException("Class literal annotation arguments are not yet supported: $value") + } + + override fun visitLongValue(value: LongValue, data: Unit) { + setType(Type.LONG) + setIntValue(value.getValue()) + } + + override fun visitNullValue(value: NullValue, data: Unit) { + throw UnsupportedOperationException("Null should not appear in annotation arguments") + } + + override fun visitNumberTypeValue(constant: IntegerValueTypeConstant, data: Unit) { + // TODO: IntegerValueTypeConstant should not occur in annotation arguments + val number = constant.getValue(type) + val specificConstant = with(KotlinBuiltIns.getInstance()) { + when (type) { + getLongType() -> LongValue(number.toLong(), true, true, true) + getIntType() -> IntValue(number.toInt(), true, true, true) + getShortType() -> ShortValue(number.toShort(), true, true, true) + getByteType() -> ByteValue(number.toByte(), true, true, true) + else -> throw IllegalStateException("Integer constant $constant has non-integer type $type") + } + } + + specificConstant.accept(this, data) + } + + override fun visitShortValue(value: ShortValue, data: Unit) { + setType(Type.SHORT) + setIntValue(value.getValue().toLong()) + } + + override fun visitStringValue(value: StringValue, data: Unit) { + setType(Type.STRING) + setStringValue(nameTable.getStringIndex(value.getValue())) + } + }, Unit) + + this + } +} diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/BuiltInsProtoBuf.java b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/BuiltInsProtoBuf.java index 79a57c7175b..6cd3a3943f3 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/BuiltInsProtoBuf.java +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/BuiltInsProtoBuf.java @@ -8,6 +8,9 @@ public final class BuiltInsProtoBuf { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { registry.add(org.jetbrains.jet.descriptors.serialization.BuiltInsProtoBuf.className); + registry.add(org.jetbrains.jet.descriptors.serialization.BuiltInsProtoBuf.classAnnotation); + registry.add(org.jetbrains.jet.descriptors.serialization.BuiltInsProtoBuf.callableAnnotation); + registry.add(org.jetbrains.jet.descriptors.serialization.BuiltInsProtoBuf.parameterAnnotation); } public static final int CLASS_NAME_FIELD_NUMBER = 150; /** @@ -24,6 +27,51 @@ public final class BuiltInsProtoBuf { 150, com.google.protobuf.WireFormat.FieldType.INT32, true); + public static final int CLASS_ANNOTATION_FIELD_NUMBER = 150; + /** + * extend .org.jetbrains.jet.descriptors.serialization.Class { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class, + java.util.List> classAnnotation = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.getDefaultInstance(), + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance(), + null, + 150, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false); + public static final int CALLABLE_ANNOTATION_FIELD_NUMBER = 150; + /** + * extend .org.jetbrains.jet.descriptors.serialization.Callable { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable, + java.util.List> callableAnnotation = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(), + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance(), + null, + 150, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false); + public static final int PARAMETER_ANNOTATION_FIELD_NUMBER = 150; + /** + * extend .org.jetbrains.jet.descriptors.serialization.Callable.ValueParameter { ... } + */ + public static final + com.google.protobuf.GeneratedMessageLite.GeneratedExtension< + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.ValueParameter, + java.util.List> parameterAnnotation = com.google.protobuf.GeneratedMessageLite + .newRepeatedGeneratedExtension( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.ValueParameter.getDefaultInstance(), + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance(), + null, + 150, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + false); static { } diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorSerializer.java b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorSerializer.java index a074caabb97..d458ebeb8ce 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorSerializer.java +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/DescriptorSerializer.java @@ -135,6 +135,8 @@ public class DescriptorSerializer { builder.setClassObject(classObjectProto(classObject)); } + extension.serializeClass(classDescriptor, builder, stringTable); + return builder; } diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java index 34fbe01f3af..6016ae2d59d 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/ProtoBuf.java @@ -1685,6 +1685,2587 @@ public final class ProtoBuf { // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.QualifiedNameTable) } + public interface AnnotationOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int32 id = 1; + /** + * required int32 id = 1; + * + *
+     * Class FQ name id
+     * 
+ */ + boolean hasId(); + /** + * required int32 id = 1; + * + *
+     * Class FQ name id
+     * 
+ */ + int getId(); + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + java.util.List + getArgumentList(); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument getArgument(int index); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + int getArgumentCount(); + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation} + */ + public static final class Annotation extends + com.google.protobuf.GeneratedMessageLite + implements AnnotationOrBuilder { + // Use Annotation.newBuilder() to construct. + private Annotation(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + + } + private Annotation(boolean noInit) {} + + private static final Annotation defaultInstance; + public static Annotation getDefaultInstance() { + return defaultInstance; + } + + public Annotation getDefaultInstanceForType() { + return defaultInstance; + } + + private Annotation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + 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.jet.descriptors.serialization.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_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + 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 com.google.protobuf.MessageLiteOrBuilder { + + // required int32 name_id = 1; + /** + * required int32 name_id = 1; + * + *
+       * id in StringTable
+       * 
+ */ + boolean hasNameId(); + /** + * required int32 name_id = 1; + * + *
+       * id in StringTable
+       * 
+ */ + int getNameId(); + + // required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + boolean hasValue(); + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value getValue(); + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation.Argument} + */ + public static final class Argument extends + com.google.protobuf.GeneratedMessageLite + implements ArgumentOrBuilder { + // Use Argument.newBuilder() to construct. + private Argument(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + + } + private Argument(boolean noInit) {} + + private static final Argument defaultInstance; + public static Argument getDefaultInstance() { + return defaultInstance; + } + + public Argument getDefaultInstanceForType() { + return defaultInstance; + } + + private Argument( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + nameId_ = input.readInt32(); + break; + } + case 18: { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = value_.toBuilder(); + } + value_ = input.readMessage(org.jetbrains.jet.descriptors.serialization.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 { + 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; + } + + public interface ValueOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value.Type type = 1; + /** + * optional .org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type getType(); + + // optional sint64 int_value = 2; + /** + * optional sint64 int_value = 2; + */ + boolean hasIntValue(); + /** + * optional sint64 int_value = 2; + */ + long getIntValue(); + + // optional float float_value = 3; + /** + * optional float float_value = 3; + */ + boolean hasFloatValue(); + /** + * optional float float_value = 3; + */ + float getFloatValue(); + + // optional double double_value = 4; + /** + * optional double double_value = 4; + */ + boolean hasDoubleValue(); + /** + * optional double double_value = 4; + */ + double getDoubleValue(); + + // optional int32 string_value = 5; + /** + * optional int32 string_value = 5; + * + *
+         * id in StringTable
+         * 
+ */ + boolean hasStringValue(); + /** + * optional int32 string_value = 5; + * + *
+         * id in StringTable
+         * 
+ */ + int getStringValue(); + + // optional int32 class_id = 6; + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+         * 
+ */ + boolean hasClassId(); + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+         * 
+ */ + int getClassId(); + + // optional int32 enum_value_id = 7; + /** + * optional int32 enum_value_id = 7; + * + *
+         * id in StringTable
+         * 
+ */ + boolean hasEnumValueId(); + /** + * optional int32 enum_value_id = 7; + * + *
+         * id in StringTable
+         * 
+ */ + int getEnumValueId(); + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + boolean hasAnnotation(); + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation getAnnotation(); + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + java.util.List + getArrayElementList(); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value getArrayElement(int index); + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + int getArrayElementCount(); + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value} + */ + public static final class Value extends + com.google.protobuf.GeneratedMessageLite + implements ValueOrBuilder { + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + + } + private Value(boolean noInit) {} + + private static final Value defaultInstance; + public static Value getDefaultInstance() { + return defaultInstance; + } + + public Value getDefaultInstanceForType() { + return defaultInstance; + } + + private Value( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type value = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type.valueOf(rawValue); + if (value != null) { + 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.jet.descriptors.serialization.ProtoBuf.Annotation.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = annotation_.toBuilder(); + } + annotation_ = input.readMessage(org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.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_ & 0x00000100) == 0x00000100)) { + arrayElement_ = java.util.Collections.unmodifiableList(arrayElement_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + 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.jet.descriptors.serialization.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; + + + 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() { + public Type findValueByNumber(int number) { + return Type.valueOf(number); + } + }; + + private final int value; + + private Type(int index, int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value.Type) + } + + private int bitField0_; + // optional .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value.Type type = 1; + public static final int TYPE_FIELD_NUMBER = 1; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type type_; + /** + * optional .org.jetbrains.jet.descriptors.serialization.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 boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.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 org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type getType() { + return type_; + } + + // optional sint64 int_value = 2; + public static final int INT_VALUE_FIELD_NUMBER = 2; + private long intValue_; + /** + * optional sint64 int_value = 2; + */ + public boolean hasIntValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional sint64 int_value = 2; + */ + public long getIntValue() { + return intValue_; + } + + // optional float float_value = 3; + public static final int FLOAT_VALUE_FIELD_NUMBER = 3; + private float floatValue_; + /** + * optional float float_value = 3; + */ + public boolean hasFloatValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional float float_value = 3; + */ + public float getFloatValue() { + return floatValue_; + } + + // optional double double_value = 4; + public static final int DOUBLE_VALUE_FIELD_NUMBER = 4; + private double doubleValue_; + /** + * optional double double_value = 4; + */ + public boolean hasDoubleValue() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional double double_value = 4; + */ + public double getDoubleValue() { + return doubleValue_; + } + + // optional int32 string_value = 5; + public static final int STRING_VALUE_FIELD_NUMBER = 5; + private int stringValue_; + /** + * optional int32 string_value = 5; + * + *
+         * id in StringTable
+         * 
+ */ + public boolean hasStringValue() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 string_value = 5; + * + *
+         * id in StringTable
+         * 
+ */ + public int getStringValue() { + return stringValue_; + } + + // optional int32 class_id = 6; + public static final int CLASS_ID_FIELD_NUMBER = 6; + private int classId_; + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+         * 
+ */ + public boolean hasClassId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 class_id = 6; + * + *
+         * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+         * 
+ */ + public int getClassId() { + return classId_; + } + + // optional int32 enum_value_id = 7; + public static final int ENUM_VALUE_ID_FIELD_NUMBER = 7; + private int enumValueId_; + /** + * optional int32 enum_value_id = 7; + * + *
+         * id in StringTable
+         * 
+ */ + public boolean hasEnumValueId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 enum_value_id = 7; + * + *
+         * id in StringTable
+         * 
+ */ + public int getEnumValueId() { + return enumValueId_; + } + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + public static final int ANNOTATION_FIELD_NUMBER = 8; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation annotation_; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public boolean hasAnnotation() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation getAnnotation() { + return annotation_; + } + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + public static final int ARRAY_ELEMENT_FIELD_NUMBER = 9; + private java.util.List arrayElement_; + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public java.util.List getArrayElementList() { + return arrayElement_; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public java.util.List + getArrayElementOrBuilderList() { + return arrayElement_; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public int getArrayElementCount() { + return arrayElement_.size(); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { + return arrayElement_.get(index); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.ValueOrBuilder getArrayElementOrBuilder( + int index) { + return arrayElement_.get(index); + } + + private void initFields() { + type_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + intValue_ = 0L; + floatValue_ = 0F; + doubleValue_ = 0D; + stringValue_ = 0; + classId_ = 0; + enumValueId_ = 0; + annotation_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance(); + arrayElement_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + 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; + } + + 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)); + } + } + + 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, 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)); + } + 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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value, Builder> + implements org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.ValueOrBuilder { + // Construct using org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + type_ = org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000080); + arrayElement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value getDefaultInstanceForType() { + return org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value build() { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value buildPartial() { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value result = new org.jetbrains.jet.descriptors.serialization.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_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value other) { + if (other == org.jetbrains.jet.descriptors.serialization.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_); + } + + } + return this; + } + + 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; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value.Type type = 1; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type type_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + /** + * optional .org.jetbrains.jet.descriptors.serialization.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 boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.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 org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type getType() { + return type_; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value; + + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Type.BYTE; + + return this; + } + + // optional sint64 int_value = 2; + private long intValue_ ; + /** + * optional sint64 int_value = 2; + */ + public boolean hasIntValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional sint64 int_value = 2; + */ + 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; + } + + // optional float float_value = 3; + private float floatValue_ ; + /** + * optional float float_value = 3; + */ + public boolean hasFloatValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional float float_value = 3; + */ + 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; + } + + // optional double double_value = 4; + private double doubleValue_ ; + /** + * optional double double_value = 4; + */ + public boolean hasDoubleValue() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional double double_value = 4; + */ + 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; + } + + // optional int32 string_value = 5; + private int stringValue_ ; + /** + * optional int32 string_value = 5; + * + *
+           * id in StringTable
+           * 
+ */ + public boolean hasStringValue() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 string_value = 5; + * + *
+           * id in StringTable
+           * 
+ */ + public int getStringValue() { + return stringValue_; + } + /** + * optional int32 string_value = 5; + * + *
+           * id in StringTable
+           * 
+ */ + public Builder setStringValue(int value) { + bitField0_ |= 0x00000010; + stringValue_ = value; + + return this; + } + /** + * optional int32 string_value = 5; + * + *
+           * id in StringTable
+           * 
+ */ + public Builder clearStringValue() { + bitField0_ = (bitField0_ & ~0x00000010); + stringValue_ = 0; + + return this; + } + + // optional int32 class_id = 6; + private int classId_ ; + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+           * 
+ */ + public boolean hasClassId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id of the enum class
+           * 
+ */ + public int getClassId() { + return classId_; + } + /** + * optional int32 class_id = 6; + * + *
+           * If type = CLASS, FQ name id of the referenced class; if type = ENUM, FQ name id 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 id of the referenced class; if type = ENUM, FQ name id of the enum class
+           * 
+ */ + public Builder clearClassId() { + bitField0_ = (bitField0_ & ~0x00000020); + classId_ = 0; + + return this; + } + + // optional int32 enum_value_id = 7; + private int enumValueId_ ; + /** + * optional int32 enum_value_id = 7; + * + *
+           * id in StringTable
+           * 
+ */ + public boolean hasEnumValueId() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 enum_value_id = 7; + * + *
+           * id in StringTable
+           * 
+ */ + public int getEnumValueId() { + return enumValueId_; + } + /** + * optional int32 enum_value_id = 7; + * + *
+           * id in StringTable
+           * 
+ */ + public Builder setEnumValueId(int value) { + bitField0_ |= 0x00000040; + enumValueId_ = value; + + return this; + } + /** + * optional int32 enum_value_id = 7; + * + *
+           * id in StringTable
+           * 
+ */ + public Builder clearEnumValueId() { + bitField0_ = (bitField0_ & ~0x00000040); + enumValueId_ = 0; + + return this; + } + + // optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation annotation_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance(); + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public boolean hasAnnotation() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation getAnnotation() { + return annotation_; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public Builder setAnnotation(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation value) { + if (value == null) { + throw new NullPointerException(); + } + annotation_ = value; + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public Builder setAnnotation( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Builder builderForValue) { + annotation_ = builderForValue.build(); + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public Builder mergeAnnotation(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation value) { + if (((bitField0_ & 0x00000080) == 0x00000080) && + annotation_ != org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance()) { + annotation_ = + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.newBuilder(annotation_).mergeFrom(value).buildPartial(); + } else { + annotation_ = value; + } + + bitField0_ |= 0x00000080; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Annotation annotation = 8; + */ + public Builder clearAnnotation() { + annotation_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + 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.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public java.util.List getArrayElementList() { + return java.util.Collections.unmodifiableList(arrayElement_); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public int getArrayElementCount() { + return arrayElement_.size(); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value getArrayElement(int index) { + return arrayElement_.get(index); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder setArrayElement( + int index, org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder setArrayElement( + int index, org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + ensureArrayElementIsMutable(); + arrayElement_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + int index, org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArrayElementIsMutable(); + arrayElement_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + ensureArrayElementIsMutable(); + arrayElement_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addArrayElement( + int index, org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + ensureArrayElementIsMutable(); + arrayElement_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder addAllArrayElement( + java.lang.Iterable values) { + ensureArrayElementIsMutable(); + super.addAll(values, arrayElement_); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder clearArrayElement() { + arrayElement_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value array_element = 9; + */ + public Builder removeArrayElement(int index) { + ensureArrayElementIsMutable(); + arrayElement_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value) + } + + static { + defaultInstance = new Value(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value) + } + + private int bitField0_; + // required int32 name_id = 1; + public static final int NAME_ID_FIELD_NUMBER = 1; + private int nameId_; + /** + * required int32 name_id = 1; + * + *
+       * id in StringTable
+       * 
+ */ + public boolean hasNameId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 name_id = 1; + * + *
+       * id in StringTable
+       * 
+ */ + public int getNameId() { + return nameId_; + } + + // required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + public static final int VALUE_FIELD_NUMBER = 2; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value value_; + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value getValue() { + return value_; + } + + private void initFields() { + nameId_ = 0; + value_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasNameId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasValue()) { + memoizedIsInitialized = 0; + return false; + } + if (!getValue().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, nameId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, value_); + } + } + + 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, nameId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, value_); + } + 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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation.Argument} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument, Builder> + implements org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.ArgumentOrBuilder { + // Construct using org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument getDefaultInstanceForType() { + return org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.getDefaultInstance(); + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument build() { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument buildPartial() { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument result = new org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument other) { + if (other == org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.getDefaultInstance()) return this; + if (other.hasNameId()) { + setNameId(other.getNameId()); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + 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.jet.descriptors.serialization.ProtoBuf.Annotation.Argument parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required int32 name_id = 1; + private int nameId_ ; + /** + * required int32 name_id = 1; + * + *
+         * id in StringTable
+         * 
+ */ + public boolean hasNameId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 name_id = 1; + * + *
+         * id in StringTable
+         * 
+ */ + public int getNameId() { + return nameId_; + } + /** + * required int32 name_id = 1; + * + *
+         * id in StringTable
+         * 
+ */ + public Builder setNameId(int value) { + bitField0_ |= 0x00000001; + nameId_ = value; + + return this; + } + /** + * required int32 name_id = 1; + * + *
+         * id in StringTable
+         * 
+ */ + public Builder clearNameId() { + bitField0_ = (bitField0_ & ~0x00000001); + nameId_ = 0; + + return this; + } + + // required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value value_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value getValue() { + return value_; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public Builder setValue(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public Builder setValue( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.Builder builderForValue) { + value_ = builderForValue.build(); + + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public Builder mergeValue(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value value) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + value_ != org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.getDefaultInstance()) { + value_ = + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.newBuilder(value_).mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.jetbrains.jet.descriptors.serialization.Annotation.Argument.Value value = 2; + */ + public Builder clearValue() { + value_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Value.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument) + } + + static { + defaultInstance = new Argument(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.Annotation.Argument) + } + + private int bitField0_; + // required int32 id = 1; + public static final int ID_FIELD_NUMBER = 1; + private int id_; + /** + * required int32 id = 1; + * + *
+     * Class FQ name id
+     * 
+ */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 id = 1; + * + *
+     * Class FQ name id
+     * 
+ */ + public int getId() { + return id_; + } + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + public static final int ARGUMENT_FIELD_NUMBER = 2; + private java.util.List argument_; + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public java.util.List getArgumentList() { + return argument_; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public java.util.List + getArgumentOrBuilderList() { + return argument_; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument getArgument(int index) { + return argument_.get(index); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.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 isInitialized == 1; + + 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)); + } + } + + 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)); + } + 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.jet.descriptors.serialization.ProtoBuf.Annotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Annotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation, Builder> + implements org.jetbrains.jet.descriptors.serialization.ProtoBuf.AnnotationOrBuilder { + // Construct using org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation getDefaultInstanceForType() { + return org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.getDefaultInstance(); + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation build() { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation buildPartial() { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation result = new org.jetbrains.jet.descriptors.serialization.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.jet.descriptors.serialization.ProtoBuf.Annotation other) { + if (other == org.jetbrains.jet.descriptors.serialization.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_); + } + + } + 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.jet.descriptors.serialization.ProtoBuf.Annotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required int32 id = 1; + private int id_ ; + /** + * required int32 id = 1; + * + *
+       * Class FQ name id
+       * 
+ */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 id = 1; + * + *
+       * Class FQ name id
+       * 
+ */ + public int getId() { + return id_; + } + /** + * required int32 id = 1; + * + *
+       * Class FQ name id
+       * 
+ */ + public Builder setId(int value) { + bitField0_ |= 0x00000001; + id_ = value; + + return this; + } + /** + * required int32 id = 1; + * + *
+       * Class FQ name id
+       * 
+ */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0; + + return this; + } + + // repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + 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.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public java.util.List getArgumentList() { + return java.util.Collections.unmodifiableList(argument_); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument getArgument(int index) { + return argument_.get(index); + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder setArgument( + int index, org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder setArgument( + int index, org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addArgument(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addArgument( + int index, org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentIsMutable(); + argument_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addArgument( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addArgument( + int index, org.jetbrains.jet.descriptors.serialization.ProtoBuf.Annotation.Argument.Builder builderForValue) { + ensureArgumentIsMutable(); + argument_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder addAllArgument( + java.lang.Iterable values) { + ensureArgumentIsMutable(); + super.addAll(values, argument_); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder clearArgument() { + argument_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + /** + * repeated .org.jetbrains.jet.descriptors.serialization.Annotation.Argument argument = 2; + */ + public Builder removeArgument(int index) { + ensureArgumentIsMutable(); + argument_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Annotation) + } + + static { + defaultInstance = new Annotation(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.Annotation) + } + public interface TypeOrBuilder extends com.google.protobuf.MessageLiteOrBuilder { @@ -4668,8 +7249,9 @@ public final class ProtoBuf { // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.TypeParameter) } - public interface ClassOrBuilder - extends com.google.protobuf.MessageLiteOrBuilder { + public interface ClassOrBuilder extends + com.google.protobuf.GeneratedMessageLite. + ExtendableMessageOrBuilder { // optional int32 flags = 1 [default = 0]; /** @@ -4864,10 +7446,10 @@ public final class ProtoBuf { * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Class} */ public static final class Class extends - com.google.protobuf.GeneratedMessageLite - implements ClassOrBuilder { + com.google.protobuf.GeneratedMessageLite.ExtendableMessage< + Class> implements ClassOrBuilder { // Use Class.newBuilder() to construct. - private Class(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Class(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder builder) { super(builder); } @@ -6396,6 +8978,10 @@ public final class ProtoBuf { return false; } } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -6403,6 +8989,9 @@ public final class ProtoBuf { 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_); } @@ -6433,6 +9022,7 @@ public final class ProtoBuf { if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeMessage(13, primaryConstructor_); } + extensionWriter.writeUntil(200, output); } private int memoizedSerializedSize = -1; @@ -6491,6 +9081,7 @@ public final class ProtoBuf { size += com.google.protobuf.CodedOutputStream .computeMessageSize(13, primaryConstructor_); } + size += extensionsSerializedSize(); memoizedSerializedSize = size; return size; } @@ -6566,9 +9157,8 @@ public final class ProtoBuf { * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Class} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class, Builder> - implements org.jetbrains.jet.descriptors.serialization.ProtoBuf.ClassOrBuilder { + com.google.protobuf.GeneratedMessageLite.ExtendableBuilder< + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class, Builder> implements org.jetbrains.jet.descriptors.serialization.ProtoBuf.ClassOrBuilder { // Construct using org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.newBuilder() private Builder() { maybeForceBuilderInitialization(); @@ -6743,6 +9333,7 @@ public final class ProtoBuf { if (other.hasPrimaryConstructor()) { mergePrimaryConstructor(other.getPrimaryConstructor()); } + this.mergeExtensionFields(other); return this; } @@ -6781,6 +9372,10 @@ public final class ProtoBuf { return false; } } + if (!extensionsAreInitialized()) { + + return false; + } return true; } diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/SerializerExtension.java b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/SerializerExtension.java index 516e2d6713f..d443c22ebe1 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/SerializerExtension.java +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/SerializerExtension.java @@ -18,12 +18,20 @@ package org.jetbrains.jet.descriptors.serialization; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor; +import org.jetbrains.jet.lang.descriptors.ClassDescriptor; import org.jetbrains.jet.lang.descriptors.PackageFragmentDescriptor; import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; import java.util.Collection; public abstract class SerializerExtension { + public void serializeClass( + @NotNull ClassDescriptor descriptor, + @NotNull ProtoBuf.Class.Builder proto, + @NotNull StringTable stringTable + ) { + } + public void serializePackage( @NotNull Collection packageFragments, @NotNull ProtoBuf.Package.Builder proto, diff --git a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/AnnotationAndConstantLoader.java b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/AnnotationAndConstantLoader.java index b4c5c753522..bee47d52104 100644 --- a/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/AnnotationAndConstantLoader.java +++ b/core/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/AnnotationAndConstantLoader.java @@ -20,63 +20,10 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.descriptors.serialization.NameResolver; import org.jetbrains.jet.descriptors.serialization.ProtoBuf; -import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; -import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; import java.util.List; public interface AnnotationAndConstantLoader { - AnnotationAndConstantLoader> UNSUPPORTED = - new AnnotationAndConstantLoader>() { - @NotNull - @Override - public List loadClassAnnotations( - @NotNull ProtoBuf.Class classProto, - @NotNull NameResolver nameResolver - ) { - return annotationsNotSupported(); - } - - @NotNull - @Override - public List loadCallableAnnotations( - @NotNull ProtoContainer container, - @NotNull ProtoBuf.Callable proto, - @NotNull NameResolver nameResolver, - @NotNull AnnotatedCallableKind kind - ) { - return annotationsNotSupported(); - } - - @NotNull - @Override - public List loadValueParameterAnnotations( - @NotNull ProtoContainer container, - @NotNull ProtoBuf.Callable callable, - @NotNull NameResolver nameResolver, - @NotNull AnnotatedCallableKind kind, - @NotNull ProtoBuf.Callable.ValueParameter proto - ) { - return annotationsNotSupported(); - } - - @Nullable - @Override - public CompileTimeConstant loadPropertyConstant( - @NotNull ProtoContainer container, - @NotNull ProtoBuf.Callable proto, - @NotNull NameResolver nameResolver, - @NotNull AnnotatedCallableKind kind - ) { - throw new UnsupportedOperationException("Constants are not supported"); - } - - @NotNull - private List annotationsNotSupported() { - throw new UnsupportedOperationException("Annotations are not supported"); - } - }; - @NotNull List loadClassAnnotations( @NotNull ProtoBuf.Class classProto,