Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add values() to EnumOrdinal check #4728

Merged
merged 1 commit into from
Dec 13, 2024
Merged

add values() to EnumOrdinal check #4728

merged 1 commit into from
Dec 13, 2024

Conversation

copybara-service[bot]
Copy link
Contributor

add values() to EnumOrdinal check

This check is in JavaCodeClarity, only runs on changed lines.

While testing, discovered that it would flag a lot of instances where values()[ was being invoked from within the same class. I wasn't sure if that was a reasonable thing to do, seems like it might be a valid internal design choice. See the 'negative_enumValues_internalCall' test case as an example. Or see some of the instances in unknown commit

So I added an additional check of the enclosing class to ignore internal usage. That flagged fewer things: unknown commit

This check is in JavaCodeClarity, only runs on changed lines.

While testing, discovered that it would flag a lot of instances where `values()[` was being invoked from within the same class. I wasn't sure if that was a reasonable thing to do, seems like it might be a valid internal design choice. See the 'negative_enumValues_internalCall' test case as an example. Or see some of the instances in unknown commit

So I added an additional check of the enclosing class to ignore internal usage. That flagged fewer things: unknown commit

PiperOrigin-RevId: 705970604
@copybara-service copybara-service bot merged commit 6195480 into master Dec 13, 2024
@copybara-service copybara-service bot deleted the test_703251266 branch December 13, 2024 20:44
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.

1 participant