From 3e32b6bafeb627f58b8cb278018c110aa69b51d8 Mon Sep 17 00:00:00 2001 From: Tilman Hausherr Date: Tue, 2 Jul 2024 12:58:29 +0000 Subject: [PATCH] PDFBOX-5660: fix logging exception parameter type git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1918837 13f79535-47bb-0310-9956-ffa450edef68 --- .../pdfbox/examples/signature/cert/CertificateVerifier.java | 2 +- .../org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java | 4 ++-- .../main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java b/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java index c56aedf074f..3517b9f84d0 100644 --- a/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java +++ b/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java @@ -341,7 +341,7 @@ public static Set downloadExtraCertificates(X509Extension ext) } catch (IOException | URISyntaxException ex) { - LOG.warn("{} failure: {}", urlString, ex.getMessage(), ex); + LOG.warn(() -> urlString + " failure: " + ex.getMessage(), ex); } catch (CertificateException ex) { diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java index cc2ee3e633f..7adecd6a484 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java @@ -646,8 +646,8 @@ private COSBase decryptString(COSString string, long objNum, long genNum) } catch (IOException ex) { - LOG.error("Failed to decrypt COSString of length {} in object {}: {}", - string.getBytes().length, objNum, ex.getMessage(), ex); + LOG.error(() -> "Failed to decrypt COSString of length " + string.getBytes().length + + " in object " + objNum + ": " + ex.getMessage(), ex); return string; } } diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java index 467bdca9e07..e1f2fbd7eac 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java @@ -400,7 +400,7 @@ else if (name != null) } catch (IOException ex) { - LOG.warn("Could not get {} UC2 map for font {}", strName, getName(), ex); + LOG.warn("Could not get " + strName + " UC2 map for font " + getName(), ex); } } }