Skip to content

In ThreadFactoryBuilder, propagate null from newThread on the backing ThreadFactory. - #8752

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1001012598
Oct 18, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1001012598

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

In ThreadFactoryBuilder, propagate null from newThread on the backing ThreadFactory.

ThreadFactory.newThread is permitted to return null to reject a request to create a thread. Previously, a factory built by ThreadFactoryBuilder threw NullPointerException if its backing factory returned null.

Fixes #3568.
Closes #8742.

RELNOTES=In the ThreadFactory returned by ThreadFactoryBuilder, a null return from newThread on the backing ThreadFactory is now propagated to the caller. Previously it triggered a NullPointerException.

…acking `ThreadFactory`.

`ThreadFactory.newThread` is permitted to return `null` to reject a request to create a thread. Previously, a factory built by `ThreadFactoryBuilder` threw `NullPointerException` if its backing factory returned `null`.

Fixes #3568.
Closes #8742.

RELNOTES=In the `ThreadFactory` returned by `ThreadFactoryBuilder`, a null return from `newThread` on the backing `ThreadFactory` is now propagated to the caller. Previously it triggered a NullPointerException.
PiperOrigin-RevId: 1001877586
@copybara-service
copybara-service Bot merged commit 669a232 into master Oct 18, 2026
4 checks passed
@copybara-service
copybara-service Bot deleted the test_1001012598 branch October 18, 2026 17:41
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.

Behavior of ThreadFactoryBuilder is unclear if backing factory returns null

1 participant