)]}'
{
  "commit": "eb796e8a3d31a94cd6eac49666a68327d30efa36",
  "tree": "6c9ca86f005cd1e6ff74db3d70eee9b242616c6f",
  "parents": [
    "5f4c9f039934e2d56fb71c17bdf43d4ceb78fdbf"
  ],
  "author": {
    "name": "Helmut Januschka",
    "email": "helmut@januschka.com",
    "time": "Mon Jun 29 09:17:19 2026"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Jun 29 09:17:19 2026"
  },
  "message": "Introduce MetadataBytes wrapper for compiled-in metadata accessors (#4016)\n\n* Introduce MetadataBytes wrapper for compiled-in metadata accessors\n\nReplace the C-style `int \u003ctype\u003e_size()` / `const void* \u003ctype\u003e_get()` pair\nin metadata.h, short_metadata.h and alternate_format.h with a single\n`MetadataBytes Get\u003cType\u003e()` accessor that returns a small RAII wrapper.\n\nThe default implementations shipped in this repo wrap the existing\nstatic `data[]` arrays in a non-owning MetadataBytes, so the on-disk\nlayout and runtime behaviour are unchanged for upstream consumers.\n\nThe motivating use case is downstream embedders (e.g. Chromium) that\nproduce the metadata at runtime, for example by decompressing a\nbrotli-compressed blob on first use to save binary size. With the old\nAPI such embedders had to either leak the decompressed buffer or do\ngymnastics to free it after PhoneNumberUtil parsed it. With\nMetadataBytes the typical call site\n\n    MetadataBytes bytes \u003d GetMetadata();\n    collection-\u003eParseFromArray(bytes.data(), bytes.size());\n\nkeeps the buffer alive for exactly as long as ParseFromArray() needs it\nand then frees it when the wrapper goes out of scope, simply by having\nthe downstream-supplied implementation return an owning instance built\nfrom a std::unique_ptr\u003cuint8_t[]\u003e.\n\nCppMetadataGenerator and its tests are updated to emit the new API.\n\n* Fix C++ build: rebuild generator jar and fix header test ordering\n\nThe previous commit updated CppMetadataGenerator.java to emit the new\nMetadataBytes API but did not rebuild the checked-in\ncpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar that CMake invokes to\nregenerate metadata.{h,cc} at build time. As a result CI regenerated the\nheaders using the old API and phonenumberutil.cc failed with\n\u0027MetadataBytes was not declared in this scope\u0027.\n\nAlso reorder the assertions in CppMetadataGeneratorTest.outputHeaderFile\nto match the actual emit order (the metadata_bytes.h include is emitted\nbefore the namespace openings, not after).",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7f784d4a5546a4178f637c95673ae857b908ecbb",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/alternate_format.cc",
      "new_id": "727d3d99c39abab5f4875009165527804592f663",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/alternate_format.cc"
    },
    {
      "type": "modify",
      "old_id": "dfd1774f666f8070b1a141bbdd997df71a0954ef",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/alternate_format.h",
      "new_id": "8b5a74cfa17c73473de0367862d1fcb65a6e24c7",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/alternate_format.h"
    },
    {
      "type": "modify",
      "old_id": "94b29c8c47e9210a460b746cc5695b34e272e790",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/lite_metadata.cc",
      "new_id": "f51ee2232164ceffc241bd91c7d41de9f7b9afaf",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/lite_metadata.cc"
    },
    {
      "type": "modify",
      "old_id": "0e49649295311c4bb40529a693b2cb1ab172e2f8",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/metadata.cc",
      "new_id": "10a3ac94cabe87af76402f69074f3512c3283187",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/metadata.cc"
    },
    {
      "type": "modify",
      "old_id": "1348befd5d9c5e371615e6c865e355e4860b41ae",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/metadata.h",
      "new_id": "f935c81263b0be3e6c11cff2a3beaafc053b9517",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/metadata.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cd7db1d2fada93cca775fbd6e68287c63ead4c43",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/metadata_bytes.h"
    },
    {
      "type": "modify",
      "old_id": "2d60ceb4d1884eca60e9eedd10e762915a88332a",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/phonenumbermatcher.cc",
      "new_id": "794c3c682ed3f117162f7dd9b3725530071825bf",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/phonenumbermatcher.cc"
    },
    {
      "type": "modify",
      "old_id": "c0c9d09a045f7b5b3eacc61813f58de173182a04",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/phonenumberutil.cc",
      "new_id": "041270be99cc43efd8664789174ff25d39b45e87",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/phonenumberutil.cc"
    },
    {
      "type": "modify",
      "old_id": "ef8157679aba616d195b960d51c0272f6d96a736",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/short_metadata.cc",
      "new_id": "d9f68bc844afc703f9b50a5403291e506fce7212",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/short_metadata.cc"
    },
    {
      "type": "modify",
      "old_id": "3bc06033b05a9202592bf5f3206399aede184626",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/short_metadata.h",
      "new_id": "94987c242353a6c4bb8e3791f0fc2532172a57d2",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/short_metadata.h"
    },
    {
      "type": "modify",
      "old_id": "f7fd1513f38a8a48d1906c92f05c3d20f107eeb0",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/shortnumberinfo.cc",
      "new_id": "a2b5fdcd742bd5c95c252231e4307f9217d5ca94",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/shortnumberinfo.cc"
    },
    {
      "type": "modify",
      "old_id": "230efd3451e54cfdf472a8587574cc1d5dc9d6c1",
      "old_mode": 33188,
      "old_path": "cpp/src/phonenumbers/test_metadata.cc",
      "new_id": "0529f2f64dcbc3223e3f5b39d0fdd497310cbf27",
      "new_mode": 33188,
      "new_path": "cpp/src/phonenumbers/test_metadata.cc"
    },
    {
      "type": "modify",
      "old_id": "22e832c2ceb4ccb5dc5739f6d99853ffd5f70205",
      "old_mode": 33188,
      "old_path": "tools/java/cpp-build/src/com/google/i18n/phonenumbers/CppMetadataGenerator.java",
      "new_id": "34f2f67bbf64104e6d3aea78d9fb5f2785549b55",
      "new_mode": 33188,
      "new_path": "tools/java/cpp-build/src/com/google/i18n/phonenumbers/CppMetadataGenerator.java"
    },
    {
      "type": "modify",
      "old_id": "5b8fbb4048f1747c8e81501263c37125567dcf07",
      "old_mode": 33188,
      "old_path": "tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar",
      "new_id": "3fda87c937b7d4a6ea3c9aacb94cd4c78fec3efe",
      "new_mode": 33188,
      "new_path": "tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar"
    },
    {
      "type": "modify",
      "old_id": "b1976e80db506102100ea7b5061b5ec8f704ab2a",
      "old_mode": 33188,
      "old_path": "tools/java/cpp-build/test/com/google/i18n/phonenumbers/BuildMetadataCppFromXmlTest.java",
      "new_id": "494787baa588a8dbdf998d00b2665318f9c63f48",
      "new_mode": 33188,
      "new_path": "tools/java/cpp-build/test/com/google/i18n/phonenumbers/BuildMetadataCppFromXmlTest.java"
    },
    {
      "type": "modify",
      "old_id": "4cd9bee0ec415537481df6fd0c5c3ca32023b636",
      "old_mode": 33188,
      "old_path": "tools/java/cpp-build/test/com/google/i18n/phonenumbers/CppMetadataGeneratorTest.java",
      "new_id": "d83b1b22250570dcb6024bf3fcdc5aa485b350d2",
      "new_mode": 33188,
      "new_path": "tools/java/cpp-build/test/com/google/i18n/phonenumbers/CppMetadataGeneratorTest.java"
    }
  ]
}
