Skip to content

Validate and invalidate Graphs.transpose(graph).incidentEdges(node) like other graph views. - #8894

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1022766148
Nov 20, 2026
Merged

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

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Validate and invalidate Graphs.transpose(graph).incidentEdges(node) like other graph views.

The transposed Graph's incidentEdges returned a raw view without checking node, so it accepted absent (or null) nodes, and after node was removed its methods threw IllegalArgumentException instead of the documented IllegalStateException. It now delegates to the original graph's incidentEdges (which validates node immediately and preserves its iteration order) and wraps the result in the usual invalidatable view.

Fixes #8867
Fixes #8868

RELNOTES=graph: Fixed Graphs.transpose(graph).incidentEdges(node) not rejecting absent nodes and throwing the wrong exception after node is removed.

… like other graph views.

The transposed `Graph`'s `incidentEdges` returned a raw view without checking `node`, so it accepted absent (or null) nodes, and after `node` was removed its methods threw `IllegalArgumentException` instead of the documented `IllegalStateException`. It now delegates to the original graph's `incidentEdges` (which validates `node` immediately and preserves its iteration order) and wraps the result in the usual invalidatable view.

Fixes #8867
Fixes #8868

RELNOTES=`graph`: Fixed `Graphs.transpose(graph).incidentEdges(node)` not rejecting absent nodes and throwing the wrong exception after `node` is removed.
PiperOrigin-RevId: 1026654445
@copybara-service
copybara-service Bot merged commit 36e3995 into master Nov 20, 2026
15 checks passed
@copybara-service
copybara-service Bot deleted the test_1022766148 branch November 20, 2026 20:11
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.

Transposed Graph incident-edge views bypass node validation and invalidation

1 participant