Alluxio / Community

New Contributor Tasks for Alluxio
20 stars 38 forks source link

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

Open dbw9580 opened 2 years ago

dbw9580 commented 2 years ago

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 commented 2 years ago

/assign @smdxdxd