From 89dbea67afab06dbf67cf13046b16815bf2f205f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=CC=81bor=20Varga?= Date: Wed, 29 May 2024 14:03:28 +0200 Subject: [PATCH] Fix string format specifier in error message for FileUtils.checkFileSize() 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 --- src/main/java/be/panako/util/FileUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/be/panako/util/FileUtils.java b/src/main/java/be/panako/util/FileUtils.java index 1553b45..74172c3 100644 --- a/src/main/java/be/panako/util/FileUtils.java +++ b/src/main/java/be/panako/util/FileUtils.java @@ -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); }