From b00827d740f4425c1fb4702515d4d2b23e90fc35 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Tue, 15 Feb 2022 17:15:33 +0100 Subject: more small refactors --- .../asit/pdfover/gui/workflow/config/ConfigProviderImpl.java | 12 ++++++------ .../pdfover/gui/workflow/config/ConfigurationContainer.java | 1 + .../java/at/asit/pdfover/gui/workflow/states/OpenState.java | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'pdf-over-gui') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java index ec7c0c60..952bd137 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java @@ -1331,9 +1331,9 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, @Override public String getKeyStoreStorePass() { String storePass = this.configurationOverlay.getKeyStoreStorePass(); - if (storePass == null) - storePass = getKeyStoreStorePassPersistent(); - return storePass; + if (storePass != null) + return storePass; + return getKeyStoreStorePassPersistent(); } /* (non-Javadoc) @@ -1377,9 +1377,9 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, @Override public String getKeyStoreKeyPass() { String keyPass = this.configurationOverlay.getKeyStoreKeyPass(); - if (keyPass == null) - keyPass = getKeyStoreKeyPassPersistent(); - return keyPass; + if (keyPass != null) + return keyPass; + return getKeyStoreKeyPassPersistent(); } /* (non-Javadoc) diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java index 4c634fd6..14383913 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java @@ -303,6 +303,7 @@ public interface ConfigurationContainer { * @param alias the keystore alias */ public void setKeyStoreAlias(String alias); + /** * Gets the keystore store password * @return the keystore store password diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index 9c2dc847..86d93daa 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java @@ -210,7 +210,6 @@ public class OpenState extends State { @SuppressWarnings("static-method") private void addPlaceholderSelectionToConfig(String selection) { try { - FileInputStream in = new FileInputStream(advancedConfig); PropertiesConfiguration config = new PropertiesConfiguration(); PropertiesConfigurationLayout layout = new PropertiesConfigurationLayout(config); layout.load(new InputStreamReader(new FileInputStream(advancedConfig))); -- cgit v1.2.3