summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-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
3 files changed, 7 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 033080f6..a5651d0a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,4 +25,4 @@ release.properties
*.jks
*.p12
*.pem
-test-output/*
+test-*/*
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);
}
}