diff --git a/.github/scripts/validate_yaml.py b/.github/scripts/validate_yaml.py index bad349819e584..97b930f4e6431 100644 --- a/.github/scripts/validate_yaml.py +++ b/.github/scripts/validate_yaml.py @@ -1,6 +1,6 @@ """Validate the YAML files for GitHub Actions workflows. -TODO: b/359303016 - convert to use unittest +TODO: convert to use unittest """ import os diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index 68de376f9719a..42fabdac85688 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml @@ -59,7 +59,7 @@ jobs: - config: { name: "aarch64", flags: "--platforms=//build_defs:aarch64_linux" } cache_key: aarch64-bazel8 targets: "//src/... //src/google/protobuf/compiler:protoc_aarch64_test //third_party/utf8_range/..." - image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:7.6.1-aarch64-f0d1e209ed9369f69d93ce418990ecff3aa08d6f" #TODO: b/409557730 - upgrade to bazel 8 + image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:7.6.1-aarch64-f0d1e209ed9369f69d93ce418990ecff3aa08d6f" #TODO: upgrade to bazel 8 name: ${{ matrix.config.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.config.name }} runs-on: ${{ matrix.config.runner || 'ubuntu-latest' }} steps: @@ -126,7 +126,7 @@ jobs: id: cross-compile uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v5 with: - image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: b/409557730 - upgrade to bazel 8 + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: upgrade to bazel 8 credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} architecture: linux-${{ matrix.arch }} - name: Setup sccache diff --git a/.github/workflows/test_csharp.yml b/.github/workflows/test_csharp.yml index 9ffcdf8ddbb85..f6ddf5e693105 100644 --- a/.github/workflows/test_csharp.yml +++ b/.github/workflows/test_csharp.yml @@ -23,7 +23,7 @@ jobs: with: ref: ${{ inputs.safe-checkout }} - # TODO Run this with Bazel once codegen is handled properly. + # TODO(b/327464009) Run this with Bazel once codegen is handled properly. - name: Run tests uses: protocolbuffers/protobuf-ci/docker@v5 with: diff --git a/.github/workflows/test_java.yml b/.github/workflows/test_java.yml index edb4b4903e003..36d7c4b793824 100644 --- a/.github/workflows/test_java.yml +++ b/.github/workflows/test_java.yml @@ -31,7 +31,7 @@ jobs: - name: OpenJDK 8 cache_key: '8' image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:8.0.1-8-b77fdae6d4771789dfc66a56bf8d806354e8011a - # TODO: b/318555165 - enable the layering check. Currently it does + # TODO: enable the layering check. Currently it does # not work correctly with the toolchain in this Docker image. targets: //java/... //java/internal:java_version --features=-layering_check flags: --java_language_version=8 @@ -53,7 +53,7 @@ jobs: image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 targets: //java/... //java/internal:java_version //compatibility/... flags: --noenable_bzlmod - # TODO: b/395623141 - restore this test once runtime uses / emulates aarch64. + # TODO: restore this test once runtime uses / emulates aarch64. # - name: aarch64 # cache_key: 'aarch64' # image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:7.6.1-aarch64-f0d1e209ed9369f69d93ce418990ecff3aa08d6f @@ -76,7 +76,7 @@ jobs: bazel-cache: java_linux/${{ matrix.cache_key }} bazel: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_JAVA_VERSION -# TODO restore this test (or a better one) when gRPC has rebuilt with 26.x +# TODO(b/311232187) restore this test (or a better one) when gRPC has rebuilt with 26.x # linkage-monitor: # name: Linux Linkage Monitor # runs-on: ubuntu-latest @@ -91,7 +91,7 @@ jobs: # image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:8-1fdbb997433cb22c1e49ef75ad374a8d6bb88702 # credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} # bazel-cache: java_linux/8 - # # TODO: b/318555165 - enable the layering check. Currently it does + # # TODO: enable the layering check. Currently it does # # not work correctly with the toolchain in this Docker image. # bazel: test --test_output=all //java:linkage_monitor --spawn_strategy=standalone --features=-layering_check diff --git a/.github/workflows/test_php.yml b/.github/workflows/test_php.yml index 4bc9d11b9e2b0..3996520d6221c 100644 --- a/.github/workflows/test_php.yml +++ b/.github/workflows/test_php.yml @@ -115,7 +115,7 @@ jobs: id: cross-compile uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v5 with: - image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: b/409557730 - upgrade to bazel 8.0.1 + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: upgrade to bazel 8.0.1 credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} architecture: linux-i386 @@ -147,7 +147,7 @@ jobs: id: cross-compile uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v5 with: - image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: b/409557730 - upgrade to bazel 8.0.1 + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: upgrade to bazel 8.0.1 credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} architecture: linux-aarch64 @@ -205,7 +205,7 @@ jobs: with: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-version: 8.0.1 - # TODO this shouldn't be necessary, remove it + # TODO(b/467211650) this shouldn't be necessary, remove it bazel-flags: --xcode_version_config=//.github:host_xcodes_macos15 command: | pushd php diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index f071bbc63429d..6df748fb2088f 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -52,7 +52,7 @@ jobs: - type: C++ version: aarch64 targets: //python/... //python:aarch64_test - # TODO Enable this once conformance tests are fixed. + # TODO(b/262628111) Enable this once conformance tests are fixed. flags: --define=use_fast_cpp_protos=true --test_tag_filters=-conformance image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:7.6.1-aarch64-f0d1e209ed9369f69d93ce418990ecff3aa08d6f diff --git a/.github/workflows/test_ruby.yml b/.github/workflows/test_ruby.yml index 7e874f432e40c..5e1f1bc38c176 100644 --- a/.github/workflows/test_ruby.yml +++ b/.github/workflows/test_ruby.yml @@ -77,7 +77,7 @@ jobs: id: cross-compile uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v5 with: - image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: b/409557730 - upgrade to bazel 8.0.1 + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: upgrade to bazel 8.0.1 credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} architecture: linux-i386 @@ -110,7 +110,7 @@ jobs: id: cross-compile uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v5 with: - image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: b/409557730 - upgrade to bazel 8.0.1 + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604 #TODO: upgrade to bazel 8.0.1 credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} architecture: linux-aarch64 diff --git a/ci/common.bazelrc b/ci/common.bazelrc index 879f7d4ef49a0..09aa64aac3aa8 100644 --- a/ci/common.bazelrc +++ b/ci/common.bazelrc @@ -6,7 +6,7 @@ build:dbg --compilation_mode=dbg build:opt --compilation_mode=opt build:san-common --config=dbg --strip=never --copt=-O1 --copt=-fno-omit-frame-pointer -# TODO ASAN hits ODR violations with shared linkage due to +# TODO(b/392921707) ASAN hits ODR violations with shared linkage due to # cc_proto_library cyclic dependency. build:san-common --dynamic_mode=off diff --git a/cmake/upb_generators.cmake b/cmake/upb_generators.cmake index 7a55f851ed32f..fdc7022c45e4a 100644 --- a/cmake/upb_generators.cmake +++ b/cmake/upb_generators.cmake @@ -18,7 +18,7 @@ foreach(generator upb upbdefs upb_minitable) protobuf_configure_target(protoc-gen-${generator}) target_include_directories(protoc-gen-${generator} PRIVATE ${bootstrap_cmake_dir}) if(protobuf_BUILD_SHARED_LIBS) - # TODO These binaries should depend on libprotoc. + # TODO(b/419096242) These binaries should depend on libprotoc. target_compile_definitions(protoc-gen-${generator} PRIVATE LIBPROTOC_EXPORTS PROTOBUF_USE_DLLS) endif() diff --git a/conformance/testee.h b/conformance/testee.h index 3bff3c5c48c3a..11c238f648468 100644 --- a/conformance/testee.h +++ b/conformance/testee.h @@ -27,7 +27,7 @@ // .SerializeText({.print_unknown_fields = true}), // ParsedPayload(EqualsProto("pb(1: "foo")pb"))); -// TODO Possible future APIs to expand conformance coverage: +// TODO(b/410123876) Possible future APIs to expand conformance coverage: // - Add ClearUnknownFields() to InMemoryMessage // - Add MergeFrom() method to InMemoryMessage to merge raw binary // - Remove && qualifiers on Parse* and add InMemoryMessage::Merge that merges diff --git a/conformance/text_format_conformance_suite.cc b/conformance/text_format_conformance_suite.cc index 9ae03a8a45858..6a07914a1d400 100644 --- a/conformance/text_format_conformance_suite.cc +++ b/conformance/text_format_conformance_suite.cc @@ -160,7 +160,7 @@ TextFormatConformanceTestSuiteImpl:: if (MessageType::GetDescriptor()->name() == "TestAllTypesProto3") { RunAnyTests(); RunOpenEnumTests(); - // TODO Run these over proto2 also. + // TODO(b/302593317) Run these over proto2 also. RunAllTests(); } } diff --git a/csharp/BUILD.bazel b/csharp/BUILD.bazel index 841de247b5b8c..c3f37b8493181 100644 --- a/csharp/BUILD.bazel +++ b/csharp/BUILD.bazel @@ -106,7 +106,7 @@ compile_edition_defaults( minimum_edition = "PROTO2", ) -# TODO Make bazel tests use this output instead of the checked-in one +# TODO(b/376829856) Make bazel tests use this output instead of the checked-in one embed_edition_defaults( name = "embedded_csharp_edition_defaults_generate", defaults = "csharp_edition_defaults", diff --git a/csharp/src/Google.Protobuf/CodedInputStream.cs b/csharp/src/Google.Protobuf/CodedInputStream.cs index d15e84f44648c..8840476d10d7d 100644 --- a/csharp/src/Google.Protobuf/CodedInputStream.cs +++ b/csharp/src/Google.Protobuf/CodedInputStream.cs @@ -638,7 +638,7 @@ internal byte[] ReadRawBytes(int size) /// /// Reads a top-level message or a nested message after the limits for this message have been pushed. /// (parser will proceed until the end of the current limit) - /// NOTE: this method needs to be public because it's invoked by the generated code - e.g. msg.MergeFrom(CodedInputStream input) method + /// NOTE: e.g. msg.MergeFrom(CodedInputStream input) method /// public void ReadRawMessage(IMessage message) { diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index dd9e7b38d1c82..54c43f8d4e51b 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -43,7 +43,7 @@ - + diff --git a/hpb/backend/upb/extension.h b/hpb/backend/upb/extension.h index 578534d79afd8..42aea5a6b12a2 100644 --- a/hpb/backend/upb/extension.h +++ b/hpb/backend/upb/extension.h @@ -126,7 +126,7 @@ struct UpbExtensionTrait { } }; -// TODO: b/375460289 - flesh out non-promotional msg support that does +// TODO: flesh out non-promotional msg support that does // not return an error if missing but the default msg template struct UpbExtensionTrait { diff --git a/hpb/backend/upb/interop.h b/hpb/backend/upb/interop.h index 5bc8d41612fd2..63de6200a3f10 100644 --- a/hpb/backend/upb/interop.h +++ b/hpb/backend/upb/interop.h @@ -32,7 +32,7 @@ namespace hpb::interop::upb { * Warning: any minitable skew will incur arbitrary memory access. Ensuring * minitable compatibility is the responsibility of the caller. */ -// TODO: b/365824801 - consider rename to OwnMessage +// TODO: consider rename to OwnMessage template T MoveMessage(upb_Message* msg, upb_Arena* arena) { return internal::PrivateAccess::InvokeConstructor(msg, arena); @@ -84,8 +84,8 @@ upb_Arena* UnwrapArena(T&& arena) { * The upb message must not be mutated directly while the handle is alive. * * T must match actual type of `msg`. - * TODO: b/361596328 - revisit GetArena for CHandles - * TODO: b/362743843 - consider passing in MiniTable to ensure match + * TODO: revisit GetArena for CHandles + * TODO: consider passing in MiniTable to ensure match */ // REMARK: This overload will be deleted soon. Prefer the overloads that take in // the CMessageType or MiniTable. diff --git a/hpb/backend/upb/repeated_field.h b/hpb/backend/upb/repeated_field.h index 86e0d8a4d8b2a..f144c41467d34 100644 --- a/hpb/backend/upb/repeated_field.h +++ b/hpb/backend/upb/repeated_field.h @@ -94,7 +94,7 @@ class RepeatedFieldProxy (upb_Message*)message_value.msg_val, this->arena_); } - // TODO : Audit/Finalize based on Iterator Design. + // TODO(b:/280069986) : Audit/Finalize based on Iterator Design. // T::Proxy [] operator specialization. template > diff --git a/hpb/extension.h b/hpb/extension.h index 7572ba9a3066c..f281f00fa9ea5 100644 --- a/hpb/extension.h +++ b/hpb/extension.h @@ -76,7 +76,7 @@ class ExtensionRegistry { const ExtensionRegistry& extension_registry); upb_ExtensionRegistry* registry_; #endif - // TODO: b/379100963 - Introduce ShutdownHpbLibrary + // TODO: Introduce ShutdownHpbLibrary static const ExtensionRegistry* NewGeneratedRegistry() { #if HPB_INTERNAL_BACKEND == HPB_INTERNAL_BACKEND_UPB static const upb_GeneratedRegistryRef* registry_ref = diff --git a/hpb_generator/context.h b/hpb_generator/context.h index 3c2e7b06645e9..c42b8f38b608f 100644 --- a/hpb_generator/context.h +++ b/hpb_generator/context.h @@ -98,7 +98,7 @@ class Context final { upb::DefPool pool_; }; -// TODO: b/373438292 - re-house these 4 legacy funcs post io::Printer move +// TODO: re-house these 4 legacy funcs post io::Printer move inline std::string ToCIdent(absl::string_view str) { return absl::StrReplaceAll(str, {{".", "_"}, {"/", "_"}, {"-", "_"}}); } diff --git a/hpb_generator/gen_accessors.cc b/hpb_generator/gen_accessors.cc index d874a18df3c13..a79d06ea1d9aa 100644 --- a/hpb_generator/gen_accessors.cc +++ b/hpb_generator/gen_accessors.cc @@ -93,7 +93,7 @@ void WriteFieldAccessorsInHeader(const google::protobuf::Descriptor* desc, Conte WriteMapFieldAccessors(desc, field, resolved_field_name, resolved_upbc_name, ctx); } else if (desc->options().map_entry()) { - // TODO Implement map entry + // TODO(b/237399867) Implement map entry } else if (field->is_repeated()) { WriteRepeatedFieldsInMessageHeader(desc, field, resolved_field_name, resolved_upbc_name, ctx); @@ -245,7 +245,7 @@ void WriteAccessorsInSource(const google::protobuf::Descriptor* desc, Context& c WriteMapAccessorDefinitions(desc, field, resolved_field_name, class_name, ctx); } else if (desc->options().map_entry()) { - // TODO Implement map entry + // TODO(b/237399867) Implement map entry } else if (field->is_repeated()) { if (field->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE) { WriteRepeatedMessageAccessor(desc, field, resolved_field_name, @@ -699,7 +699,7 @@ void WriteUsingAccessorsInHeader(const google::protobuf::Descriptor* desc, } } } else if (desc->options().map_entry()) { - // TODO Implement map entry + // TODO(b/237399867) Implement map entry } else if (field->is_repeated()) { WriteRepeatedFieldUsingAccessors(field, class_name, resolved_field_name, ctx, read_only); diff --git a/hpb_generator/gen_utils.cc b/hpb_generator/gen_utils.cc index b46fcc5be5b53..36858918b1222 100644 --- a/hpb_generator/gen_utils.cc +++ b/hpb_generator/gen_utils.cc @@ -164,7 +164,7 @@ std::string DefaultValue(const FieldDescriptor* field) { "\"", EscapeTrigraphs(absl::CEscape(field->default_value_string())), "\""); default: - // TODO: b/375460289 - implement rest of scalars + // TODO: implement rest of scalars ABSL_LOG(WARNING) << "Unsupported default value type (in-progress): <" << field->cpp_type_name() << "> For field: " << field->full_name(); diff --git a/java/core/src/main/java/com/google/protobuf/GeneratedMessage.java b/java/core/src/main/java/com/google/protobuf/GeneratedMessage.java index 27979abb9c5b9..a89cdbdbf28a7 100644 --- a/java/core/src/main/java/com/google/protobuf/GeneratedMessage.java +++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessage.java @@ -278,7 +278,7 @@ void setUnknownFields(UnknownFieldSet unknownFields) { /** * Called by subclasses to parse an unknown field. * - *

TODO remove this method + *

TODO(b/248153893) remove this method * * @return {@code true} unless the tag is an end-group tag. */ @@ -298,7 +298,7 @@ protected boolean parseUnknownField( * Delegates to parseUnknownField. This method is obsolete, but we must retain it for * compatibility with older generated code. * - *

TODO remove this method + *

TODO(b/248153893) remove this method */ protected boolean parseUnknownFieldProto3( CodedInputStream input, @@ -1201,7 +1201,7 @@ public void writeUntil(final int end, final CodedOutputStream output) throws IOE /** * For compatibility with older gencode. * - *

TODO Remove this in the next breaking release. + *

TODO(b/346588832) Remove this in the next breaking release. * * @deprecated Use {@link newExtensionSerializer()} instead. */ diff --git a/java/core/src/main/java/com/google/protobuf/Java8Compatibility.java b/java/core/src/main/java/com/google/protobuf/Java8Compatibility.java index 40e807c8069fc..04df57cf171a7 100644 --- a/java/core/src/main/java/com/google/protobuf/Java8Compatibility.java +++ b/java/core/src/main/java/com/google/protobuf/Java8Compatibility.java @@ -13,7 +13,7 @@ * Wrappers around {@link Buffer} methods that are covariantly overridden in Java 9+. See * https://github.com/protocolbuffers/protobuf/issues/11393 * - *

TODO remove when Java 8 support is no longer needed. + *

TODO(b/270454719) remove when Java 8 support is no longer needed. */ final class Java8Compatibility { static void clear(Buffer b) { diff --git a/java/core/src/main/java/com/google/protobuf/LazyFieldLite.java b/java/core/src/main/java/com/google/protobuf/LazyFieldLite.java index 259a909eacaed..253c141884613 100644 --- a/java/core/src/main/java/com/google/protobuf/LazyFieldLite.java +++ b/java/core/src/main/java/com/google/protobuf/LazyFieldLite.java @@ -170,7 +170,7 @@ public int hashCode() { * Determines whether this LazyFieldLite instance represents the default instance of this type. */ public boolean containsDefaultInstance() { - // TODO: b/473034710 - ByteString can be empty but not the same as ByteString.EMPTY. Use + // TODO: ByteString can be empty but not the same as ByteString.EMPTY. Use // `isEmpty()` instead for both `delayedBytes` and `memoizedBytes`. return memoizedBytes == ByteString.EMPTY || (value == null && (delayedBytes == null || delayedBytes == ByteString.EMPTY)) @@ -319,7 +319,7 @@ public void merge(LazyFieldLite other) { // this may result in some extensions being lost that shouldn't have been, but its the // best that we can do if we reach this point and is not expected to occur in real use. if (defaultInstance == null) { - // TODO: b/467739361 - Consider throwing an exception here. + // TODO: Consider throwing an exception here. this.delayedBytes = this.delayedBytes.concat(other.delayedBytes); return; } diff --git a/java/core/src/main/java/com/google/protobuf/MessageSchema.java b/java/core/src/main/java/com/google/protobuf/MessageSchema.java index 9ae7b4e18ccc5..d139c44a20cf1 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageSchema.java +++ b/java/core/src/main/java/com/google/protobuf/MessageSchema.java @@ -3420,7 +3420,7 @@ private > void mergeFromHelper( @SuppressWarnings("ReferenceEquality") static UnknownFieldSetLite getMutableUnknownFields(Object message) { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. UnknownFieldSetLite unknownFields = ((GeneratedMessageLite) message).unknownFields; if (unknownFields == UnknownFieldSetLite.getDefaultInstance()) { @@ -4314,7 +4314,7 @@ public void makeImmutable(T message) { return; } - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. if (message instanceof GeneratedMessageLite) { GeneratedMessageLite generatedMessage = ((GeneratedMessageLite) message); @@ -4690,7 +4690,7 @@ private static boolean isMutable(Object message) { return false; } - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. if (message instanceof GeneratedMessageLite) { return ((GeneratedMessageLite) message).isMutable(); diff --git a/java/core/src/main/java/com/google/protobuf/MessageSetSchema.java b/java/core/src/main/java/com/google/protobuf/MessageSetSchema.java index fde5f9aec2750..a9c6160d05287 100644 --- a/java/core/src/main/java/com/google/protobuf/MessageSetSchema.java +++ b/java/core/src/main/java/com/google/protobuf/MessageSetSchema.java @@ -39,7 +39,7 @@ static MessageSetSchema newSchema( @SuppressWarnings("unchecked") @Override public T newInstance() { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. if (defaultInstance instanceof GeneratedMessageLite) { return (T) ((GeneratedMessageLite) defaultInstance).newMutableInstance(); @@ -116,7 +116,7 @@ private void writeUnknownFieldsHelper( public void mergeFrom( T message, byte[] data, int position, int limit, ArrayDecoders.Registers registers) throws IOException { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. UnknownFieldSetLite unknownFields = ((GeneratedMessageLite) message).unknownFields; if (unknownFields == UnknownFieldSetLite.getDefaultInstance()) { @@ -166,7 +166,7 @@ public void mergeFrom( if (wireType == WireFormat.WIRETYPE_VARINT) { position = ArrayDecoders.decodeVarint32(data, position, registers); typeId = registers.int1; - // TODO decide if we're keeping support for Full in schema classes and + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and // handle this better. extension = (GeneratedMessageLite.GeneratedExtension) diff --git a/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java b/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java index 90451d2e70f48..b3748df4cccfd 100644 --- a/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java +++ b/java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java @@ -11,7 +11,7 @@ final class NewInstanceSchemaLite implements NewInstanceSchema { @Override public Object newInstance(Object defaultInstance) { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. return ((GeneratedMessageLite) defaultInstance).newMutableInstance(); } diff --git a/java/core/src/main/java/com/google/protobuf/Protobuf.java b/java/core/src/main/java/com/google/protobuf/Protobuf.java index 9ee4686782359..d1e0ed30fb1e4 100644 --- a/java/core/src/main/java/com/google/protobuf/Protobuf.java +++ b/java/core/src/main/java/com/google/protobuf/Protobuf.java @@ -20,7 +20,7 @@ final class Protobuf { private final SchemaFactory schemaFactory; - // TODO: b/341207042 - Consider using ClassValue instead. + // TODO: Consider using ClassValue instead. private final ConcurrentMap, Schema> schemaCache = new ConcurrentHashMap, Schema>(); diff --git a/java/core/src/main/java/com/google/protobuf/SchemaUtil.java b/java/core/src/main/java/com/google/protobuf/SchemaUtil.java index 9797f9423b8ae..a0abab4b03fc3 100644 --- a/java/core/src/main/java/com/google/protobuf/SchemaUtil.java +++ b/java/core/src/main/java/com/google/protobuf/SchemaUtil.java @@ -35,7 +35,7 @@ private SchemaUtil() {} * GeneratedMessageLite}. */ public static void requireGeneratedMessage(Class messageType) { - // TODO decide if we're keeping support for Full in schema classes and handle this + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle this // better. if (!GeneratedMessageLite.class.isAssignableFrom(messageType) && !Android.assumeLiteRuntime @@ -824,7 +824,7 @@ private static Class getGeneratedMessageClass() { return null; } try { - // TODO decide if we're keeping support for Full in schema classes and handle + // TODO(b/248560713) decide if we're keeping support for Full in schema classes and handle // this better. return Class.forName("com.google.protobuf.GeneratedMessage"); } catch (Throwable e) { diff --git a/java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto b/java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto index 5c70ed43caaa4..7f65013450913 100644 --- a/java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto +++ b/java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto @@ -157,7 +157,7 @@ service TestConflictingMethodNames { } message TestConflictingFieldNames { - // TODO Remove these tests once this behavior is removed. + // TODO(b/261750190) Remove these tests once this behavior is removed. option deprecated_legacy_json_field_conflicts = true; enum TestEnum { diff --git a/java/util/src/test/java/com/google/protobuf/util/TimestampsTest.java b/java/util/src/test/java/com/google/protobuf/util/TimestampsTest.java index ef59bc7c8da74..b3e77840c17ae 100644 --- a/java/util/src/test/java/com/google/protobuf/util/TimestampsTest.java +++ b/java/util/src/test/java/com/google/protobuf/util/TimestampsTest.java @@ -365,7 +365,7 @@ public void testTimestampInvalidNanoSecond() { public void testTimestampParseInvalidMonth() throws Exception { final String value = "2000-40-01T00:00:00Z"; final String expected = "2003-04-01T00:00:00Z"; - // TODO: b/379874415 - this shouldn't parse successfully + // TODO: this shouldn't parse successfully assertThat(Timestamps.parse(value)).isEqualTo(Timestamps.parse(expected)); assertThat(Timestamps.parseUnchecked(value)).isEqualTo(Timestamps.parse(expected)); } diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index b57183804a985..e72c3b2620aeb 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -229,7 +229,7 @@ cc_dist_library( "//src/google/protobuf/compiler/java:names", "//src/google/protobuf/compiler/objectivec:names", "//src/google/protobuf/compiler/php:names", - # TODO Make these private in the next breaking C++ release. + # TODO(b/395949071) Make these private in the next breaking C++ release. "//src/google/protobuf/compiler/cpp:generator_headers", "//src/google/protobuf/compiler/csharp:generator_headers", "//src/google/protobuf/compiler/java:generator_headers", diff --git a/python/descriptor.c b/python/descriptor.c index a46ac1e8b55f3..fc42c5eebdb58 100644 --- a/python/descriptor.c +++ b/python/descriptor.c @@ -167,7 +167,7 @@ static PyObject* PyUpb_DescriptorBase_GetSerializedProto( size_t size; char* pb; upb_EncodeStatus status = upb_Encode(proto, layout, 0, arena, &pb, &size); - if (status) goto oom; // TODO non-oom errors are possible here + if (status) goto oom; // TODO(b/235839510) non-oom errors are possible here PyObject* str = PyBytes_FromStringAndSize(pb, size); upb_Arena_Free(arena); return str; @@ -1180,7 +1180,7 @@ static PyGetSetDef PyUpb_FieldDescriptor_Getters[] = { {"has_default_value", (getter)PyUpb_FieldDescriptor_HasDefaultValue}, {"is_extension", (getter)PyUpb_FieldDescriptor_GetIsExtension, NULL, "ID"}, {"is_packed", (getter)PyUpb_FieldDescriptor_GetIsPacked, NULL, "Is Packed"}, - // TODO + // TODO(https://github.com/protocolbuffers/protobuf/issues/13760) //{ "id", (getter)GetID, NULL, "ID"}, {"message_type", (getter)PyUpb_FieldDescriptor_GetMessageType, NULL, "Message type"}, @@ -1195,7 +1195,7 @@ static PyGetSetDef PyUpb_FieldDescriptor_Getters[] = { "Has Options"}, {"has_presence", (getter)PyUpb_FieldDescriptor_GetHasPresence, NULL, "Has Presence"}, - // TODO + // TODO(https://github.com/protocolbuffers/protobuf/issues/13760) //{ "_options", //(getter)NULL, (setter)SetOptions, "Options"}, { "_serialized_options", //(getter)NULL, (setter)SetSerializedOptions, "Serialized Options"}, diff --git a/python/google/protobuf/internal/descriptor_pool_test.py b/python/google/protobuf/internal/descriptor_pool_test.py index 7ad8b39b5f6e5..57f65b550ec2d 100644 --- a/python/google/protobuf/internal/descriptor_pool_test.py +++ b/python/google/protobuf/internal/descriptor_pool_test.py @@ -808,7 +808,7 @@ def setUp(self): no_package_pb2.DESCRIPTOR.serialized_pb)) self.pool = descriptor_pool.DescriptorPool(descriptor_db=self.db) - # TODO: b/387527786 - This is a helper function for testErrorCollector to + # TODO: This is a helper function for testErrorCollector to # capture some of the nonconformant, C++-specific behavior. def assertCppErrorCollectorCorrect(self): self.assertEqual(api_implementation.Type(), 'cpp') @@ -858,7 +858,7 @@ def assertCppErrorCollectorCorrect(self): + error_msg, ) - # TODO: b/387527786 - This is a helper function for testErrorCollector to + # TODO: This is a helper function for testErrorCollector to # capture some of the nonconformant, UPB-specific behavior. def assertUpbErrorCollectorCorrect(self): self.assertEqual(api_implementation.Type(), 'upb') @@ -912,7 +912,7 @@ def testErrorCollector(self): # Nonconformance: UPB will raise a TypeError whereas other implementations # will raise KeyError when SubMessage cannot be indexed. - # TODO: b/387527786 - Fix this nonconformance between (cpp+python)/upb. + # TODO: Fix this nonconformance between (cpp+python)/upb. error_type = TypeError if api_implementation.Type() == 'upb' else KeyError self.assertRaisesRegex( error_type, @@ -935,7 +935,7 @@ def testErrorCollector(self): # called the first time, a KeyError will be raised but call the find # method later will return a descriptor which is not build. # TODO: fix pure python to revert the load if file can not be build - # TODO: b/387527786 - Fix this nonconformance between python/cpp/upb. + # TODO: Fix this nonconformance between python/cpp/upb. if api_implementation.Type() != 'python': if api_implementation.Type() == 'cpp': self.assertCppErrorCollectorCorrect() diff --git a/python/google/protobuf/internal/message_factory_test.py b/python/google/protobuf/internal/message_factory_test.py index 08e83e116be5b..c59894d731601 100644 --- a/python/google/protobuf/internal/message_factory_test.py +++ b/python/google/protobuf/internal/message_factory_test.py @@ -202,7 +202,7 @@ def testDuplicateExtensionNumber(self): ): pool.Add(f) else: - # TODO: b/381131694 - Ensure conformance between upb/c++/python. + # TODO: Ensure conformance between upb/c++/python. # C++ and pure Python implementations should raise an error when adding a # duplicate extension number. There doesn't seem to be a benefit to failing # only when GetMessageClassesForFiles is called. diff --git a/python/google/protobuf/internal/numpy/BUILD.bazel b/python/google/protobuf/internal/numpy/BUILD.bazel index 6799b799e9529..3b32447c03999 100644 --- a/python/google/protobuf/internal/numpy/BUILD.bazel +++ b/python/google/protobuf/internal/numpy/BUILD.bazel @@ -4,7 +4,7 @@ load("@protobuf_pip_deps//:requirements.bzl", "requirement") load("//python:internal.bzl", "internal_py_test") -# TODO: b/278896688 - Remove this target and replace with py_library +# TODO: Remove this target and replace with py_library exports_files([ "__init__.py", "numpy_test.py", diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py index 3252f9dd61af4..f4699972ecc2c 100644 --- a/python/google/protobuf/text_format.py +++ b/python/google/protobuf/text_format.py @@ -19,7 +19,7 @@ __author__ = 'kenton@google.com (Kenton Varda)' -# TODO Import thread contention leads to test failures. +# TODO(b/129989314) Import thread contention leads to test failures. import encodings.raw_unicode_escape # pylint: disable=unused-import import encodings.unicode_escape # pylint: disable=unused-import import io diff --git a/python/message.c b/python/message.c index 886e6a495c1e1..9a4cf7750442e 100644 --- a/python/message.c +++ b/python/message.c @@ -1728,7 +1728,7 @@ static PyGetSetDef PyUpb_Message_Getters[] = { static PyMethodDef PyUpb_Message_Methods[] = { {"__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS, "Makes a deep copy of the class."}, - // TODO + // TODO(https://github.com/protocolbuffers/protobuf/issues/13760) //{ "__unicode__", (PyCFunction)ToUnicode, METH_NOARGS, // "Outputs a unicode representation of the message." }, {"__contains__", PyUpb_Message_Contains, METH_O, diff --git a/ruby/lib/google/protobuf/ffi/field_descriptor.rb b/ruby/lib/google/protobuf/ffi/field_descriptor.rb index 2ec6d8e26b28f..4e56b837bc7d9 100644 --- a/ruby/lib/google/protobuf/ffi/field_descriptor.rb +++ b/ruby/lib/google/protobuf/ffi/field_descriptor.rb @@ -252,7 +252,7 @@ def self.private_constructor(field_def, descriptor_pool) instance end - # TODO Can this be added to the public API? + # TODO(jatl) Can this be added to the public API? def real_containing_oneof @real_containing_oneof ||= Google::Protobuf::FFI.real_containing_oneof self end diff --git a/ruby/lib/google/protobuf/ffi/internal/convert.rb b/ruby/lib/google/protobuf/ffi/internal/convert.rb index 649b90ad14e40..3cbe9cc17fa67 100644 --- a/ruby/lib/google/protobuf/ffi/internal/convert.rb +++ b/ruby/lib/google/protobuf/ffi/internal/convert.rb @@ -44,7 +44,7 @@ def convert_ruby_to_upb(value, arena, c_type, msg_or_enum_def) end return_value[:str_val][:size] = string_value.bytesize return_value[:str_val][:data] = Google::Protobuf::FFI.arena_malloc(arena, string_value.bytesize) - # TODO - how important is it to still use arena malloc, versus the following? + # TODO(jatl) - how important is it to still use arena malloc, versus the following? # buffer = ::FFI::MemoryPointer.new(:char, string_value.bytesize) # buffer.put_bytes(0, string_value) # return_value[:str_val][:data] = buffer @@ -108,13 +108,13 @@ def convert_ruby_to_upb(value, arena, c_type, msg_or_enum_def) value.to_i when String, Symbol enum_number = EnumDescriptor.send(:lookup_name, msg_or_enum_def, value.to_s) - #TODO add the bad value to the error message after tests pass + #TODO(jatl) add the bad value to the error message after tests pass raise RangeError.new "Unknown symbol value for enum field '#{name}'." if enum_number.nil? enum_number else raise TypeError.new "Expected number or symbol type for enum field '#{name}'." end - #TODO After all tests pass, improve error message across integer type by including actual offending value + #TODO(jatl) After all tests pass, improve error message across integer type by including actual offending value when :int32 raise TypeError.new "Expected number type for integral field '#{name}' (given #{value.class})." unless value.is_a? Numeric raise RangeError.new "Non-integral floating point value assigned to integer field '#{name}' (given #{value.class})." if value.floor != value @@ -274,7 +274,7 @@ def message_value_deep_copy(message_value, type, descriptor, arena) new_message_value = Google::Protobuf::FFI::MessageValue.new case type when :string, :bytes - # TODO - how important is it to still use arena malloc, versus using FFI MemoryPointers? + # TODO(jatl) - how important is it to still use arena malloc, versus using FFI MemoryPointers? new_message_value[:str_val][:size] = message_value[:str_val][:size] new_message_value[:str_val][:data] = Google::Protobuf::FFI.arena_malloc(arena, message_value[:str_val][:size]) raise NoMemoryError.new "Allocation failed" if new_message_value[:str_val][:data].nil? or new_message_value[:str_val][:data].null? diff --git a/ruby/lib/google/protobuf/ffi/map.rb b/ruby/lib/google/protobuf/ffi/map.rb index fc8060946a225..b3b98fa40efa4 100644 --- a/ruby/lib/google/protobuf/ffi/map.rb +++ b/ruby/lib/google/protobuf/ffi/map.rb @@ -57,7 +57,7 @@ class Map # message type. def self.new(key_type, value_type, value_typeclass = nil, init_hashmap = {}) instance = allocate - # TODO This argument mangling doesn't agree with the type signature, + # TODO(jatl) This argument mangling doesn't agree with the type signature, # but does align with the text of the comments and is required to make unit tests pass. if init_hashmap.empty? and ![:enum, :message].include?(value_type) init_hashmap = value_typeclass @@ -338,7 +338,7 @@ def internal_merge_into_self(other) end when Google::Protobuf::Map unless key_type == other.send(:key_type) and value_type == other.send(:value_type) and descriptor == other.descriptor - raise ArgumentError.new "Attempt to merge Map with mismatching types" #TODO Improve error message by adding type information + raise ArgumentError.new "Attempt to merge Map with mismatching types" #TODO(jatl) Improve error message by adding type information end arena.fuse(other.send(:arena)) iter = ::FFI::MemoryPointer.new(:size_t, 1) @@ -347,7 +347,7 @@ def internal_merge_into_self(other) Google::Protobuf::FFI.map_set(@map_ptr, key_message_value, value_message_value, arena) end else - raise ArgumentError.new "Unknown type merging into Map" #TODO improve this error message by including type information + raise ArgumentError.new "Unknown type merging into Map" #TODO(jatl) improve this error message by including type information end self end @@ -360,12 +360,12 @@ def initialize(key_type, value_type, value_type_class: nil, initial_values: nil, @name = name || 'Map' unless [:int32, :int64, :uint32, :uint64, :bool, :string, :bytes].include? key_type - raise ArgumentError.new "Invalid key type for map." #TODO improve error message to include what type was passed + raise ArgumentError.new "Invalid key type for map." #TODO(jatl) improve error message to include what type was passed end @key_type = key_type unless [:int32, :int64, :uint32, :uint64, :bool, :string, :bytes, :enum, :message].include? value_type - raise ArgumentError.new "Invalid value type for map." #TODO improve error message to include what type was passed + raise ArgumentError.new "Invalid value type for map." #TODO(jatl) improve error message to include what type was passed end @value_type = value_type diff --git a/ruby/lib/google/protobuf/ffi/message.rb b/ruby/lib/google/protobuf/ffi/message.rb index 3de301712d908..f1d6901adf456 100644 --- a/ruby/lib/google/protobuf/ffi/message.rb +++ b/ruby/lib/google/protobuf/ffi/message.rb @@ -256,7 +256,7 @@ def self.decode_json(data, options = {}) if options.respond_to? :to_h options = options.to_h else - #TODO can this error message be improve to include what was received? + #TODO(jatl) can this error message be improve to include what was received? raise ArgumentError.new "Expected hash arguments" end end @@ -284,7 +284,7 @@ def self.encode_json(message, options = {}) if options.respond_to? :to_h options = options.to_h else - #TODO can this error message be improve to include what was received? + #TODO(jatl) can this error message be improve to include what was received? raise ArgumentError.new "Expected hash arguments" end end @@ -569,7 +569,7 @@ def self.inspect_internal(msg) descriptor.each do |field_descriptor| next if field_descriptor.has_presence? && !Google::Protobuf::FFI.get_message_has(msg, field_descriptor) if field_descriptor.map? - # TODO Adapted - from map#each_msg_val and map#inspect- can this be refactored to reduce echo without introducing a arena allocation? + # TODO(jatl) Adapted - from map#each_msg_val and map#inspect- can this be refactored to reduce echo without introducing a arena allocation? message_descriptor = field_descriptor.subtype key_field_def = Google::Protobuf::FFI.get_field_by_number(message_descriptor, 1) key_field_type = Google::Protobuf::FFI.get_type(key_field_def) @@ -591,7 +591,7 @@ def self.inspect_internal(msg) end field_output << "#{field_descriptor.name}: {#{key_value_pairs.join(", ")}}" elsif field_descriptor.repeated? - # TODO Adapted - from repeated_field#each - can this be refactored to reduce echo? + # TODO(jatl) Adapted - from repeated_field#each - can this be refactored to reduce echo? repeated_field_output = [] message_value = Google::Protobuf::FFI.get_message_value(msg, field_descriptor) array = message_value[:array_val] @@ -635,7 +635,7 @@ def self.encode_internal(msg, encoding_options = 0) def method_missing_internal(method_name, *args, mode: nil) raise ArgumentError.new "method_missing_internal called with invalid mode #{mode.inspect}" unless [:respond_to_missing?, :method_missing].include? mode - #TODO not being allowed is not the same thing as not responding, but this is needed to pass tests + #TODO(jatl) not being allowed is not the same thing as not responding, but this is needed to pass tests if method_name.to_s.end_with? '=' if self.class.send(:oneof_field_names).include? method_name.to_s[0..-2].to_sym return false if mode == :respond_to_missing? @@ -660,7 +660,7 @@ def index_internal(name) get_field field_descriptor unless field_descriptor.nil? end - #TODO - well known types keeps us on our toes by overloading methods. + #TODO(jatl) - well known types keeps us on our toes by overloading methods. # How much of the public API needs to be defended? def index_assign_internal(value, name: nil, field_descriptor: nil, wrap: false) raise FrozenError.new "can't modify frozen #{self.class}" if frozen? diff --git a/ruby/lib/google/protobuf/ffi/repeated_field.rb b/ruby/lib/google/protobuf/ffi/repeated_field.rb index 5c3306e8a3320..543cc22a3d4a5 100644 --- a/ruby/lib/google/protobuf/ffi/repeated_field.rb +++ b/ruby/lib/google/protobuf/ffi/repeated_field.rb @@ -49,7 +49,7 @@ class RepeatedField # be provided. def self.new(type, type_class = nil, initial_values = []) instance = allocate - # TODO This argument mangling doesn't agree with the type signature in the comments + # TODO(jatl) This argument mangling doesn't agree with the type signature in the comments # but is required to make unit tests pass; if type_class.is_a?(Enumerable) and initial_values.empty? and ![:enum, :message].include?(type) initial_values = type_class diff --git a/ruby/lib/google/tasks/ffi.rake b/ruby/lib/google/tasks/ffi.rake index e983c1add2702..d8b3e18c3d7fb 100644 --- a/ruby/lib/google/tasks/ffi.rake +++ b/ruby/lib/google/tasks/ffi.rake @@ -24,7 +24,7 @@ end # FFI::CompilerTask's constructor walks the filesystem at task definition time # to create subtasks for each source file, so files from third_party must be # copied into place before the task is defined for it to work correctly. -# TODO Is there a sane way to check for generated protos under lib too? +# TODO(jatl) Is there a sane way to check for generated protos under lib too? def with_generated_files expected_path = FileUtils.pwd.include?('ext') ? 'third_party/utf8_range' : 'ext/google/protobuf_c/third_party/utf8_range' if File.directory?(expected_path) diff --git a/rust/bazel/aspects.bzl b/rust/bazel/aspects.bzl index b7cd1e985c519..caa3b715e5a97 100644 --- a/rust/bazel/aspects.bzl +++ b/rust/bazel/aspects.bzl @@ -392,7 +392,7 @@ def _rust_proto_aspect_common(target, ctx, is_upb): feature_configuration = feature_configuration, src = thunk, ctx = ctx, - attr = attr, + attr = ctx.rule.attr, cc_toolchain = cc_toolchain, cc_infos = [target[CcInfo]] + [dep[CcInfo] for dep in ctx.attr._cpp_thunks_deps] + dep_cc_infos, ) for thunk in cc_thunks_gencode]) @@ -493,6 +493,7 @@ def _make_proto_library_aspect(is_upb): toolchains = [ "@rules_rust//rust:toolchain_type", "@bazel_tools//tools/cpp:toolchain_type", + "@bazel_tools//tools/cpp:cc_runtimes_toolchain_type", ], ) diff --git a/rust/cpp.rs b/rust/cpp.rs index c058bc2e01ad4..cc9613620f6ec 100644 --- a/rust/cpp.rs +++ b/rust/cpp.rs @@ -1589,7 +1589,7 @@ where { fn take_from(&mut self, mut src: impl AsMut) { let mut src = src.as_mut(); - // TODO: b/393559271 - Optimize this copy out. + // TODO: Optimize this copy out. CopyFrom::copy_from(self, AsView::as_view(&src)); Clear::clear(&mut src); } diff --git a/rust/map.rs b/rust/map.rs index fd844e56413e2..b5b53a87192bb 100644 --- a/rust/map.rs +++ b/rust/map.rs @@ -358,7 +358,7 @@ where ) where K: 'a, { - //TODO + //TODO(b/330337282) self.clear(); for (k, v) in src.into_iter() { self.insert(k, v); diff --git a/rust/test/BUILD b/rust/test/BUILD index d0bd6604ea0a5..8f37b0645094d 100644 --- a/rust/test/BUILD +++ b/rust/test/BUILD @@ -245,7 +245,7 @@ proto_library( testonly = True, srcs = [ "package_disabiguation1.proto", - # TODO: b/321220129 - Uncomment once we support ambiguous messages. + # TODO: Uncomment once we support ambiguous messages. # "package_disabiguation2.proto", ], ) diff --git a/rust/upb.rs b/rust/upb.rs index de166315e3cb7..35609efb6f350 100644 --- a/rust/upb.rs +++ b/rust/upb.rs @@ -1227,7 +1227,7 @@ where { fn take_from(&mut self, mut src: impl AsMut) { let mut src = src.as_mut(); - // TODO: b/393559271 - Optimize this copy out. + // TODO: Optimize this copy out. CopyFrom::copy_from(self, AsView::as_view(&src)); Clear::clear(&mut src); } diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index 9972d0ec4523a..1a701a660776d 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -239,7 +239,7 @@ upb_proto_reflection_library( # support swapping out the compiler binary (even though a custom runtime can # be passed to proto_lang_toolchain). # -# TODO We still check in generated pb.h and pb.cc files purely to +# TODO(b/246826624) We still check in generated pb.h and pb.cc files purely to # support CMake builds. These aren't used at all by Bazel and will be removed # in the future once CMake can generate them too. @@ -290,7 +290,7 @@ staleness_test( # This is necessary for our generated cmake configs to pick up the checked in # WKT files. -# TODO Remove this once we generate WKT code from cmake. +# TODO(b/246826624) Remove this once we generate WKT code from cmake. cc_library( name = "cmake_wkt_cc_proto", srcs = ["wkt/google/protobuf/" + wkt + ".pb.cc" for wkt in WELL_KNOWN_TYPES], @@ -654,7 +654,7 @@ cc_library( "repeated_ptr_field.cc", "wire_format_lite.cc", ], - # TODO Fix ODR violations across BUILD.bazel files. + # TODO(b/355667032) Fix ODR violations across BUILD.bazel files. hdrs = [ "any.h", "arena.h", diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index 284b8fb002c72..acc816c1710b5 100644 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -337,7 +337,7 @@ uint64_t SerialArena::SpaceUsed() const { // ThreadSafeArena::SpaceUsed). However, worst-case space_used_ will have // stale data and the calculation will incorrectly assume 100% // usage of the *current* block. - // TODO Consider eliminating this race in exchange for a possible + // TODO(mkruskal) Consider eliminating this race in exchange for a possible // performance hit on ARM (see cl/455186837). uint64_t space_used = 0; diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index ef1be8a982816..73443a07961f6 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -123,7 +123,7 @@ constexpr bool FieldHasArenaOffset() { return !std::is_same_v; } -// TODO - Some types have a deprecated arena-enabled constructor, +// TODO(b/174574783) - Some types have a deprecated arena-enabled constructor, // as we plan to remove it in favor of using arena offsets, but for now Arena // needs to call it. While the arena constructor exists, we will call the // `InternalVisibility` override to silence the warning. @@ -501,7 +501,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) static T* PROTOBUF_NONNULL ConstructOnArena(void* PROTOBUF_NONNULL ptr, Arena& arena, Args&&... args) { #ifndef PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD - // TODO - ClangTidy gives warnings for calling the deprecated + // TODO(b/174574783) - ClangTidy gives warnings for calling the deprecated // constructors here, which leads to log spam. It is correct to invoke // these constructors through the Arena class as it will allow us to // silently switch to a different constructor once arena pointers are diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h index 6b2dff2fd8701..608d44e27d005 100644 --- a/src/google/protobuf/compiler/code_generator.h +++ b/src/google/protobuf/compiler/code_generator.h @@ -91,7 +91,7 @@ class PROTOC_EXPORT CodeGenerator { // This must be kept in sync with plugin.proto. See that file for // documentation on each value. - // TODO Use CodeGeneratorResponse.Feature here. + // TODO(b/291092901) Use CodeGeneratorResponse.Feature here. enum Feature { FEATURE_PROTO3_OPTIONAL = 1, FEATURE_SUPPORTS_EDITIONS = 2, diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index fbcaccda140c1..5eac56dd76fb1 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -3034,7 +3034,7 @@ bool CommandLineInterface::GeneratePluginOutput( const std::vector& parsed_files, const std::string& plugin_name, const std::string& parameter, GeneratorContext* generator_context, std::string* error) { - // TODO Remove these special-cases and send json names to all + // TODO(b/441614741) Remove these special-cases and send json names to all // plugins. static const auto builtin_plugins = new absl::flat_hash_set( {"protoc-gen-cpp", "protoc-gen-java", "protoc-gen-mutable_java", diff --git a/src/google/protobuf/compiler/cpp/field_generators/message_field.cc b/src/google/protobuf/compiler/cpp/field_generators/message_field.cc index 7db24217b7f46..fbd7cb342c1ad 100644 --- a/src/google/protobuf/compiler/cpp/field_generators/message_field.cc +++ b/src/google/protobuf/compiler/cpp/field_generators/message_field.cc @@ -347,7 +347,7 @@ void SingularMessage::GenerateMergingCode(io::Printer* p) const { // where people assign root values to child values or vice versa which // are not always checked, so we delay this change becoming 'visible' // until after we copied the message. - // TODO enforces this as undefined behavior in debug builds. + // TODO(b/307821081) enforces this as undefined behavior in debug builds. p->Emit(R"cc( $DCHK$(from.$field_$ != nullptr); if (_this->$field_$ == nullptr) { diff --git a/src/google/protobuf/compiler/cpp/file.cc b/src/google/protobuf/compiler/cpp/file.cc index 45699961118fe..2710894a6452f 100644 --- a/src/google/protobuf/compiler/cpp/file.cc +++ b/src/google/protobuf/compiler/cpp/file.cc @@ -495,7 +495,7 @@ void FileGenerator::GenerateSourceIncludes(io::Printer* p) { IncludeFile("third_party/protobuf/io/coded_stream.h", p); IncludeFile("third_party/protobuf/generated_message_tctable_impl.h", p); IncludeFile("third_party/protobuf/internal_visibility.h", p); - // TODO This is to include parse_context.h, we need a better way + // TODO(gerbens) This is to include parse_context.h, we need a better way IncludeFile("third_party/protobuf/extension_set.h", p); IncludeFile("third_party/protobuf/generated_message_util.h", p); IncludeFile("third_party/protobuf/wire_format_lite.h", p); @@ -1797,7 +1797,7 @@ void FileGenerator::GenerateGlobalStateFunctionDeclarations(io::Printer* p) { // The TableStruct is also outputted in weak_message_field.cc, because the // weak fields must refer to table struct but cannot include the header. // Also it annotates extra weak attributes. - // TODO make sure this situation is handled better. + // TODO(gerbens) make sure this situation is handled better. p->Emit(R"cc( // Internal implementation detail -- do not use these members. struct $dllexport_decl $$tablename$ { @@ -1862,7 +1862,7 @@ void FileGenerator::GenerateExtensionIdentifiers(io::Printer* p) { } void FileGenerator::GenerateInlineFunctionDefinitions(io::Printer* p) { - // TODO remove pragmas when gcc is no longer used. Current version + // TODO(gerbens) remove pragmas when gcc is no longer used. Current version // of gcc fires a bogus error when compiled with strict-aliasing. p->Emit(R"( #ifdef __GNUC__ diff --git a/src/google/protobuf/compiler/cpp/file.h b/src/google/protobuf/compiler/cpp/file.h index 6798e997d35ec..8c564f83f01cf 100644 --- a/src/google/protobuf/compiler/cpp/file.h +++ b/src/google/protobuf/compiler/cpp/file.h @@ -187,7 +187,7 @@ class PROTOC_EXPORT FileGenerator { // This member is unused and should be deleted once all old-style variable // maps are gone. - // TODO + // TODO(b/245791219) absl::flat_hash_map variables_; // Contains the post-order walk of all the messages (and nested messages) diff --git a/src/google/protobuf/compiler/cpp/helpers.cc b/src/google/protobuf/compiler/cpp/helpers.cc index 2c9ea7ff8b158..7f4b935057378 100644 --- a/src/google/protobuf/compiler/cpp/helpers.cc +++ b/src/google/protobuf/compiler/cpp/helpers.cc @@ -766,7 +766,7 @@ std::string FieldMessageTypeName(const FieldDescriptor* field, std::string StripProto(absl::string_view filename) { /* - * TODO remove this proxy method + * TODO(github/georgthegreat) remove this proxy method * once Google's internal codebase will become ready */ return compiler::StripProto(filename); diff --git a/src/google/protobuf/compiler/java/names.h b/src/google/protobuf/compiler/java/names.h index ddf9b03495b8d..a580644b5afb5 100644 --- a/src/google/protobuf/compiler/java/names.h +++ b/src/google/protobuf/compiler/java/names.h @@ -44,7 +44,7 @@ namespace java { // The fully-qualified Java class name. PROTOC_EXPORT std::string QualifiedClassName(const Descriptor* descriptor); -// TODO Remove this in the next breaking release. +// TODO(b/448776140) Remove this in the next breaking release. ABSL_DEPRECATE_AND_INLINE() inline std::string ClassName(const Descriptor* descriptor) { return QualifiedClassName(descriptor); @@ -57,7 +57,7 @@ inline std::string ClassName(const Descriptor* descriptor) { // The fully-qualified Java class name. PROTOC_EXPORT std::string QualifiedClassName(const EnumDescriptor* descriptor); -// TODO Remove this in the next breaking release. +// TODO(b/448776140) Remove this in the next breaking release. ABSL_DEPRECATE_AND_INLINE() inline std::string ClassName(const EnumDescriptor* descriptor) { return QualifiedClassName(descriptor); @@ -70,7 +70,7 @@ inline std::string ClassName(const EnumDescriptor* descriptor) { // The fully-qualified Java class name. PROTOC_EXPORT std::string QualifiedClassName(const FileDescriptor* descriptor); -// TODO Remove this in the next breaking release. +// TODO(b/448776140) Remove this in the next breaking release. ABSL_DEPRECATE_AND_INLINE() inline std::string ClassName(const FileDescriptor* descriptor) { return QualifiedClassName(descriptor); @@ -84,7 +84,7 @@ inline std::string ClassName(const FileDescriptor* descriptor) { PROTOC_EXPORT std::string QualifiedClassName( const ServiceDescriptor* descriptor); -// TODO Remove this in the next breaking release. +// TODO(b/448776140) Remove this in the next breaking release. ABSL_DEPRECATE_AND_INLINE() inline std::string ClassName(const ServiceDescriptor* descriptor) { return QualifiedClassName(descriptor); diff --git a/src/google/protobuf/compiler/kotlin/field.cc b/src/google/protobuf/compiler/kotlin/field.cc index 47211ea1678ce..14870dd857af0 100644 --- a/src/google/protobuf/compiler/kotlin/field.cc +++ b/src/google/protobuf/compiler/kotlin/field.cc @@ -90,7 +90,7 @@ void FieldGenerator::GeneratePritimiveField(io::Printer* printer) const { {"jvm_name_set", [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }}, }, - "// TODO: b/336400327 - remove this hack; we should access properties\n" + "// TODO: remove this hack; we should access properties\n" "$kt_deprecation$public var $kt_name$: $kt_type$\n" " $jvm_name_get$" " $getter$() = $kt_dsl_builder$.get${$$kt_capitalized_name$$}$()\n" diff --git a/src/google/protobuf/compiler/kotlin/file.h b/src/google/protobuf/compiler/kotlin/file.h index dbcc495d8fc48..cc39176240f31 100644 --- a/src/google/protobuf/compiler/kotlin/file.h +++ b/src/google/protobuf/compiler/kotlin/file.h @@ -41,7 +41,7 @@ namespace protobuf { namespace compiler { namespace kotlin { -// TODO: b/366047913 - Move away from these generator classes and more towards +// TODO: Move away from these generator classes and more towards // the "Context" model that the Kotlin Native & Rust code generators use: // http://google3/third_party/kotlin/protobuf/generator/native/file.cc;l=149-170;rcl=642292300 class FileGenerator { diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc index e23219b3b35ad..b2fb982a390dc 100644 --- a/src/google/protobuf/compiler/parser.cc +++ b/src/google/protobuf/compiler/parser.cc @@ -1232,7 +1232,7 @@ void Parser::GenerateMapEntry(const MapField& map_field, field->options().uninterpreted_option(i); // Legacy handling for the `enforce_utf8` option, which bears a striking // similarity to features in many respects. - // TODO Delete this once proto2/proto3 have been turned down. + // TODO(b/289755572) Delete this once proto2/proto3 have been turned down. if (option.name_size() == 1 && option.name(0).name_part() == "enforce_utf8" && !option.name(0).is_extension()) { diff --git a/src/google/protobuf/compiler/rust/upb_helpers.cc b/src/google/protobuf/compiler/rust/upb_helpers.cc index 067fc509e3c8f..68d916a050a1d 100644 --- a/src/google/protobuf/compiler/rust/upb_helpers.cc +++ b/src/google/protobuf/compiler/rust/upb_helpers.cc @@ -27,7 +27,7 @@ uint32_t UpbMiniTableFieldIndex(const FieldDescriptor& field) { auto* parent = field.containing_type(); ABSL_CHECK(parent != nullptr); - // TODO: b/361751487 - We should get the field_index from + // TODO: We should get the field_index from // UpbDefs directly, instead of independently matching // the sort order here. diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 2b206ec585e5b..f5f133da47394 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -5980,13 +5980,13 @@ void DescriptorBuilder::ResolveFeatures(const FileDescriptorProto& proto, void DescriptorBuilder::PostProcessFieldFeatures( FieldDescriptor& field, const FieldDescriptorProto& proto) { - // TODO This can be replace by a runtime check in `is_required` + // TODO(b/285013359) This can be replace by a runtime check in `is_required` // once the `label` getter is hidden. if (field.features().field_presence() == FeatureSet::LEGACY_REQUIRED && field.label_ == FieldDescriptor::LABEL_OPTIONAL) { field.label_ = FieldDescriptor::LABEL_REQUIRED; } - // TODO This can be replace by a runtime check of `is_delimited` + // TODO(b/285024320) This can be replace by a runtime check of `is_delimited` // once the `TYPE_GROUP` value is removed. if (field.type_ == FieldDescriptor::TYPE_MESSAGE && !field.containing_type()->options().map_entry() && @@ -7046,7 +7046,7 @@ void DescriptorBuilder::CheckFieldJsonNameUniqueness( if (descriptor->features().json_format() == FeatureSet::LEGACY_BEST_EFFORT && involves_default) { - // TODO Upgrade this to an error once downstream protos + // TODO(b/261750676) Upgrade this to an error once downstream protos // have been fixed. AddWarning(message_name, field, DescriptorPool::ErrorCollector::NAME, make_error); @@ -7982,7 +7982,7 @@ void DescriptorBuilder::CrossLinkField(FieldDescriptor* field, // In case of weak fields we force building the dependency. We need to know // if the type exist or not. If it doesn't exist we substitute Empty which // should only be done if the type can't be found in the generated pool. - // TODO Ideally we should query the database directly to check + // TODO(gerbens) Ideally we should query the database directly to check // if weak fields exist or not so that we don't need to force building // weak dependencies. However the name lookup rules for symbols are // somewhat complicated, so I defer it too another CL. @@ -9636,7 +9636,7 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption( // Special handling to prevent feature use in the same file as the // definition. - // TODO Add proper support for cases where this can work. + // TODO(b/340953843) Add proper support for cases where this can work. if (field->file() == builder_->file_ && uninterpreted_option_->name(0).name_part() == "features" && !uninterpreted_option_->name(0).is_extension()) { diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index e5683a271ea47..db02e7ef53686 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -662,7 +662,7 @@ message MessageOptions { // This should only be used as a temporary measure against broken builds due // to the change in behavior for JSON field name conflicts. // - // TODO This is legacy behavior we plan to remove once downstream + // TODO(b/261750190) This is legacy behavior we plan to remove once downstream // teams have had time to migrate. optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; @@ -884,7 +884,7 @@ message EnumOptions { // and strips underscored from the fields before comparison in proto3 only. // The new behavior takes `json_name` into account and applies to proto2 as // well. - // TODO Remove this legacy behavior once downstream teams have + // TODO(b/261750190) Remove this legacy behavior once downstream teams have // had time to migrate. optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; @@ -1023,7 +1023,7 @@ message UninterpretedOption { // =================================================================== // Features -// TODO Enums in C++ gencode (and potentially other languages) are +// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are // not well scoped. This means that each of the feature enums below can clash // with each other. The short names we've chosen maximize call-site // readability, but leave us very open to this scenario. A future feature will diff --git a/src/google/protobuf/descriptor_legacy.h b/src/google/protobuf/descriptor_legacy.h index 6a97c47ea24e3..20ab6cd4ee0a8 100644 --- a/src/google/protobuf/descriptor_legacy.h +++ b/src/google/protobuf/descriptor_legacy.h @@ -10,7 +10,7 @@ namespace google { namespace protobuf { -// TODO Remove this deprecated API entirely. +// TODO(b/317813624) Remove this deprecated API entirely. class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED FileDescriptorLegacy { public: explicit FileDescriptorLegacy(const FileDescriptor* file) : file_(file) {} diff --git a/src/google/protobuf/dynamic_message.cc b/src/google/protobuf/dynamic_message.cc index e535c420535b8..2f966698ae686 100644 --- a/src/google/protobuf/dynamic_message.cc +++ b/src/google/protobuf/dynamic_message.cc @@ -928,7 +928,7 @@ const Message* DynamicMessageFactory::GetPrototypeNoLock( // - if hasbit is unset, field is not present. // - if hasbit is set, field is present if it is also nonempty. if (internal::cpp::HasHasbitWithoutProfile(field)) { - // TODO: b/112602698 - during Python textproto serialization, MapEntry + // TODO: during Python textproto serialization, MapEntry // messages may be generated from DynamicMessage on the fly. C++ // implementations of MapEntry messages always have hasbits, but // has_presence return values might be different depending on how field diff --git a/src/google/protobuf/extension_set_heavy.cc b/src/google/protobuf/extension_set_heavy.cc index 9bbbef1dea438..93e3185872281 100644 --- a/src/google/protobuf/extension_set_heavy.cc +++ b/src/google/protobuf/extension_set_heavy.cc @@ -68,7 +68,7 @@ void ExtensionSet::AppendToList( if (ext.descriptor == nullptr) { const FieldDescriptor* field = pool->FindExtensionByNumber(extendee, number); - // TODO This should be limited to and only reachable by + // TODO(b/467683606) This should be limited to and only reachable by // lite extensions on full messages. if (field != nullptr) { output->push_back(field); diff --git a/src/google/protobuf/io/printer.h b/src/google/protobuf/io/printer.h index 771e6ffb3f013..80832abe3b9a0 100644 --- a/src/google/protobuf/io/printer.h +++ b/src/google/protobuf/io/printer.h @@ -75,7 +75,7 @@ class PROTOBUF_EXPORT AnnotationCollector { AddAnnotation(begin_offset, end_offset, file_path, path); } - // TODO I don't see why we need virtuals here. Just a vector of + // TODO(gerbens) I don't see why we need virtuals here. Just a vector of // range, payload pairs stored in a context should suffice. virtual void AddAnnotationNew(Annotation&) {} }; diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h index fa3a015e8cc1e..dc09209668e6b 100644 --- a/src/google/protobuf/map_field.h +++ b/src/google/protobuf/map_field.h @@ -839,7 +839,7 @@ class PROTOBUF_EXPORT MapValueRef final : public MapValueConstRef { TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL, "MapValueRef::SetBoolValue"); *reinterpret_cast(data_) = value; } - // TODO - Checks that enum is member. + // TODO(jieluo) - Checks that enum is member. void SetEnumValue(int value) { TYPE_CHECK(FieldDescriptor::CPPTYPE_ENUM, "MapValueRef::SetEnumValue"); *reinterpret_cast(data_) = value; diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index 564b9e138160e..5135aae13784e 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -55,7 +55,7 @@ namespace google { namespace protobuf { namespace internal { -// TODO make this factorized better. This should not have to hop +// TODO(gerbens) make this factorized better. This should not have to hop // to reflection. Currently uses GeneratedMessageReflection and thus is // defined in generated_message_reflection.cc void RegisterFileLevelMetadata(const DescriptorTable* descriptor_table); diff --git a/src/google/protobuf/no_field_presence_map_test.cc b/src/google/protobuf/no_field_presence_map_test.cc index c3c18b583cfb5..ed9edfcd48422 100644 --- a/src/google/protobuf/no_field_presence_map_test.cc +++ b/src/google/protobuf/no_field_presence_map_test.cc @@ -75,7 +75,7 @@ MATCHER_P(MapEntryListFieldsSize, expected_size, "") { return list_fields_output.size() == expected_size; } } // namespace no_presence_map_test_internal -// TODO: b/371232929 - can make this `inline constexpr` with C++17 as baseline. +// TODO: can make this `inline constexpr` with C++17 as baseline. constexpr auto& MapEntryListFieldsSize = no_presence_map_test_internal::MapEntryListFieldsSize; @@ -733,7 +733,7 @@ TEST(NoFieldPresenceTest, message.map_int32_explicit_foreign_message().at(0))); } -// TODO: b/358616816 - `if constexpr` can be used here once C++17 is baseline. +// TODO: `if constexpr` can be used here once C++17 is baseline. template bool TestSerialize(const MessageLite& message, T* output); @@ -841,7 +841,7 @@ TYPED_TEST(NoFieldPresenceMapSerializeTest, // Test that message can roundtrip. TestAllMapTypes rt_msg; EXPECT_TRUE(rt_msg.ParseFromString(this->GetOutput())); - // TODO: b/368089585 - write this better when we have access to EqualsProto. + // TODO: write this better when we have access to EqualsProto. EXPECT_EQ(rt_msg.map_int32_foreign_message().at(123).c(), msg.map_int32_foreign_message().at(123).c()); @@ -864,7 +864,7 @@ TYPED_TEST(NoFieldPresenceMapSerializeTest, // Test that message can roundtrip. TestAllMapTypes rt_msg; EXPECT_TRUE(rt_msg.ParseFromString(this->GetOutput())); - // TODO: b/368089585 - write this better when we have access to EqualsProto. + // TODO: write this better when we have access to EqualsProto. EXPECT_EQ(rt_msg.map_int32_explicit_foreign_message().at(456).c(), msg.map_int32_explicit_foreign_message().at(456).c()); @@ -958,7 +958,7 @@ TYPED_TEST(NoFieldPresenceMapSerializeTest, MapRoundTripZeroKeyZeroMessage) { // Test that message can roundtrip. TestAllMapTypes rt_msg; EXPECT_TRUE(rt_msg.ParseFromString(this->GetOutput())); - // TODO: b/368089585 - write this better when we have access to EqualsProto. + // TODO: write this better when we have access to EqualsProto. EXPECT_EQ(rt_msg.map_int32_foreign_message().at(0).c(), msg.map_int32_foreign_message().at(0).c()); @@ -981,7 +981,7 @@ TYPED_TEST(NoFieldPresenceMapSerializeTest, // Test that message can roundtrip. TestAllMapTypes rt_msg; EXPECT_TRUE(rt_msg.ParseFromString(this->GetOutput())); - // TODO: b/368089585 - write this better when we have access to EqualsProto. + // TODO: write this better when we have access to EqualsProto. EXPECT_EQ(rt_msg.map_int32_explicit_foreign_message().at(0).c(), msg.map_int32_explicit_foreign_message().at(0).c()); @@ -1056,7 +1056,7 @@ TYPED_TEST(NoFieldPresenceMapSerializeTest, MapRoundTripZeroKeyDefaultMessage) { // Test that message can roundtrip. TestAllMapTypes rt_msg; EXPECT_TRUE(rt_msg.ParseFromString(this->GetOutput())); - // TODO: b/368089585 - write this better when we have access to EqualsProto. + // TODO: write this better when we have access to EqualsProto. EXPECT_EQ(rt_msg.map_int32_foreign_message().at(0).c(), msg.map_int32_foreign_message().at(0).c()); @@ -1081,7 +1081,7 @@ TYPED_TEST(NoFieldPresenceMapSerializeTest, // Test that message can roundtrip. TestAllMapTypes rt_msg; EXPECT_TRUE(rt_msg.ParseFromString(this->GetOutput())); - // TODO: b/368089585 - write this better when we have access to EqualsProto. + // TODO: write this better when we have access to EqualsProto. EXPECT_EQ(rt_msg.map_int32_explicit_foreign_message().at(0).c(), msg.map_int32_explicit_foreign_message().at(0).c()); diff --git a/src/google/protobuf/no_field_presence_test.cc b/src/google/protobuf/no_field_presence_test.cc index 2c803ace83bdd..01ad01b7ea1a9 100644 --- a/src/google/protobuf/no_field_presence_test.cc +++ b/src/google/protobuf/no_field_presence_test.cc @@ -523,7 +523,7 @@ TEST_F(NoFieldPresenceSwapFieldTest, m1_.set_oneof_uint32(1); m2_.set_oneof_string("test"); - // NOTE: Calling swap on any field descriptor within the oneof works -- + // NOTE:- // even a completely unrelated field. const FieldDescriptor* never_set_field = d1_->FindFieldByName("oneof_enum"); @@ -549,7 +549,7 @@ TEST_F(NoFieldPresenceSwapFieldTest, m1_.set_oneof_uint32(1); m2_.set_oneof_string("test"); - // NOTE: Calling swap on any field descriptor within the oneof works -- + // NOTE:- // even a completely unrelated field. const FieldDescriptor* never_set_field = d1_->FindFieldByName("oneof_enum"); const FieldDescriptor* f1 = d1_->FindFieldByName("oneof_uint32"); @@ -997,7 +997,7 @@ TEST(NoFieldPresenceTest, ExtraZeroesInWireMergeTest) { std::string wire = source.SerializeAsString(); ASSERT_THAT(wire, StrEq(absl::string_view{"\x08\x00", 2})); - // TODO: b/356132170 -- Add conformance tests to ensure this behaviour is + // TODO:- Add conformance tests to ensure this behaviour is // well-defined. // As implemented, the C++ "merge" operation does not distinguish between // implicit and explicit fields when reading from the wire. @@ -1017,7 +1017,7 @@ TEST(NoFieldPresenceTest, ExtraZeroesInWireLastWins) { absl::string_view wire{"\x08\x01\x08\x00", /*len=*/4}; // note the null-byte. ForeignMessage dest; - // TODO: b/356132170 -- Add conformance tests to ensure this behaviour is + // TODO:- Add conformance tests to ensure this behaviour is // well-defined. // As implemented, the C++ "merge" operation does not distinguish between // implicit and explicit fields when reading from the wire. @@ -1044,7 +1044,7 @@ TEST(NoFieldPresenceTest, IsInitializedTest) { EXPECT_EQ(true, message.IsInitialized()); } -// TODO: b/358616816 - `if constexpr` can be used here once C++17 is baseline. +// TODO: `if constexpr` can be used here once C++17 is baseline. template bool TestSerialize(const MessageLite& message, T* output); diff --git a/src/google/protobuf/package_info.h b/src/google/protobuf/package_info.h index ab2c074601e7d..ab3ca8a73356c 100644 --- a/src/google/protobuf/package_info.h +++ b/src/google/protobuf/package_info.h @@ -37,7 +37,7 @@ // mutex locking is used to make the access thread-safe. namespace google { namespace protobuf { -// TODO remove this comment, we need it to prevent clang-format +// TODO(gerbens) remove this comment, we need it to prevent clang-format // from combining the brackets. Which would mess with extract script } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/parse_context.cc b/src/google/protobuf/parse_context.cc index 2a1436f848c3c..b33eee835c494 100644 --- a/src/google/protobuf/parse_context.cc +++ b/src/google/protobuf/parse_context.cc @@ -190,7 +190,7 @@ std::pair EpsCopyInputStream::DoneFallback(int overrun, if (ABSL_PREDICT_FALSE(overrun > limit_)) return {nullptr, true}; ABSL_DCHECK(overrun != limit_); // Guaranteed by caller. ABSL_DCHECK(overrun < limit_); // Follows from above - // TODO Instead of this dcheck we could just assign, and remove + // TODO(gerbens) Instead of this dcheck we could just assign, and remove // updating the limit_end from PopLimit, ie. // limit_end_ = buffer_end_ + (std::min)(0, limit_); // if (ptr < limit_end_) return {ptr, false}; diff --git a/src/google/protobuf/parse_context.h b/src/google/protobuf/parse_context.h index bd2b104a69142..3738dd85dc964 100644 --- a/src/google/protobuf/parse_context.h +++ b/src/google/protobuf/parse_context.h @@ -178,7 +178,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream { // end up with an invalid limit and it can lead to integer overflows. limit_ = limit_ + std::move(delta).token(); if (ABSL_PREDICT_FALSE(!EndedAtLimit())) return false; - // TODO We could remove this line and hoist the code to + // TODO(gerbens) We could remove this line and hoist the code to // DoneFallback. Study the perf/bin-size effects. limit_end_ = buffer_end_ + (std::min)(0, limit_); return true; @@ -399,7 +399,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream { return res; } - // TODO Can V1 enjoy a code deduplication benefit by using this? + // TODO(b/432303376) Can V1 enjoy a code deduplication benefit by using this? const char* InitFrom(const BoundedZCIS& bounded_zcis) { return InitFrom(bounded_zcis.zcis, bounded_zcis.limit); } @@ -509,7 +509,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream { } ptr += chunk_size; size -= chunk_size; - // TODO Next calls NextBuffer which generates buffers with + // TODO(gerbens) Next calls NextBuffer which generates buffers with // overlap and thus incurs cost of copying the slop regions. This is not // necessary for reading strings. We should just call Next buffers. if (limit_ <= kSlopBytes) return nullptr; diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 1072d07b0c166..0fae780560d97 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -599,7 +599,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), // ThreadSafeArenaz is turned off completely in opensource builds. -// TODO remove these flags once the feature is stable. +// TODO(b/174574783) remove these flags once the feature is stable. #ifndef PROTOBUF_INTERNAL_DISABLE_REMOVED_ARENA_PTRS #define PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD 1 #define PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_FIELD 1 diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc index 8fd466058fe66..6b299190d870f 100644 --- a/src/google/protobuf/text_format.cc +++ b/src/google/protobuf/text_format.cc @@ -1255,7 +1255,7 @@ class TextFormat::Parser::ParserImpl { // Consumes Any::type_url value, of form "type.googleapis.com/full.type.Name" // or "type.googleprod.com/full.type.Name" bool ConsumeAnyTypeUrl(std::string* full_type_name, std::string* prefix) { - // TODO Extend Consume() to consume multiple tokens at once, so that + // TODO(saito) Extend Consume() to consume multiple tokens at once, so that // this code can be written as just DO(Consume(kGoogleApisTypePrefix)). DO(ConsumeIdentifier(prefix)); while (TryConsume(".")) { diff --git a/third_party/utf8_range/BUILD.bazel b/third_party/utf8_range/BUILD.bazel index 719e91d374c98..1842d9d3613dd 100644 --- a/third_party/utf8_range/BUILD.bazel +++ b/third_party/utf8_range/BUILD.bazel @@ -25,7 +25,7 @@ exports_files([ "rules_fuzzing.patch", ]) -# TODO Remove this once callers have been Bazelified. +# TODO(b/252876197) Remove this once callers have been Bazelified. filegroup( name = "utf8_range_srcs", srcs = [ diff --git a/upb/message/internal/accessors.h b/upb/message/internal/accessors.h index 4e89dbf80d8b0..342ea4c1a40d7 100644 --- a/upb/message/internal/accessors.h +++ b/upb/message/internal/accessors.h @@ -605,7 +605,7 @@ UPB_API_INLINE void upb_Message_SetBaseFieldInt64(struct upb_Message* msg, UPB_API_INLINE void upb_Message_SetBaseFieldMessage(struct upb_Message* msg, const upb_MiniTableField* f, struct upb_Message* value) { - // TODO - Re-enable this assertion. + // TODO(b/454656912) - Re-enable this assertion. // UPB_ASSERT(value); UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message); UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == diff --git a/upb/message/map_gencode_util.h b/upb/message/map_gencode_util.h index ab23a1aea72cd..18e7fc3a0731b 100644 --- a/upb/message/map_gencode_util.h +++ b/upb/message/map_gencode_util.h @@ -11,6 +11,6 @@ #define UPB_MESSAGE_MAP_GENCODE_UTIL_H_ // This header file is referenced by multiple files. Leave it empty. -// TODO: b/399481227 - Remove this header file, after all the references are +// TODO: Remove this header file, after all the references are // cleaned up. #endif /* UPB_MESSAGE_MAP_GENCODE_UTIL_H_ */ diff --git a/upb/message/message.c b/upb/message/message.c index 954ad33b9cbd7..b9d6895402e2d 100644 --- a/upb/message/message.c +++ b/upb/message/message.c @@ -69,7 +69,7 @@ UPB_NOINLINE bool UPB_PRIVATE(_upb_Message_AddUnknownSlowPath)(upb_Message* msg, } } } - // TODO: b/376969853 - Add debug check that the unknown field is an overall + // TODO: Add debug check that the unknown field is an overall // valid proto field if (!UPB_PRIVATE(_upb_Message_ReserveSlot)(msg, arena)) { return false; @@ -148,7 +148,7 @@ bool UPB_PRIVATE(_upb_Message_AddUnknownV)(struct upb_Message* msg, memcpy(copy, data[i].data, data[i].size); copy += data[i].size; } - // TODO: b/376969853 - Add debug check that the unknown field is an overall + // TODO: Add debug check that the unknown field is an overall // valid proto field upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg); in->aux_data[in->size++] = upb_TaggedAuxPtr_MakeUnknownData(view); @@ -280,7 +280,7 @@ void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m) { // Extensions. upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg); - // TODO: b/376969853 - use iterator API + // TODO: use iterator API uint32_t size = in ? in->size : 0; for (size_t i = 0; i < size; i++) { upb_TaggedAuxPtr tagged_ptr = in->aux_data[i]; diff --git a/upb/message/promote.c b/upb/message/promote.c index baf0c9c455ee9..036b8fbd815d1 100644 --- a/upb/message/promote.c +++ b/upb/message/promote.c @@ -191,7 +191,7 @@ upb_FindUnknownRet upb_Message_FindUnknown(const upb_Message* msg, return ret; } -// Warning: See TODO +// Warning: See TODO(b/267655898) upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage( upb_Message* msg, const upb_MiniTable* mini_table, const upb_MiniTableField* field, const upb_MiniTable* sub_mini_table, diff --git a/upb/port/def.inc b/upb/port/def.inc index 649f825403642..adabd55c4e4d1 100644 --- a/upb/port/def.inc +++ b/upb/port/def.inc @@ -641,7 +641,7 @@ Error, UINTPTR_MAX is undefined // Workaround for https://github.com/llvm/llvm-project/issues/167577 until it's // fixed. Some function must exist for the constructor to work properly. -// TODO Remove this or gate it on a future version of clang. +// TODO(b/460538289) Remove this or gate it on a future version of clang. #if defined(__clang__) && defined(__arm__) #define _UPB_CONSTRUCTOR_PLACEHOLDER(unique_name) \ __attribute__((used, visibility("hidden"))) void UPB_PRIVATE(unique_name)( \ diff --git a/upb/reflection/file_def.c b/upb/reflection/file_def.c index 9f933251e850e..02ff969c9ade5 100644 --- a/upb/reflection/file_def.c +++ b/upb/reflection/file_def.c @@ -55,7 +55,7 @@ struct upb_FileDef { }; UPB_API const char* upb_FileDef_EditionName(int edition) { - // TODO Synchronize this with descriptor.proto better. + // TODO(b/309669951) Synchronize this with descriptor.proto better. switch (edition) { case UPB_DESC(EDITION_PROTO2): return "PROTO2"; diff --git a/upb/wire/encode.c b/upb/wire/encode.c index 57766e321f739..3303a810c2ef1 100644 --- a/upb/wire/encode.c +++ b/upb/wire/encode.c @@ -766,7 +766,7 @@ static char* encode_exts(char* ptr, upb_encstate* e, const upb_MiniTable* m, if (e->options & kUpb_EncodeOption_Deterministic) { _upb_sortedmap sorted; if (!_upb_mapsorter_pushexts(&e->sorter, in, &sorted)) { - // TODO: b/378744096 - handle alloc failure + // TODO: handle alloc failure } const upb_Extension* ext; while (_upb_sortedmap_nextext(&e->sorter, &sorted, &ext)) { diff --git a/upb_generator/bootstrap_compiler.bzl b/upb_generator/bootstrap_compiler.bzl index 5ebc6a57edc43..6b53748768f5b 100644 --- a/upb_generator/bootstrap_compiler.bzl +++ b/upb_generator/bootstrap_compiler.bzl @@ -22,7 +22,7 @@ _extra_proto_path = "-I$$(dirname $(location //:descriptor_proto_srcs))/../.. " # This visibility is used automatically for anything used by the bootstrapping process. _bootstrap_visibility = [ - # TODO: b/396430482 - Remove protoc from bootstrap visibility. + # TODO: Remove protoc from bootstrap visibility. "//src/google/protobuf/compiler:__pkg__", "//src/google/protobuf/compiler/rust:__pkg__", "//third_party/upb/github:__pkg__", diff --git a/upb_generator/minitable/generator.cc b/upb_generator/minitable/generator.cc index ac7152416d8d8..fff59dd17b762 100644 --- a/upb_generator/minitable/generator.cc +++ b/upb_generator/minitable/generator.cc @@ -306,7 +306,7 @@ void RegisterExtensions(Output& output, absl::string_view unique_name) { output("UPB_LINKARR_DECLARE(upb_AllExts, const upb_MiniTableExtension);\n"); output("UPB_CONSTRUCTOR(upb_GeneratedRegistry_Constructor, $0) {\n", unique_name); - // TODO Although we define this function as weak and only one + // TODO(b/456317163) Although we define this function as weak and only one // copy will ever exist in any binary, every instance will get registered as a // separate constructor call. To avoid duplicate registrations, we use a // static variable to ensure that the function is only executed once.