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

[Improvement] In GravitinoErrorCode.java errorCode in not Immutable #2162

Closed
Tracked by #2225
justinmclean opened this issue Feb 9, 2024 · 0 comments · Fixed by #2500
Closed
Tracked by #2225

[Improvement] In GravitinoErrorCode.java errorCode in not Immutable #2162

justinmclean opened this issue Feb 9, 2024 · 0 comments · Fixed by #2500
Labels
good first issue Good for newcomers improvement Improvements on everything

Comments

@justinmclean
Copy link
Member

What would you like to be improved?

GravitinoErrorCode.java:39: warning: [ImmutableEnumChecker] enums should be immutable: 'GravitinoErrorCode' has field 'errorCode' of type 'io.trino.spi.ErrorCode', the declaration of type 'io.trino.spi.ErrorCode' is not annotated with @com.google.errorprone.annotations.Immutable
private final ErrorCode errorCode;

See https://errorprone.info/bugpattern/ImmutableEnumChecker

How should we improve?

No response

@justinmclean justinmclean added good first issue Good for newcomers improvement Improvements on everything labels Feb 9, 2024
coolderli added a commit to coolderli/gravitino that referenced this issue Mar 11, 2024
jerryshao pushed a commit that referenced this issue Mar 11, 2024
### What changes were proposed in this pull request?

ImmutableEnumChecker will check whether a Eunm is immutable.
Such cases will be recognized as an immutable object:

- All fields are final.
- The types of all fields of the enum are deeply immutable.
- The class annotated by `@com.google.errorprone.annotations.Immutable`.

See more details at
https://errorprone.info/bugpattern/ImmutableEnumChecker.

In this MR, we suppress ImmutableEnumChecker on
`io.trino.spi.ErrorCode`, because it is outside the project.

### Why are the changes needed?


- Fix: #2162 

### Does this PR introduce _any_ user-facing change?

- no

### How was this patch tested?

- `./gradlew build`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement Improvements on everything
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant