Skip to content

Comments

refactor(graph): init keyStrategyMap via copy constructor instead of stream API#4188

Open
chrisis58 wants to merge 2 commits intoalibaba:mainfrom
chrisis58:refactor-compile-strategies-init
Open

refactor(graph): init keyStrategyMap via copy constructor instead of stream API#4188
chrisis58 wants to merge 2 commits intoalibaba:mainfrom
chrisis58:refactor-compile-strategies-init

Conversation

@chrisis58
Copy link

Describe what this PR does / why we need it

Optimizes the initialization of the keyStrategyMap field during graph compilation to improve code readability and performance.

Does this pull request fix one issue?

NONE

Describe how you did it

Refactored the keyStrategyMap initialization to use the LinkedHashMap copy constructor instead of the Stream API.

Describe how to verify it

Added a new test case for NullKeyStrategy to verify the behavior.

Special notes for reviews

Behavior Changes:

  • Previously, null values caused a "fail-fast" NullPointerException. The new implementation accepts null values (logic will fallback to ReplaceStrategy when encountering nulls).
  • The map is now initialized as a LinkedHashMap, which preserves the iteration order of the source map. Previously, the order was not guaranteed.

@CLAassistant
Copy link

CLAassistant commented Feb 3, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/graph SAA Grpah module label Feb 3, 2026
@chrisis58 chrisis58 changed the title refactor(graph/compile): init keyStrategyMap via copy constructor instead of stream API refactor(graph): init keyStrategyMap via copy constructor instead of stream API Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/graph SAA Grpah module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants