Skip to content

Recognise Bind and Inject as prefixes for annotations that we should treat as injecty ones.#5265

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_817102963
Oct 9, 2025
Merged

Recognise Bind and Inject as prefixes for annotations that we should treat as injecty ones.#5265
copybara-service[bot] merged 1 commit into
masterfrom
test_817102963

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Recognise Bind and Inject as prefixes for annotations that we should treat as injecty ones.

Obviously this could lead to false negatives, but these are such common prefixes for injection annotations that it saves us special casing a bunch.

…uld treat as injecty ones.

Obviously this _could_ lead to false negatives, but these are such common prefixes for injection annotations that it saves us special casing a bunch.

PiperOrigin-RevId: 817162404
@copybara-service
copybara-service Bot merged commit 144b5b1 into master Oct 9, 2025
@copybara-service
copybara-service Bot deleted the test_817102963 branch October 9, 2025 13:44

@Stephan202 Stephan202 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just something I noticed.

anno ->
INJECTION_PREFIXES.stream()
.anyMatch(
p -> getSymbol(anno).getSimpleName().toString().startsWith(p)))) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSymbol(anno).getSimpleName().toString() is loop-invariant and can be moved to the outer lambda expression.

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.

2 participants