Skip to content

Commit

Permalink
Fix string format specifier in error message for FileUtils.checkFileS…
Browse files Browse the repository at this point in the history
…ize()

The %l conversion specifier is not applicable for Java integral values, %d should be used instead.
See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Formatter.html#syntax
  • Loading branch information
Gábor Varga committed May 29, 2024
1 parent b602429 commit 89dbea6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/be/panako/util/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public static boolean checkFileSize(File file,long maxFileSizeInMB){
if(fileSizeInBytes != 0 && fileSizeInMB < maxFileSizeInMB ){
fileOk = true;
}else{
String message = String.format("Could not process %s it has an unacceptable file size of %l MB (zero or larger than %d MB ).", file.getName(), fileSizeInMB, maxFileSizeInMB );
String message = String.format("Could not process %s it has an unacceptable file size of %d MB (zero or larger than %d MB ).", file.getName(), fileSizeInMB, maxFileSizeInMB );
LOG.warning(message);
System.err.println(message);
}
Expand Down

0 comments on commit 89dbea6

Please sign in to comment.