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

Fix incorrect error message template of Preconditions.check* #642

Open
dbw9580 opened this issue Oct 13, 2022 · 1 comment
Open

Fix incorrect error message template of Preconditions.check* #642

dbw9580 opened this issue Oct 13, 2022 · 1 comment

Comments

@dbw9580
Copy link

dbw9580 commented Oct 13, 2022

Preconditions.checkArgument and friends take an optional message template that can have format specifier %s only. Any other format specifiers like %d are not recognized and output as is. See guava doc: https://guava.dev/releases/31.1-jre/api/docs/com/google/common/base/Preconditions.html

There are several places across the code base that are using %d etc., in the error message template, e.g.

https://github.com/Alluxio/alluxio/blob/6982d6c759e7180c9b1ae00ea7e6c5229765ff2e/core/server/worker/src/main/java/alluxio/worker/block/UfsInputStreamCache.java#L278

Find across the code base such occurrences and fix them.

@smdxdxd
Copy link

smdxdxd commented Oct 19, 2022

/assign @smdxdxd

alluxio-bot pushed a commit to Alluxio/alluxio that referenced this issue Oct 26, 2022
### What changes are proposed in this pull request?

Fix string format specifier `%d` in `Preconditions.checkArgument` error
message template.

### Why are the changes needed?

any other format specifiers like `%d` are not recognized at the method
of `Preconditions.checkArgument`, only `%s` is accepted.

### Does this PR introduce any user facing changes?
none

Fixed #642
Alluxio/Community#642

pr-link: #16360
change-id: cid-673b8647502d63d96d88ed59d3bd6829acf7d46d
jja725 pushed a commit to jja725/alluxio that referenced this issue Jan 27, 2023
### What changes are proposed in this pull request?

Fix string format specifier `%d` in `Preconditions.checkArgument` error
message template.

### Why are the changes needed?

any other format specifiers like `%d` are not recognized at the method
of `Preconditions.checkArgument`, only `%s` is accepted.

### Does this PR introduce any user facing changes?
none

Fixed Alluxio#642
Alluxio/Community#642

pr-link: Alluxio#16360
change-id: cid-673b8647502d63d96d88ed59d3bd6829acf7d46d
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

No branches or pull requests

2 participants