Skip to content

Consider metadata updates only - #9

Open
benjaminramsden wants to merge 1734 commits into
benjaminramsden:masterfrom
google:master
Open

Consider metadata updates only#9
benjaminramsden wants to merge 1734 commits into
benjaminramsden:masterfrom
google:master

Conversation

@benjaminramsden

Copy link
Copy Markdown
Owner

No description provided.

kkeshava and others added 28 commits February 22, 2024 15:10
* [maven-release-plugin] prepare release v8.13.31

* [maven-release-plugin] prepare for next development iteration
* Update java runtime version to support App Engine

* Adding version number for maven-compiler

* Update maven-compiler configuration

* Update pom.xml

* Update App engine properties

* Update pom.xml
* [maven-release-plugin] prepare release v8.13.31

* [maven-release-plugin] prepare for next development iteration
* [maven-release-plugin] prepare release v8.13.32

* [maven-release-plugin] prepare for next development iteration
* [maven-release-plugin] prepare release v8.13.33

* [maven-release-plugin] prepare for next development iteration
* [maven-release-plugin] prepare release v8.13.34

* [maven-release-plugin] prepare for next development iteration
* [maven-release-plugin] prepare release v8.13.35

* [maven-release-plugin] prepare for next development iteration
* [maven-release-plugin] prepare release v8.13.36

* [maven-release-plugin] prepare for next development iteration
* [maven-release-plugin] prepare release v8.13.37

* [maven-release-plugin] prepare for next development iteration
* [maven-release-plugin] prepare release v8.13.38

* [maven-release-plugin] prepare for next development iteration
Signed-off-by: Joyce <joycebrum@google.com>
Co-authored-by: Tijana Vislavski Gradina <tijanavg@google.com>
kkeshava and others added 30 commits May 7, 2026 11:27
* [maven-release-plugin] prepare release v9.0.31

* [maven-release-plugin] prepare for next development iteration

* [maven-release-plugin] prepare release v9.0.32

* [maven-release-plugin] prepare for next development iteration

* Revert "[maven-release-plugin] prepare for next development iteration"

This reverts commit c4d84c8.

* Revert last 4 automation commits
* [maven-release-plugin] prepare release v9.0.31

* [maven-release-plugin] prepare for next development iteration
Co-authored-by: rohininidhi <rnidhi@google.com>
* [maven-release-plugin] prepare release v9.0.32

* [maven-release-plugin] prepare for next development iteration
* 000 Short Code incorrectly formatting for E164
The PhoneMetadata can be moved into the hashmap avoiding a copy.
#3980)

Bumps [org.codehaus.plexus:plexus-utils](https://github.com/codehaus-plexus/plexus-utils) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/codehaus-plexus/plexus-utils/releases)
- [Commits](codehaus-plexus/plexus-utils@plexus-utils-4.0.2...plexus-utils-4.0.3)

---
updated-dependencies:
- dependency-name: org.codehaus.plexus:plexus-utils
  dependency-version: 4.0.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mandlil <138015259+mandlil@users.noreply.github.com>
* [maven-release-plugin] prepare release v9.0.33

* [maven-release-plugin] prepare for next development iteration
* [maven-release-plugin] prepare release v9.0.33

* [maven-release-plugin] prepare for next development iteration
…4016)

* Introduce MetadataBytes wrapper for compiled-in metadata accessors

Replace the C-style `int <type>_size()` / `const void* <type>_get()` pair
in metadata.h, short_metadata.h and alternate_format.h with a single
`MetadataBytes Get<Type>()` accessor that returns a small RAII wrapper.

The default implementations shipped in this repo wrap the existing
static `data[]` arrays in a non-owning MetadataBytes, so the on-disk
layout and runtime behaviour are unchanged for upstream consumers.

The motivating use case is downstream embedders (e.g. Chromium) that
produce the metadata at runtime, for example by decompressing a
brotli-compressed blob on first use to save binary size. With the old
API such embedders had to either leak the decompressed buffer or do
gymnastics to free it after PhoneNumberUtil parsed it. With
MetadataBytes the typical call site

    MetadataBytes bytes = GetMetadata();
    collection->ParseFromArray(bytes.data(), bytes.size());

keeps the buffer alive for exactly as long as ParseFromArray() needs it
and then frees it when the wrapper goes out of scope, simply by having
the downstream-supplied implementation return an owning instance built
from a std::unique_ptr<uint8_t[]>.

CppMetadataGenerator and its tests are updated to emit the new API.

* Fix C++ build: rebuild generator jar and fix header test ordering

The previous commit updated CppMetadataGenerator.java to emit the new
MetadataBytes API but did not rebuild the checked-in
cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar that CMake invokes to
regenerate metadata.{h,cc} at build time. As a result CI regenerated the
headers using the old API and phonenumberutil.cc failed with
'MetadataBytes was not declared in this scope'.

Also reorder the assertions in CppMetadataGeneratorTest.outputHeaderFile
to match the actual emit order (the metadata_bytes.h include is emitted
before the namespace openings, not after).
* [maven-release-plugin] prepare release v9.0.34

* [maven-release-plugin] prepare for next development iteration
metadata_bytes.h uses std::move in the owning constructor but only
includes <cstdint> and <memory>. It happens to compile when <utility>
gets pulled in transitively, but breaks under stricter setups (e.g. a
libc++ modules build) where std::move must come from its own header.

Co-authored-by: mandlil <138015259+mandlil@users.noreply.github.com>
* [maven-release-plugin] prepare release v9.0.35

* [maven-release-plugin] prepare for next development iteration
…er (#4010)

* Defensively cap number_of_leading_zeros to prevent OOM

* Update leading zeros limit in phone number utility

Increase the maximum number of leading zeros from 3 to 10 to handle more cases.

* Update PhoneNumberUtil.java

* Update PhoneNumberUtil.java

Increase leading zeros cap to 10

---------

Co-authored-by: mandlil <138015259+mandlil@users.noreply.github.com>
…ackOverflowError (#4017)

* Add input length bound to isAlphaNumber() to prevent StackOverflowError

* Add input length bound and replace regex in isAlphaNumber() to prevent StackOverflowError

isAlphaNumber() did not limit input length before evaluating
VALID_ALPHA_PHONE_PATTERN, allowing a numeric-only input of ~1684
characters to cause an uncaught StackOverflowError via unbounded
regex recursion. Unlike parse(), which is guarded by
MAX_INPUT_STRING_LENGTH, this method had no such bound.

This adds the same MAX_INPUT_STRING_LENGTH guard already used in
parseHelper() as defense-in-depth, and additionally replaces the
recursive regex VALID_ALPHA_PHONE_PATTERN with an equivalent linear
character scan (hasAtLeastThreeAlphaChars), eliminating the
recursion-based failure mode at its root rather than only guarding
against it. The replacement matches the exact ASCII [A-Za-z] range
of the original pattern, so behavior is unchanged for all valid
inputs.

Verified:
- Input up to 50,000 characters no longer throws StackOverflowError
- isAlphaNumber("1800MICROSOFT"), "325-CARS", "0800 REPAIR",
  "1-800-MY-APPLE" all still return true (no behavior change)
- isAlphaNumber("+14155552671") still returns false
- Full PhoneNumberUtilTest suite passes: 121 tests, 0 failures, 0 errors

Related: Google OSS VRP / Buganizer issue 525896790

---------

Co-authored-by: mandlil <138015259+mandlil@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.