From 1d837a835c04078ec66325e9fb9de21ac401874e Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Wed, 30 Nov 2016 15:10:15 +0700 Subject: prevent string concatenation for disabled loggers --- juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'juick-xmpp-ft/src/main') diff --git a/juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java b/juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java index d411179c..7da2099e 100644 --- a/juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java +++ b/juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java @@ -40,7 +40,10 @@ public class XMPPFTServer implements AutoCloseable { FileTransferManager fileTransferManager = component.getManager(FileTransferManager.class); fileTransferManager.addFileTransferOfferListener(e -> { try { - List allowedTypes = new ArrayList() {{ add("png"); add("jpg"); }}; + List allowedTypes = new ArrayList() {{ + add("png"); + add("jpg"); + }}; String attachmentExtension = FilenameUtils.getExtension(e.getName()).toLowerCase(); String targetFilename = String.format("%s.%s", DigestUtils.md5Hex(String.format("%s-%s", @@ -49,7 +52,7 @@ public class XMPPFTServer implements AutoCloseable { Path filePath = Paths.get(tmpDir, targetFilename); FileTransfer ft = e.accept(filePath).get(); ft.addFileTransferStatusListener(st -> { - logger.debug(String.format("%s: received %d of %d", e.getName(), st.getBytesTransferred(), e.getSize())); + logger.debug("{}: received {} of {}", e.getName(), st.getBytesTransferred(), e.getSize()); if (ft.isDone()) { logger.info("transfer completed"); Message msg = new Message(); -- cgit v1.2.3