Skip to content

Make BuildContext.getValue generic - #137

Merged
slachiewicz merged 1 commit into
masterfrom
agent/generic-get-value
Nov 8, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/generic-get-value

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

BuildContext.getValue(String) becomes <T> T getValue(String key) so callers no longer cast; DefaultBuildContext casts with @SuppressWarnings("unchecked"). The change is binary compatible, since the erased descriptor stays (Ljava/lang/String;)Ljava/lang/Object;, and source compatible: callers assigning to Object and implementations declaring Object getValue(String) still compile.

Closes #42

Verified: mvn -B -ntp verify → BUILD SUCCESS; javap -s shows the unchanged descriptor; the module skips test execution, so the new test is a compile-time check that fails to compile on master

@slachiewicz slachiewicz added the enhancement New feature or request label Nov 8, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 8, 2026 22:34
@slachiewicz
slachiewicz merged commit 691c563 into master Nov 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make getValue a generic method

1 participant