Example:
void checkFileSize(long bytes) {
if (bytes > 1_048_576) {
throw new IllegalArgumentException("too big");
}
}
A quick-fix is suggested to introduce a new constant:
static final int MAX_SUPPORTED_FILE_SIZE = 1_048_576;
void checkFileSize(long bytes) {
if (bytes > MAX_SUPPORTED_FILE_SIZE) {
throw new IllegalArgumentException("too big");
}
}
Use the first checkbox below to disable this inspection within hashCode()
methods.
Use the second checkbox below to ignore magic numbers in annotations.
Use the third checkbox below to ignore magic numbers used as initial capacity when constructing
Collection
, Map
,
StringBuilder
or StringBuffer
objects.