From fe9d2daed2bb98aee13961fd56cdd5222789c7c8 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Fri, 17 Aug 2018 12:22:58 +0200 Subject: [PATCH] Simplfy code in FileBasedOpenPgpMetadataStore --- .../ox/store/filebased/FileBasedOpenPgpMetadataStore.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/store/filebased/FileBasedOpenPgpMetadataStore.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/store/filebased/FileBasedOpenPgpMetadataStore.java index 8bc42d116..233157ef3 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/store/filebased/FileBasedOpenPgpMetadataStore.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/store/filebased/FileBasedOpenPgpMetadataStore.java @@ -123,10 +123,9 @@ public class FileBasedOpenPgpMetadataStore extends AbstractOpenPgpMetadataStore if (data == null || data.isEmpty()) { if (!destination.exists()) { return; - } else { - if (!destination.delete()) { - throw new IOException("Cannot delete file " + destination.getAbsolutePath()); - } + } + if (!destination.delete()) { + throw new IOException("Cannot delete file " + destination.getAbsolutePath()); } return; }