summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java8
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java3
2 files changed, 6 insertions, 5 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java
index af9e9d15..bed41f4a 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java
@@ -68,10 +68,12 @@ public class BKUSelectionState extends State {
@Override
public void run() {
Status status = getStateMachine().getStatus();
- if (!(status.getPreviousState() instanceof BKUSelectionState) &&
- !(status.getPreviousState() instanceof PositioningState)) {
+ State previousState = status.getPreviousState();
+ if (!(previousState instanceof OpenState) &&
+ !(previousState instanceof PositioningState) &&
+ !(previousState instanceof BKUSelectionState)) {
status.setBKU(BKUs.NONE);
- } else if((status.getPreviousState() instanceof PositioningState)) {
+ } else if(!(status.getPreviousState() instanceof BKUSelectionState)) {
ConfigProvider config = getStateMachine().getConfigProvider();
status.setBKU(config.getDefaultBKU());
}
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 86d93daa..1b734b32 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
@@ -207,7 +207,6 @@ public class OpenState extends State {
* The selected placeholder is added to the configuration file
* @param selection
*/
- @SuppressWarnings("static-method")
private void addPlaceholderSelectionToConfig(String selection) {
try {
PropertiesConfiguration config = new PropertiesConfiguration();
@@ -218,7 +217,7 @@ public class OpenState extends State {
layout.save(new FileWriter(advancedConfig, false));
} catch (Exception e) {
- log.error(e.getMessage(), e.getStackTrace());
+ log.error("Failed to add placeholder selection to config", e);
}
}