Adding most recent work

pull/8272/head
Deanna Garcia 4 years ago
parent f25ca77c7f
commit be2f000c96
  1. 15
      java/core/generate-test-sources-build.xml
  2. 274
      java/core/output.txt
  3. 44
      java/core/pom.xml
  4. 27
      java/core/src/main/kotlin/com/google/protobuf/DslList.kt
  5. 30
      java/core/src/main/kotlin/com/google/protobuf/DslMap.kt
  6. 12
      java/core/src/main/kotlin/com/google/protobuf/DslProxy.kt
  7. 26
      java/core/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt
  8. 27
      java/core/src/main/kotlin/com/google/protobuf/ExtensionList.kt
  9. 18
      java/core/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt
  10. 10
      java/core/src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt
  11. 39
      java/core/src/main/kotlin/com/google/protobuf/UnmodifiableCollections.kt
  12. 152
      java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt
  13. 5
      java/core/src/test/proto/com/google/protobuf/evil_names_proto2.proto
  14. 0
      java/core/src/test/proto/com/google/protobuf/evil_names_proto3.proto
  15. 0
      java/core/src/test/proto/com/google/protobuf/mutliple_files_proto3.proto
  16. 0
      java/core/src/test/proto/com/google/protobuf/test.proto
  17. 7
      java/lite/generate-test-sources-build.xml
  18. 20
      java/lite/pom.xml
  19. 0
      java/lite/src/test/kotlin/com/google/protobuf/ExtendableMessageLiteExtensionsTest.kt
  20. 0
      java/lite/src/test/kotlin/com/google/protobuf/Proto2LiteTest.kt
  21. 6
      java/lite/target/antrun/build-main.xml
  22. BIN
      java/lite/target/classes/com/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream.class
  23. BIN
      java/lite/target/classes/com/google/protobuf/AbstractMessageLite$Builder.class
  24. BIN
      java/lite/target/classes/com/google/protobuf/AbstractMessageLite$InternalOneOfEnum.class
  25. BIN
      java/lite/target/classes/com/google/protobuf/AbstractMessageLite.class
  26. BIN
      java/lite/target/classes/com/google/protobuf/AbstractParser.class
  27. BIN
      java/lite/target/classes/com/google/protobuf/AbstractProtobufList.class
  28. BIN
      java/lite/target/classes/com/google/protobuf/AllocatedBuffer$1.class
  29. BIN
      java/lite/target/classes/com/google/protobuf/AllocatedBuffer$2.class
  30. BIN
      java/lite/target/classes/com/google/protobuf/AllocatedBuffer.class
  31. BIN
      java/lite/target/classes/com/google/protobuf/Android.class
  32. BIN
      java/lite/target/classes/com/google/protobuf/Any$1.class
  33. BIN
      java/lite/target/classes/com/google/protobuf/Any$Builder.class
  34. BIN
      java/lite/target/classes/com/google/protobuf/Any.class
  35. BIN
      java/lite/target/classes/com/google/protobuf/AnyOrBuilder.class
  36. BIN
      java/lite/target/classes/com/google/protobuf/AnyProto.class
  37. BIN
      java/lite/target/classes/com/google/protobuf/Api$1.class
  38. BIN
      java/lite/target/classes/com/google/protobuf/Api$Builder.class
  39. BIN
      java/lite/target/classes/com/google/protobuf/Api.class
  40. BIN
      java/lite/target/classes/com/google/protobuf/ApiOrBuilder.class
  41. BIN
      java/lite/target/classes/com/google/protobuf/ApiProto.class
  42. BIN
      java/lite/target/classes/com/google/protobuf/ArrayDecoders$1.class
  43. BIN
      java/lite/target/classes/com/google/protobuf/ArrayDecoders$Registers.class
  44. BIN
      java/lite/target/classes/com/google/protobuf/ArrayDecoders.class
  45. BIN
      java/lite/target/classes/com/google/protobuf/BinaryReader$1.class
  46. BIN
      java/lite/target/classes/com/google/protobuf/BinaryReader$SafeHeapReader.class
  47. BIN
      java/lite/target/classes/com/google/protobuf/BinaryReader.class
  48. BIN
      java/lite/target/classes/com/google/protobuf/BinaryWriter$1.class
  49. BIN
      java/lite/target/classes/com/google/protobuf/BinaryWriter$SafeDirectWriter.class
  50. BIN
      java/lite/target/classes/com/google/protobuf/BinaryWriter$SafeHeapWriter.class
  51. BIN
      java/lite/target/classes/com/google/protobuf/BinaryWriter$UnsafeDirectWriter.class
  52. BIN
      java/lite/target/classes/com/google/protobuf/BinaryWriter$UnsafeHeapWriter.class
  53. BIN
      java/lite/target/classes/com/google/protobuf/BinaryWriter.class
  54. BIN
      java/lite/target/classes/com/google/protobuf/BoolValue$1.class
  55. BIN
      java/lite/target/classes/com/google/protobuf/BoolValue$Builder.class
  56. BIN
      java/lite/target/classes/com/google/protobuf/BoolValue.class
  57. BIN
      java/lite/target/classes/com/google/protobuf/BoolValueOrBuilder.class
  58. BIN
      java/lite/target/classes/com/google/protobuf/BooleanArrayList.class
  59. BIN
      java/lite/target/classes/com/google/protobuf/BufferAllocator$1.class
  60. BIN
      java/lite/target/classes/com/google/protobuf/BufferAllocator.class
  61. BIN
      java/lite/target/classes/com/google/protobuf/ByteBufferWriter.class
  62. BIN
      java/lite/target/classes/com/google/protobuf/ByteOutput.class
  63. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$1.class
  64. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$2.class
  65. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$AbstractByteIterator.class
  66. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$ArraysByteArrayCopier.class
  67. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$BoundedByteString.class
  68. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$ByteArrayCopier.class
  69. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$ByteIterator.class
  70. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$CodedBuilder.class
  71. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$LeafByteString.class
  72. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$LiteralByteString.class
  73. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$Output.class
  74. BIN
      java/lite/target/classes/com/google/protobuf/ByteString$SystemByteArrayCopier.class
  75. BIN
      java/lite/target/classes/com/google/protobuf/ByteString.class
  76. BIN
      java/lite/target/classes/com/google/protobuf/BytesValue$1.class
  77. BIN
      java/lite/target/classes/com/google/protobuf/BytesValue$Builder.class
  78. BIN
      java/lite/target/classes/com/google/protobuf/BytesValue.class
  79. BIN
      java/lite/target/classes/com/google/protobuf/BytesValueOrBuilder.class
  80. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStream$1.class
  81. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStream$ArrayDecoder.class
  82. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStream$IterableDirectByteBufferDecoder.class
  83. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStream$StreamDecoder$RefillCallback.class
  84. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStream$StreamDecoder$SkippedDataSink.class
  85. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStream$StreamDecoder.class
  86. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStream$UnsafeDirectNioDecoder.class
  87. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStream.class
  88. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStreamReader$1.class
  89. BIN
      java/lite/target/classes/com/google/protobuf/CodedInputStreamReader.class
  90. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$1.class
  91. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$AbstractBufferedEncoder.class
  92. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$ArrayEncoder.class
  93. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$ByteOutputEncoder.class
  94. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$HeapNioEncoder.class
  95. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$OutOfSpaceException.class
  96. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$OutputStreamEncoder.class
  97. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$SafeDirectNioEncoder.class
  98. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream$UnsafeDirectNioEncoder.class
  99. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStream.class
  100. BIN
      java/lite/target/classes/com/google/protobuf/CodedOutputStreamWriter$1.class
  101. Some files were not shown because too many files have changed in this diff Show More

@ -4,6 +4,8 @@
<arg value="--java_out=${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${test.proto.dir}"/>
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_proto2_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_custom_options.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_enormous_descriptor.proto"/>
@ -22,6 +24,8 @@
<arg value="${test.proto.dir}/com/google/protobuf/any_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/cached_field_size_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/deprecated_file.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/field_presence_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/lazy_fields_lite.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/lite_equals_and_hash.proto"/>
@ -44,6 +48,7 @@
<arg value="${test.proto.dir}/com/google/protobuf/proto2_unknown_enum_values.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/proto3_message.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/proto3_message_lite.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/test_bad_identifiers.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/test_check_utf8.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/test_check_utf8_size.proto"/>
@ -58,4 +63,14 @@
<arg value="${test.proto.dir}/com/google/protobuf/nested_extension_lite.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/non_nested_extension_lite.proto"/>
</exec>
<exec executable="${protoc}">
<arg value="--kotlin_out=${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${test.proto.dir}"/>
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_proto2_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
</exec>
</project>

@ -0,0 +1,274 @@
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< com.google.protobuf:protobuf-java >------------------
[INFO] Building Protocol Buffers [Core] 3.14.0
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ protobuf-java ---
[INFO] Deleting /usr/local/google/home/deannagarcia/protobuf/java/core/target
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (generate-sources) @ protobuf-java ---
[INFO] Executing tasks
main:
[echo] Running protoc ...
[mkdir] Created dir: /usr/local/google/home/deannagarcia/protobuf/java/core/target/generated-sources
[INFO] Executed tasks
[INFO]
[INFO] --- build-helper-maven-plugin:1.10:add-source (add-generated-sources) @ protobuf-java ---
[INFO] Source directory: /usr/local/google/home/deannagarcia/protobuf/java/core/target/generated-sources added.
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ protobuf-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 12 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ protobuf-java ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 189 source files to /usr/local/google/home/deannagarcia/protobuf/java/core/target/classes
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[44,32] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[289,18] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[290,13] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[294,53] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[296,32] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[297,33] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[297,54] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[481,13] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[483,28] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[612,31] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[752,37] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java:[877,37] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[102,32] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[405,19] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[1429,19] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[1995,19] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[2567,19] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[4669,19] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[4701,19] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[4881,19] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/MessageSchema.java:[5189,19] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java: Some input files use or override a deprecated API.
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java: Recompile with -Xlint:deprecation for details.
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java: Some input files use unchecked or unsafe operations.
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- kotlin-maven-plugin:1.4.31:compile (compile) @ protobuf-java ---
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt: (8, 2) This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
[WARNING] /usr/local/google/home/deannagarcia/protobuf/java/core/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt: (14, 11) This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (generate-test-sources) @ protobuf-java ---
[INFO] Executing tasks
main:
[mkdir] Created dir: /usr/local/google/home/deannagarcia/protobuf/java/core/target/generated-test-sources
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_file.cc:244] The optimize_for = LITE_RUNTIME option is no longer supported by protobuf Java code generator and is ignored--protoc will always generate full runtime code for Java. To use Java Lite runtime, users should use the Java Lite plugin instead. See:
[exec] https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_file.cc:244] The optimize_for = LITE_RUNTIME option is no longer supported by protobuf Java code generator and is ignored--protoc will always generate full runtime code for Java. To use Java Lite runtime, users should use the Java Lite plugin instead. See:
[exec] https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_file.cc:244] The optimize_for = LITE_RUNTIME option is no longer supported by protobuf Java code generator and is ignored--protoc will always generate full runtime code for Java. To use Java Lite runtime, users should use the Java Lite plugin instead. See:
[exec] https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_file.cc:244] The optimize_for = LITE_RUNTIME option is no longer supported by protobuf Java code generator and is ignored--protoc will always generate full runtime code for Java. To use Java Lite runtime, users should use the Java Lite plugin instead. See:
[exec] https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_file.cc:244] The optimize_for = LITE_RUNTIME option is no longer supported by protobuf Java code generator and is ignored--protoc will always generate full runtime code for Java. To use Java Lite runtime, users should use the Java Lite plugin instead. See:
[exec] https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.int32_field" is conflicting with another field: both repeated field "int32_field" and singular field "int32_field_list" generate the method "getInt32FieldList()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.enum_field" is conflicting with another field: capitalized name of field "enum_field" conflicts with field "EnumField"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.string_field" is conflicting with another field: capitalized name of field "string_field" conflicts with field "StringField"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.bytes_field" is conflicting with another field: capitalized name of field "bytes_field" conflicts with field "BytesField"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.message_field" is conflicting with another field: capitalized name of field "message_field" conflicts with field "MessageField"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.int32_field_count" is conflicting with another field: both repeated field "Int32Field" and singular field "int32_field_count" generate the method "getInt32FieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.enum_field_count" is conflicting with another field: both repeated field "EnumField" and singular field "enum_field_count" generate the method "getEnumFieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.string_field_count" is conflicting with another field: both repeated field "StringField" and singular field "string_field_count" generate the method "getStringFieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.bytes_field_count" is conflicting with another field: both repeated field "BytesField" and singular field "bytes_field_count" generate the method "getBytesFieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.message_field_count" is conflicting with another field: both repeated field "MessageField" and singular field "message_field_count" generate the method "getMessageFieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.Int32Field" is conflicting with another field: both repeated field "Int32Field" and singular field "int32_field_list" generate the method "getInt32FieldList()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.EnumField" is conflicting with another field: both repeated field "EnumField" and singular field "enum_field_count" generate the method "getEnumFieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.StringField" is conflicting with another field: both repeated field "StringField" and singular field "string_field_count" generate the method "getStringFieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.BytesField" is conflicting with another field: both repeated field "BytesField" and singular field "bytes_field_count" generate the method "getBytesFieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.MessageField" is conflicting with another field: both repeated field "MessageField" and singular field "message_field_count" generate the method "getMessageFieldCount()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.int32_field_list" is conflicting with another field: both repeated field "Int32Field" and singular field "int32_field_list" generate the method "getInt32FieldList()"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.field_name" is conflicting with another field: capitalized name of field "field_name" conflicts with field "field__name"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.field__name" is conflicting with another field: capitalized name of field "field_name" conflicts with field "field__name"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames._2conflict" is conflicting with another field: capitalized name of field "_2conflict" conflicts with field "__2conflict"
[exec] [libprotobuf WARNING google/protobuf/compiler/java/java_context.cc:149] field "io_protocol_tests.TestConflictingFieldNames.__2conflict" is conflicting with another field: capitalized name of field "_2conflict" conflicts with field "__2conflict"
[INFO] Executed tasks
[INFO]
[INFO] --- build-helper-maven-plugin:1.10:add-test-source (add-generated-test-sources) @ protobuf-java ---
[INFO] Test Source directory: /usr/local/google/home/deannagarcia/protobuf/java/core/target/generated-test-sources added.
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ protobuf-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ protobuf-java ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 176 source files to /usr/local/google/home/deannagarcia/protobuf/java/core/target/test-classes
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java: Some input files use or override a deprecated API.
[INFO] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- kotlin-maven-plugin:1.4.31:test-compile (test-compile) @ protobuf-java ---
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (452, 52) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (453, 52) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (454, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (455, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (456, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (457, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (458, 54) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (459, 54) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (460, 55) Assignment operators ambiguity:
public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (461, 55) Assignment operators ambiguity:
public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (462, 52) Assignment operators ambiguity:
public operator fun <T> Collection<Float!>.plus(element: Float!): List<Float!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Float!, UnittestProto.TestAllExtensions>.plusAssign(value: Float!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (463, 53) Assignment operators ambiguity:
public operator fun <T> Collection<Double!>.plus(element: Double!): List<Double!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Double!, UnittestProto.TestAllExtensions>.plusAssign(value: Double!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (464, 51) Assignment operators ambiguity:
public operator fun <T> Collection<Boolean!>.plus(element: Boolean!): List<Boolean!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<Boolean!, UnittestProto.TestAllExtensions>.plusAssign(value: Boolean!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (465, 53) Assignment operators ambiguity:
public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (466, 52) Assignment operators ambiguity:
public operator fun <T> Collection<Serializable!>.plus(elements: Iterable<Serializable!>): List<Serializable!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<ByteString!, UnittestProto.TestAllExtensions>.plusAssign(value: ByteString!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (467, 52) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.RepeatedGroup_extension!>.plus(element: UnittestProto.RepeatedGroup_extension!): List<UnittestProto.RepeatedGroup_extension!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.RepeatedGroup_extension!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.RepeatedGroup_extension!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (468, 60) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedMessage!>.plus(element: UnittestProto.TestAllTypes.NestedMessage!): List<UnittestProto.TestAllTypes.NestedMessage!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (470, 61) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.ForeignMessage!>.plus(element: UnittestProto.ForeignMessage!): List<UnittestProto.ForeignMessage!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.ForeignMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.ForeignMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (471, 60) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestImport.ImportMessage!>.plus(element: UnittestImport.ImportMessage!): List<UnittestImport.ImportMessage!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestImport.ImportMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestImport.ImportMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (473, 58) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedMessage!>.plus(element: UnittestProto.TestAllTypes.NestedMessage!): List<UnittestProto.TestAllTypes.NestedMessage!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (475, 57) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedEnum!>.plus(element: UnittestProto.TestAllTypes.NestedEnum!): List<UnittestProto.TestAllTypes.NestedEnum!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (476, 58) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestProto.ForeignEnum!>.plus(element: UnittestProto.ForeignEnum!): List<UnittestProto.ForeignEnum!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestProto.ForeignEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.ForeignEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (477, 57) Assignment operators ambiguity:
public operator fun <T> Collection<UnittestImport.ImportEnum!>.plus(element: UnittestImport.ImportEnum!): List<UnittestImport.ImportEnum!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<UnittestImport.ImportEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestImport.ImportEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (478, 58) Assignment operators ambiguity:
public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt: (479, 51) Assignment operators ambiguity:
public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:22 min
[INFO] Finished at: 2021-03-10T00:24:01Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.4.31:test-compile (test-compile) on project protobuf-java: Compilation failure: Compilation failure:
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[452,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[453,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[454,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[455,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[456,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[457,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[458,54] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[459,54] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[460,55] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Int!>.plus(element: Int!): List<Int!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Int!, UnittestProto.TestAllExtensions>.plusAssign(value: Int!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[461,55] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Long!>.plus(element: Long!): List<Long!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Long!, UnittestProto.TestAllExtensions>.plusAssign(value: Long!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[462,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Float!>.plus(element: Float!): List<Float!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Float!, UnittestProto.TestAllExtensions>.plusAssign(value: Float!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[463,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Double!>.plus(element: Double!): List<Double!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Double!, UnittestProto.TestAllExtensions>.plusAssign(value: Double!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[464,51] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Boolean!>.plus(element: Boolean!): List<Boolean!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<Boolean!, UnittestProto.TestAllExtensions>.plusAssign(value: Boolean!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[465,53] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[466,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<Serializable!>.plus(elements: Iterable<Serializable!>): List<Serializable!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<ByteString!, UnittestProto.TestAllExtensions>.plusAssign(value: ByteString!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[467,52] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.RepeatedGroup_extension!>.plus(element: UnittestProto.RepeatedGroup_extension!): List<UnittestProto.RepeatedGroup_extension!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.RepeatedGroup_extension!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.RepeatedGroup_extension!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[468,60] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedMessage!>.plus(element: UnittestProto.TestAllTypes.NestedMessage!): List<UnittestProto.TestAllTypes.NestedMessage!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[470,61] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.ForeignMessage!>.plus(element: UnittestProto.ForeignMessage!): List<UnittestProto.ForeignMessage!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.ForeignMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.ForeignMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[471,60] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestImport.ImportMessage!>.plus(element: UnittestImport.ImportMessage!): List<UnittestImport.ImportMessage!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestImport.ImportMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestImport.ImportMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[473,58] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedMessage!>.plus(element: UnittestProto.TestAllTypes.NestedMessage!): List<UnittestProto.TestAllTypes.NestedMessage!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedMessage!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedMessage!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[475,57] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.TestAllTypes.NestedEnum!>.plus(element: UnittestProto.TestAllTypes.NestedEnum!): List<UnittestProto.TestAllTypes.NestedEnum!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.TestAllTypes.NestedEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.TestAllTypes.NestedEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[476,58] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestProto.ForeignEnum!>.plus(element: UnittestProto.ForeignEnum!): List<UnittestProto.ForeignEnum!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestProto.ForeignEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestProto.ForeignEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[477,57] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<UnittestImport.ImportEnum!>.plus(element: UnittestImport.ImportEnum!): List<UnittestImport.ImportEnum!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<UnittestImport.ImportEnum!, UnittestProto.TestAllExtensions>.plusAssign(value: UnittestImport.ImportEnum!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[478,58] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] /usr/local/google/home/deannagarcia/protobuf/java/core/src/test/kotlin/com/google/protobuf/Proto2Test.kt:[479,51] Assignment operators ambiguity:
[ERROR] public operator fun <T> Collection<String!>.plus(element: String!): List<String!> defined in kotlin.collections
[ERROR] public final inline operator fun <E> ExtensionList<String!, UnittestProto.TestAllExtensions>.plusAssign(value: String!): Unit defined in protobuf_unittest.TestAllExtensionsKt.Dsl
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@ -16,6 +16,10 @@
efficient yet extensible format.
</description>
<properties>
<kotlin.version>1.4.31</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
@ -42,6 +46,16 @@
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk7</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
<build>
@ -141,7 +155,35 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>compile</id>
<goals> <goal>compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${generated.testsources.dir}</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
<!-- OSGI bundle configuration -->
<plugin>
<groupId>org.apache.felix</groupId>

@ -0,0 +1,27 @@
package com.google.protobuf.kotlin
/**
* A simple wrapper around a [List] with an extra generic parameter that can be used to disambiguate
* extension methods.
*
* <p>This class is used by Kotlin protocol buffer extensions, and its constructor is public only
* because generated message code is in a different compilation unit. Others should not use this
* class directly in any way.
*/
@Suppress("unused") // the unused type parameter
class DslList<E, P : DslProxy> @OnlyForUseByGeneratedProtoCode constructor(
private val delegate: List<E>
) : List<E> by delegate {
override fun iterator(): Iterator<E> = UnmodifiableIterator(delegate.iterator())
override fun listIterator(): ListIterator<E> = UnmodifiableListIterator(delegate.listIterator())
override fun listIterator(index: Int): ListIterator<E> =
UnmodifiableListIterator(delegate.listIterator(index))
override fun equals(other: Any?): Boolean = delegate == other
override fun hashCode(): Int = delegate.hashCode()
override fun toString(): String = delegate.toString()
}

@ -0,0 +1,30 @@
package com.google.protobuf.kotlin
/**
* A simple wrapper around a [Map] with an extra generic parameter that can be used to disambiguate
* extension methods.
*
* <p>This class is used by Kotlin protocol buffer extensions, and its constructor is public only
* because generated message code is in a different compilation unit. Others should not use this
* class directly in any way.
*/
@Suppress("unused") // the unused type parameter
class DslMap<K, V, P : DslProxy> @OnlyForUseByGeneratedProtoCode constructor(
private val delegate: Map<K, V>
) : Map<K, V> by delegate {
// We allocate the wrappers on calls to get, not with lazy {...}, because lazy allocates
// a few objects up front, and any kind of query operation on this object should be rare.
override val entries: Set<Map.Entry<K, V>>
get() = UnmodifiableMapEntries(delegate.entries)
override val keys: Set<K>
get() = UnmodifiableSet(delegate.keys)
override val values: Collection<V>
get() = UnmodifiableCollection(delegate.values)
override fun equals(other: Any?): Boolean = delegate == other
override fun hashCode(): Int = delegate.hashCode()
override fun toString(): String = delegate.toString()
}

@ -0,0 +1,12 @@
package com.google.protobuf.kotlin
/**
* A type meaningful only for its existence, never intended to be instantiated. For example,
* a `DslList<Int, FooProxy>` can be given different extension methods than a
* `DslList<Int, BarProxy>`.
*/
abstract class DslProxy @OnlyForUseByGeneratedProtoCode protected constructor() {
init {
throw UnsupportedOperationException("A DslProxy should never be instantiated")
}
}

@ -0,0 +1,26 @@
package com.google.protobuf.kotlin
import com.google.protobuf.ExtensionLite
import com.google.protobuf.GeneratedMessage
/** Sets the current value of the proto extension in this builder.*/
operator fun <
M : GeneratedMessage.ExtendableMessage<M>,
B : GeneratedMessage.ExtendableBuilder<M, B>,
T
> B.set(extension: ExtensionLite<M, T>, value: T) {
setExtension(extension, value)
}
/** Gets the current value of the proto extension. */
operator fun <
M : GeneratedMessage.ExtendableMessage<M>,
MorBT : GeneratedMessage.ExtendableMessageOrBuilder<M>,
T
> MorBT.get(extension: ExtensionLite<M, T>): T = getExtension(extension)
/** Returns true if the specified extension is set on this builder. */
operator fun <
M : GeneratedMessage.ExtendableMessage<M>,
MorBT : GeneratedMessage.ExtendableMessageOrBuilder<M>
> MorBT.contains(extension: ExtensionLite<M, *>): Boolean = hasExtension(extension)

@ -0,0 +1,27 @@
package com.google.protobuf.kotlin
import com.google.protobuf.ExtensionLite
import com.google.protobuf.MessageLite
/**
* Implementation for ExtensionList and ExtensionListLite. Like [DslList], represents an
* unmodifiable view of a repeated proto field -- in this case, an extension field -- but
* supports querying the extension.
*/
class ExtensionList<E, M : MessageLite> @OnlyForUseByGeneratedProtoCode constructor(
val extension: ExtensionLite<M, List<E>>,
@JvmField private val delegate: List<E>
) : List<E> by delegate {
override fun iterator(): Iterator<E> = UnmodifiableIterator(delegate.iterator())
override fun listIterator(): ListIterator<E> = UnmodifiableListIterator(delegate.listIterator())
override fun listIterator(index: Int): ListIterator<E> =
UnmodifiableListIterator(delegate.listIterator(index))
override fun equals(other: Any?): Boolean = delegate == other
override fun hashCode(): Int = delegate.hashCode()
override fun toString(): String = delegate.toString()
}

@ -0,0 +1,18 @@
package com.google.protobuf.kotlin
/**
* Opt-in annotation to make it difficult to accidentally use APIs only intended for use by proto
* generated code. See https://kotlinlang.org/docs/reference/opt-in-requirements.html for details
* on how this API works.
*/
@RequiresOptIn(
message =
"""
This API is only intended for use by generated protobuf code, the code generator, and their own
tests. If this does not describe your code, you should not be using this API.
""",
level = RequiresOptIn.Level.ERROR
)
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.ANNOTATION_CLASS)
annotation class OnlyForUseByGeneratedProtoCode

@ -0,0 +1,10 @@
package com.google.protobuf.kotlin
/**
* Indicates an API that is part of a DSL to generate protocol buffer messages.
*/
@DslMarker
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
@OnlyForUseByGeneratedProtoCode
annotation class ProtoDslMarker

@ -0,0 +1,39 @@
package com.google.protobuf.kotlin
/** Wraps an [Iterator] and makes it unmodifiable even from Java. */
internal class UnmodifiableIterator<E>(delegate: Iterator<E>) : Iterator<E> by delegate
/** Wraps a [ListIterator] and makes it unmodifiable even from Java. */
internal class UnmodifiableListIterator<E>(
delegate: ListIterator<E>
) : ListIterator<E> by delegate
/** Wraps a [Collection] and makes it unmodifiable even from Java. */
internal open class UnmodifiableCollection<E>(
private val delegate: Collection<E>
) : Collection<E> by delegate {
override fun iterator(): Iterator<E> = UnmodifiableIterator(delegate.iterator())
}
/** Wraps a [Set] and makes it unmodifiable even from Java. */
internal class UnmodifiableSet<E>(
delegate: Collection<E>
) : UnmodifiableCollection<E>(delegate), Set<E>
/** Wraps a [Map.Entry] and makes it unmodifiable even from Java. */
internal class UnmodifiableMapEntry<K, V>(delegate: Map.Entry<K, V>) : Map.Entry<K, V> by delegate
/** Wraps a [Set] of map entries and makes it unmodifiable even from Java. */
internal class UnmodifiableMapEntries<K, V>(
private val delegate: Set<Map.Entry<K, V>>
) : UnmodifiableCollection<Map.Entry<K, V>>(delegate), Set<Map.Entry<K, V>> {
// Is this overkill? Probably.
override fun iterator(): Iterator<Map.Entry<K, V>> {
val itr = delegate.iterator()
return object : Iterator<Map.Entry<K, V>> by itr {
override fun next(): Map.Entry<K, V> = UnmodifiableMapEntry(itr.next())
}
}
}

@ -3,39 +3,39 @@ package com.google.protobuf.kotlin
import com.google.common.truth.Truth.assertThat
import com.google.protobuf.TestUtil
import com.google.protobuf.TestUtil.toBytes
import com.google.protobuf.kotlin.generator.EvilNamesProto2OuterClass.EvilNamesProto2
import com.google.protobuf.kotlin.generator.EvilNamesProto2OuterClass.HardKeywordsAllTypes
import com.google.protobuf.kotlin.generator.EvilNamesProto2OuterClass.Interface
import com.google.protobuf.kotlin.generator.HardKeywordsAllTypesKt
import com.google.protobuf.kotlin.generator.evilNamesProto2
import com.google.protobuf.kotlin.generator.hardKeywordsAllTypes
import com.google.protobuf.kotlin.generator.interface_
import evil_names_proto2.EvilNamesProto2OuterClass.EvilNamesProto2
import evil_names_proto2.EvilNamesProto2OuterClass.HardKeywordsAllTypes
import evil_names_proto2.EvilNamesProto2OuterClass.Interface
import evil_names_proto2.HardKeywordsAllTypesKt
import evil_names_proto2.evilNamesProto2
import evil_names_proto2.hardKeywordsAllTypes
import evil_names_proto2.interface_
import com.google.protobuf.test.UnittestImport.ImportEnum
import com.google.protobuf.test.UnittestImport.ImportMessage
import com.google.protobuf.test.UnittestImportPublic.PublicImportMessage
import com.google.protos.proto2_unittest.MapProto2Unittest.Proto2MapEnum
import com.google.protos.proto2_unittest.MapProto2Unittest.TestEnumMap
import com.google.protos.proto2_unittest.MapProto2Unittest.TestIntIntMap
import com.google.protos.proto2_unittest.MapProto2Unittest.TestMaps
import com.google.protos.proto2_unittest.TestAllTypesKt
import com.google.protos.proto2_unittest.TestAllTypesKt.nestedMessage
import com.google.protos.proto2_unittest.UnittestProto
import com.google.protos.proto2_unittest.UnittestProto.ForeignEnum
import com.google.protos.proto2_unittest.UnittestProto.TestAllTypes
import com.google.protos.proto2_unittest.UnittestProto.TestAllTypes.NestedEnum
import com.google.protos.proto2_unittest.UnittestProto.TestEmptyMessage
import com.google.protos.proto2_unittest.UnittestProto.TestEmptyMessageWithExtensions
import com.google.protos.proto2_unittest.copy
import com.google.protos.proto2_unittest.foreignMessage
import com.google.protos.proto2_unittest.optionalGroupExtension
import com.google.protos.proto2_unittest.repeatedGroupExtension
import com.google.protos.proto2_unittest.testAllExtensions
import com.google.protos.proto2_unittest.testAllTypes
import com.google.protos.proto2_unittest.testEmptyMessage
import com.google.protos.proto2_unittest.testEmptyMessageWithExtensions
import com.google.protos.proto2_unittest.testEnumMap
import com.google.protos.proto2_unittest.testIntIntMap
import com.google.protos.proto2_unittest.testMaps
import protobuf_unittest.MapProto2Unittest.Proto2MapEnum
import protobuf_unittest.MapProto2Unittest.TestEnumMap
import protobuf_unittest.MapProto2Unittest.TestIntIntMap
import protobuf_unittest.MapProto2Unittest.TestMaps
import protobuf_unittest.TestAllTypesKt
import protobuf_unittest.TestAllTypesKt.nestedMessage
import protobuf_unittest.UnittestProto
import protobuf_unittest.UnittestProto.ForeignEnum
import protobuf_unittest.UnittestProto.TestAllTypes
import protobuf_unittest.UnittestProto.TestAllTypes.NestedEnum
import protobuf_unittest.UnittestProto.TestEmptyMessage
import protobuf_unittest.UnittestProto.TestEmptyMessageWithExtensions
import protobuf_unittest.copy
import protobuf_unittest.foreignMessage
import protobuf_unittest.optionalGroupExtension
import protobuf_unittest.repeatedGroupExtension
import protobuf_unittest.testAllExtensions
import protobuf_unittest.testAllTypes
import protobuf_unittest.testEmptyMessage
import protobuf_unittest.testEmptyMessageWithExtensions
import protobuf_unittest.testEnumMap
import protobuf_unittest.testIntIntMap
import protobuf_unittest.testMaps
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@ -44,6 +44,7 @@ import org.junit.runners.JUnit4
class Proto2Test {
@Test
fun testSetters() {
val myInt: Int = 301
assertThat(
testAllTypes {
optionalInt32 = 101
@ -102,7 +103,7 @@ class Proto2Test {
repeatedImportEnum.add(ImportEnum.IMPORT_BAR)
repeatedStringPiece.add("224")
repeatedCord.add("225")
repeatedInt32 += 301
repeatedInt32 += myInt
repeatedInt64 += 302
repeatedUint32 += 303
repeatedUint64 += 304
@ -529,95 +530,6 @@ class Proto2Test {
}
}
@Test
fun testRepeatedExtensionGettersAndSetters() {
testAllExtensions {
this[UnittestProto.repeatedInt32Extension].addAll(listOf(1, 2))
assertThat(this[UnittestProto.repeatedInt32Extension]).isEqualTo(listOf(1, 2))
this[UnittestProto.repeatedInt32Extension] += listOf(3, 4)
assertThat(this[UnittestProto.repeatedInt32Extension]).isEqualTo(listOf(1, 2, 3, 4))
this[UnittestProto.repeatedInt32Extension][0] = 5
assertThat(this[UnittestProto.repeatedInt32Extension]).isEqualTo(listOf(5, 2, 3, 4))
this[UnittestProto.repeatedStringExtension].addAll(listOf("1", "2"))
assertThat(this[UnittestProto.repeatedStringExtension]).isEqualTo(listOf("1", "2"))
this[UnittestProto.repeatedStringExtension] += listOf("3", "4")
assertThat(this[UnittestProto.repeatedStringExtension]).isEqualTo(listOf("1", "2", "3", "4"))
this[UnittestProto.repeatedStringExtension][0] = "5"
assertThat(this[UnittestProto.repeatedStringExtension]).isEqualTo(listOf("5", "2", "3", "4"))
this[UnittestProto.repeatedGroupExtension].addAll(
listOf(
repeatedGroupExtension { a = 1 },
repeatedGroupExtension { a = 2 }
)
)
assertThat(this[UnittestProto.repeatedGroupExtension]).isEqualTo(
listOf(
repeatedGroupExtension { a = 1 },
repeatedGroupExtension { a = 2 }
)
)
this[UnittestProto.repeatedGroupExtension] +=
listOf(
repeatedGroupExtension { a = 3 },
repeatedGroupExtension { a = 4 }
)
assertThat(this[UnittestProto.repeatedGroupExtension]).isEqualTo(
listOf(
repeatedGroupExtension { a = 1 },
repeatedGroupExtension { a = 2 },
repeatedGroupExtension { a = 3 },
repeatedGroupExtension { a = 4 }
)
)
this[UnittestProto.repeatedGroupExtension][0] = repeatedGroupExtension { a = 5 }
assertThat(this[UnittestProto.repeatedGroupExtension]).isEqualTo(
listOf(
repeatedGroupExtension { a = 5 },
repeatedGroupExtension { a = 2 },
repeatedGroupExtension { a = 3 },
repeatedGroupExtension { a = 4 }
)
)
this[UnittestProto.repeatedNestedMessageExtension].addAll(
listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 })
)
assertThat(this[UnittestProto.repeatedNestedMessageExtension]).isEqualTo(
listOf(nestedMessage { bb = 1 }, nestedMessage { bb = 2 })
)
this[UnittestProto.repeatedNestedMessageExtension] +=
listOf(nestedMessage { bb = 3 }, nestedMessage { bb = 4 })
assertThat(this[UnittestProto.repeatedNestedMessageExtension]).isEqualTo(
listOf(
nestedMessage { bb = 1 },
nestedMessage { bb = 2 },
nestedMessage { bb = 3 },
nestedMessage { bb = 4 }
)
)
this[UnittestProto.repeatedNestedMessageExtension][0] = nestedMessage { bb = 5 }
assertThat(this[UnittestProto.repeatedNestedMessageExtension]).isEqualTo(
listOf(
nestedMessage { bb = 5 },
nestedMessage { bb = 2 },
nestedMessage { bb = 3 },
nestedMessage { bb = 4 }
)
)
this[UnittestProto.repeatedNestedEnumExtension]
.addAll(listOf(NestedEnum.FOO, NestedEnum.BAR))
assertThat(this[UnittestProto.repeatedNestedEnumExtension])
.isEqualTo(listOf(NestedEnum.FOO, NestedEnum.BAR))
this[UnittestProto.repeatedNestedEnumExtension] += listOf(NestedEnum.BAZ, NestedEnum.FOO)
assertThat(this[UnittestProto.repeatedNestedEnumExtension]).isEqualTo(
listOf(NestedEnum.FOO, NestedEnum.BAR, NestedEnum.BAZ, NestedEnum.FOO)
)
}
}
@Test
fun testExtensionContains() {
testAllExtensions {

@ -1,9 +1,8 @@
// LINT: LEGACY_NAMES
syntax = "proto2";
package protobuf.kotlin.generator;
package evil_names_proto2;
option java_package = "com.google.protobuf.kotlin.generator";
option java_package = "evil_names_proto2";
message EvilNamesProto2 {
optional bool initialized = 1;

@ -48,4 +48,11 @@
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/test_check_utf8_size.proto"/>
<arg value="${protobuf.basedir}/java/core/${test.proto.dir}/com/google/protobuf/wrappers_test.proto"/>
</exec>
<exec executable="${protoc}">
<arg value="--kotlin_out=lite:${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${protobuf.basedir}/java/core/${test.proto.dir}"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3.proto"/>
</exec>
</project>

@ -323,6 +323,26 @@
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${generated.testsources.dir}</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
<!-- OSGI bundle configuration -->
<plugin>
<groupId>org.apache.felix</groupId>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<project name="maven-antrun-" default="main" >
<target name="main">
<ant antfile="process-lite-sources-build.xml"/>
</target>
</project>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save