diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-07-06 12:52:15 +0200 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-07-06 12:52:15 +0200 |
commit | 82c045d786ef4a0728c1e89fb365afda81aef303 (patch) | |
tree | b6396536f273986777862c88ff15124f9d8a84ee /pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow | |
parent | f4c665e207973856578c2ad75de4df39b7bca641 (diff) | |
download | pdf-over-82c045d786ef4a0728c1e89fb365afda81aef303.tar.gz pdf-over-82c045d786ef4a0728c1e89fb365afda81aef303.tar.bz2 pdf-over-82c045d786ef4a0728c1e89fb365afda81aef303.zip |
remove leftover empty comments after e4767bccc7324d4b61a334bf6c0558d0080045e2
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow')
13 files changed, 146 insertions, 146 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java index 8b05a528..640d42bc 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java @@ -92,9 +92,9 @@ public class StateMachineImpl implements StateMachine, GUIProvider { try { current.run(); } catch (Exception e) { - log.error("StateMachine update: ", e); // + log.error("StateMachine update: ", e); ErrorDialog errorState = new ErrorDialog(this.getMainShell(), - Messages.getString("error.Unexpected"), BUTTONS.OK); // + Messages.getString("error.Unexpected"), BUTTONS.OK); //errorState.setException(e); //jumpToState(errorState); errorState.open(); @@ -109,7 +109,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { if (this.mainWindow != null && !this.mainWindow.getShell().isDisposed()) { - log.debug("Allowing MainWindow to update its state for " // + log.debug("Allowing MainWindow to update its state for " + current); current.updateMainWindowBehavior(); this.mainWindow.applyBehavior(); @@ -121,13 +121,13 @@ public class StateMachineImpl implements StateMachine, GUIProvider { } if (next == null) { - log.info("Next state is null -> exit"); // + log.info("Next state is null -> exit"); this.status.setCurrentState(next); break; } - log.debug("Changing state from: " // - + current + " to " // + log.debug("Changing state from: " + + current + " to " + next.toString()); this.status.setCurrentState(next); } @@ -181,7 +181,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { this.shell.open(); this.shell.layout(); } catch (Exception e) { - log.warn("Main-Window creation FAILED. Reason: " + e.getMessage()); // + log.warn("Main-Window creation FAILED. Reason: " + e.getMessage()); this.display = null; this.mainWindow = null; this.shell = null; @@ -214,7 +214,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { Composite.class, int.class, State.class); composite = constructor.newInstance(getComposite(), style, state); } catch (Exception e) { - log.error("Could not create Composite for Class " // + log.error("Could not create Composite for Class " + compositeClass.getName(), e); } return composite; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StatusImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StatusImpl.java index 2faf8b73..df64edf5 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StatusImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StatusImpl.java @@ -73,13 +73,13 @@ public class StatusImpl implements Status { */ public void setCurrentState(State currentState) { //if (this.previousState == this.currentState) - // log.error("Changing to same state? " + this.currentState); // + // log.error("Changing to same state? " + this.currentState); if (this.previousState != null && !this.previousState.equals(currentState)) { //Reference to previous state will be lost - perform cleanup - log.debug("Changing from " + this.currentState + " to " + currentState); // // - log.debug("Cleaning up " + this.previousState); // + log.debug("Changing from " + this.currentState + " to " + currentState); + log.debug("Cleaning up " + this.previousState); this.previousState.cleanUp(); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java index 38526326..3dd0dd7c 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java @@ -32,7 +32,7 @@ public interface ConfigProvider { /** * RegEx for parsing signature position */ - public static final String SIGN_POS_REGEX = "(x=(\\d\\.?\\d?);y=(\\d\\.?\\d?);p=(\\d))|(auto)|(x=(\\d\\.?\\d?);y=(\\d\\.?\\d?))"; // + public static final String SIGN_POS_REGEX = "(x=(\\d\\.?\\d?);y=(\\d\\.?\\d?);p=(\\d))|(auto)|(x=(\\d\\.?\\d?);y=(\\d\\.?\\d?))"; /** * Loads the configuration from a configuration file 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 6edd7662..1377f4ac 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 @@ -59,7 +59,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * An empty property entry */ - private static final String STRING_EMPTY = ""; // + private static final String STRING_EMPTY = ""; private String configurationFile = Constants.DEFAULT_CONFIG_FILENAME; @@ -162,7 +162,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, this.configuration.setMobileBKUType(MobileBKUs.valueOf( bkuType.trim().toUpperCase())); } catch (IllegalArgumentException e) { - log.error("Invalid BKU type: " + bkuType); // + log.error("Invalid BKU type: " + bkuType); this.configuration.setMobileBKUType(DEFAULT_MOBILE_BKU_TYPE); } } @@ -179,7 +179,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, if (port > 0 && port <= 0xFFFF) setProxyPort(port); else - log.warn("Proxy port is out of range!: " + port); // + log.warn("Proxy port is out of range!: " + port); } // Set Default BKU @@ -189,10 +189,10 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, try { defaultBKU = BKUs.valueOf(bkuString); } catch (IllegalArgumentException ex) { - log.error("Invalid BKU config value " + bkuString + " using none!"); // // + log.error("Invalid BKU config value " + bkuString + " using none!"); defaultBKU = BKUs.NONE; } catch (NullPointerException ex) { - log.error("Invalid BKU config value " + bkuString + " using none!"); // // + log.error("Invalid BKU config value " + bkuString + " using none!"); defaultBKU = BKUs.NONE; } } @@ -205,7 +205,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, try { transparency = Integer.parseInt(trans); } catch (NumberFormatException e) { - log.debug("Couldn't parse placeholder transparency", e); // + log.debug("Couldn't parse placeholder transparency", e); // ignore parsing exception } } @@ -226,7 +226,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, width = Integer.parseInt(size.substring(0, pos).trim()); height = Integer.parseInt(size.substring(pos + 1).trim()); } catch (NumberFormatException e) { - log.debug("Couldn't parse main window size", e); // + log.debug("Couldn't parse main window size", e); // ignore parsing exception } } @@ -257,7 +257,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, position = new SignaturePosition(x, y, p); } catch (NumberFormatException ex) { log.error( - "Signature Position read from config failed: Not a valid number", ex); // + "Signature Position read from config failed: Not a valid number", ex); } } else if (matcher.group(5) != null) { // we have format auto @@ -273,10 +273,10 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, position = new SignaturePosition(x, y); } } else { - log.error("Signature Position read from config failed: wrong group Count!"); // + log.error("Signature Position read from config failed: wrong group Count!"); } } else { - log.error("Signature Position read from config failed: not matching string"); // + log.error("Signature Position read from config failed: not matching string"); } } setDefaultSignaturePosition(position); @@ -338,7 +338,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, Integer.toString(getPlaceholderTransparency())); Point size = this.configuration.getMainWindowSize(); - props.setProperty(Constants.CFG_MAINWINDOW_SIZE, size.x + "," + size.y); // + props.setProperty(Constants.CFG_MAINWINDOW_SIZE, size.x + "," + size.y); Locale configLocale = getLocale(); if(configLocale != null) { @@ -366,12 +366,12 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, SignaturePosition pos = getDefaultSignaturePositionPersistent(); if (pos == null) { - props.setProperty(Constants.CFG_SIGNATURE_POSITION, ""); // + props.setProperty(Constants.CFG_SIGNATURE_POSITION, ""); } else if (pos.useAutoPositioning()) { - props.setProperty(Constants.CFG_SIGNATURE_POSITION, "auto"); // + props.setProperty(Constants.CFG_SIGNATURE_POSITION, "auto"); } else { props.setProperty(Constants.CFG_SIGNATURE_POSITION, - String.format((Locale) null, "x=%f;y=%f;p=%d", // + String.format((Locale) null, "x=%f;y=%f;p=%d", pos.getX(), pos.getY(), pos.getPage())); } @@ -415,9 +415,9 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, FileOutputStream outputstream = new FileOutputStream(configFile, false); - props.store(outputstream, "Configuration file was generated!"); // + props.store(outputstream, "Configuration file was generated!"); - log.info("Configuration file saved to " + configFile.getAbsolutePath()); // + log.info("Configuration file saved to " + configFile.getAbsolutePath()); } @@ -676,7 +676,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, this.configuration.setEmblem(emblem); } } catch (InvalidEmblemFile e) { - log.error("Error setting emblem file", e); // + log.error("Error setting emblem file", e); try { this.configuration.setEmblem(STRING_EMPTY); } catch (InvalidEmblemFile e1) { @@ -697,7 +697,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, this.configurationOverlay.setEmblem(emblem); } } catch (InvalidEmblemFile e) { - log.error("Error setting emblem file", e); // + log.error("Error setting emblem file", e); try { this.configurationOverlay.setEmblem(STRING_EMPTY); } catch (InvalidEmblemFile e1) { @@ -797,7 +797,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, try { this.configuration.setProxyPort(port); } catch (InvalidPortException e) { - log.error("Error setting proxy port" , e); // + log.error("Error setting proxy port" , e); // ignore } } @@ -810,7 +810,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, try { this.configurationOverlay.setProxyPort(port); } catch (InvalidPortException e) { - log.error("Error setting proxy port" , e); // + log.error("Error setting proxy port" , e); // ignore } } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java index 86d8f32f..21a3a2ac 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java @@ -70,10 +70,10 @@ public class KSState extends State { String file = config.getKeyStoreFile(); File f = new File(file); if (!f.isFile()) { - log.error("Keystore not found"); // + log.error("Keystore not found"); ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), - String.format(Messages.getString("error.KeyStoreFileNotExist"), f.getName()), // + String.format(Messages.getString("error.KeyStoreFileNotExist"), f.getName()), BUTTONS.RETRY_CANCEL); if (dialog.open() != SWT.RETRY) { //getStateMachine().exit(); @@ -88,25 +88,25 @@ public class KSState extends State { if (storePass.isEmpty()) { PasswordInputDialog pwd = new PasswordInputDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("keystore_config.KeystoreStorePass"), // - Messages.getString("keystore.KeystoreStorePassEntry")); // + Messages.getString("keystore_config.KeystoreStorePass"), + Messages.getString("keystore.KeystoreStorePassEntry")); storePass = pwd.open(); } String keyPass = config.getKeyStoreKeyPass(); if (keyPass.isEmpty()) { PasswordInputDialog pwd = new PasswordInputDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("keystore_config.KeystoreKeyPass"), // - Messages.getString("keystore.KeystoreKeyPassEntry")); // + Messages.getString("keystore_config.KeystoreKeyPass"), + Messages.getString("keystore.KeystoreKeyPassEntry")); keyPass = pwd.open(); } String type = config.getKeyStoreType(); signingState.setKSSigner(file, alias, storePass, keyPass, type); } catch (SignatureException e) { - log.error("Error loading keystore", e); // + log.error("Error loading keystore", e); ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("error.KeyStore"), // + Messages.getString("error.KeyStore"), BUTTONS.RETRY_CANCEL); if (dialog.open() != SWT.RETRY) { //getStateMachine().exit(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java index ed6ee411..91fae1cc 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java @@ -51,17 +51,17 @@ public class LocalBKUState extends State { /** * HTTP Response server HEADER */ - public final static String BKU_RESPONSE_HEADER_SERVER = "server"; // + public final static String BKU_RESPONSE_HEADER_SERVER = "server"; /** * HTTP Response user-agent HEADER */ - public final static String BKU_RESPONSE_HEADER_USERAGENT = "user-agent"; // + public final static String BKU_RESPONSE_HEADER_USERAGENT = "user-agent"; /** * HTTP Response SignatureLayout HEADER */ - public final static String BKU_RESPONSE_HEADER_SIGNATURE_LAYOUT = "SignatureLayout"; // + public final static String BKU_RESPONSE_HEADER_SIGNATURE_LAYOUT = "SignatureLayout"; Exception threadException = null; @@ -71,8 +71,8 @@ public class LocalBKUState extends State { /** * Null-Operation SL-Request */ - private final static String NULL_OPERATION_REQUEST = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + // - "<sl:NullOperationRequest xmlns:sl=\"http://www.buergerkarte.at/namespaces/securitylayer/1.2#\"/>"; // + private final static String NULL_OPERATION_REQUEST = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + + "<sl:NullOperationRequest xmlns:sl=\"http://www.buergerkarte.at/namespaces/securitylayer/1.2#\"/>"; /** * Constructor @@ -109,7 +109,7 @@ public class LocalBKUState extends State { PostMethod method = new PostMethod(Constants.LOCAL_BKU_URL); String sl_request = NULL_OPERATION_REQUEST; - method.addParameter("XMLRequest", sl_request); // + method.addParameter("XMLRequest", sl_request); int returnCode = client.executeMethod(method); String userAgent = getResponseHeader(method, BKU_RESPONSE_HEADER_USERAGENT); @@ -121,27 +121,27 @@ public class LocalBKUState extends State { } else { server = getResponseHeader(method, BKU_RESPONSE_HEADER_SERVER); if (server == null) - server = ""; // + server = ""; else - if (server.contains("trustDeskbasic") || server.contains("asignSecurityLayer")) // // + if (server.contains("trustDeskbasic") || server.contains("asignSecurityLayer")) LocalBKUState.this.useBase64Request = true; userAgent = getResponseHeader(method, BKU_RESPONSE_HEADER_USERAGENT); if (userAgent == null) - userAgent = ""; // + userAgent = ""; String signatureLayout = getResponseHeader(method, BKU_RESPONSE_HEADER_SIGNATURE_LAYOUT); - log.debug("Server - UA: " + server + " - " + userAgent); // // + log.debug("Server - UA: " + server + " - " + userAgent); String response = method.getResponseBodyAsString(); - log.debug("SL Response: " + response); // + log.debug("SL Response: " + response); SLResponse slResponse = new SLResponse(response, server, userAgent, signatureLayout); this.signingState.setSignatureResponse(slResponse); this.signingState.setUseBase64Request(LocalBKUState.this.useBase64Request); } } catch (Exception e) { - log.error("SignLocalBKUThread: ", e); // + log.error("SignLocalBKUThread: ", e); this.state.threadException = e; } finally { @@ -186,7 +186,7 @@ public class LocalBKUState extends State { if (this.threadException != null) { ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("error.LocalBKU"), // + Messages.getString("error.LocalBKU"), BUTTONS.RETRY_CANCEL); if (dialog.open() != SWT.RETRY) { //getStateMachine().exit(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java index 153d4b1d..f130c0e6 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java @@ -164,11 +164,11 @@ public class MobileBKUState extends State { * the exception
*/
public void displayError(Exception e) {
- String message = Messages.getString("error.Unexpected"); //
+ String message = Messages.getString("error.Unexpected");
log.error(message, e);
String errormsg = e.getLocalizedMessage();
if (errormsg != null && !errormsg.isEmpty())
- message += ": " + errormsg; //
+ message += ": " + errormsg;
displayError(message);
}
@@ -207,7 +207,7 @@ public class MobileBKUState extends State { ui.setErrorMessage(mobileStatus.errorMessage);
mobileStatus.errorMessage = null;
} else if (mobileStatus instanceof ATrustStatus) {
- ui.setErrorMessage(Messages.getString("mobileBKU.aTrustDisclaimer")); //
+ ui.setErrorMessage(Messages.getString("mobileBKU.aTrustDisclaimer"));
}
if (ui.getMobileNumber() == null
@@ -234,7 +234,7 @@ public class MobileBKUState extends State { if (ui.userCancel) {
ui.userCancel = false;
- mobileStatus.errorMessage = "cancel"; //
+ mobileStatus.errorMessage = "cancel";
return;
}
@@ -313,7 +313,7 @@ public class MobileBKUState extends State { try {
String resp = handler.getSignaturePage();
if (handler.handleQRResponse(resp)) {
- log.debug("Signature page response: " + resp); //
+ log.debug("Signature page response: " + resp);
getMobileBKUQRComposite().setDone(true);
Display display = getStateMachine().getGUIProvider().
getMainShell().getDisplay();
@@ -322,7 +322,7 @@ public class MobileBKUState extends State { }
Display.getDefault().wake();
} catch (Exception e) {
- log.error("Error getting signature page", e); //
+ log.error("Error getting signature page", e);
}
}
}, 0, 5000);
@@ -336,7 +336,7 @@ public class MobileBKUState extends State { InputStream qrcode = handler.getQRCode();
if (qrcode == null) {
MobileBKUState.this.threadException = new Exception(
- Messages.getString("error.FailedToLoadQRCode")); //
+ Messages.getString("error.FailedToLoadQRCode"));
}
qr.setQR(qrcode);
getStateMachine().getGUIProvider().display(qr);
@@ -470,7 +470,7 @@ public class MobileBKUState extends State { try {
String resp = handler.getSignaturePage();
if (handler.handleQRResponse(resp)) {
- log.debug("Signature page response: " + resp); //
+ log.debug("Signature page response: " + resp);
getMobileBKUFingerprintComposite().setDone(true);
Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay();
display.wake();
@@ -478,7 +478,7 @@ public class MobileBKUState extends State { }
Display.getDefault().wake();
} catch (Exception e) {
- log.error("Error getting signature page", e); //
+ log.error("Error getting signature page", e);
}
}
}, 0, 5000);
@@ -538,15 +538,15 @@ public class MobileBKUState extends State { this.signingState = getStateMachine().getStatus().getSigningState();
this.signingState.setBKUConnector(new MobileBKUConnector(this));
- log.debug("Setting base64 request to " + this.handler.useBase64Request()); //
+ log.debug("Setting base64 request to " + this.handler.useBase64Request());
this.signingState.setUseBase64Request(this.handler.useBase64Request());
if (this.threadException != null) {
- String message = Messages.getString("error.Unexpected"); //
+ String message = Messages.getString("error.Unexpected");
log.error(message, this.threadException);
String errormsg = this.threadException.getLocalizedMessage();
if (errormsg != null && !errormsg.isEmpty())
- message += ": " + errormsg; //
+ message += ": " + errormsg;
ErrorDialog error = new ErrorDialog(
getStateMachine().getGUIProvider().getMainShell(),
message, BUTTONS.OK);
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 78b9db3c..1e04a446 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 @@ -67,7 +67,7 @@ public class OpenState extends State { **/ private static final Logger log = LoggerFactory .getLogger(OpenState.class); - private static final String advancedConfig = Constants.CONFIG_DIRECTORY + File.separator + "/cfg/advancedconfig.properties"; // + private static final String advancedConfig = Constants.CONFIG_DIRECTORY + File.separator + "/cfg/advancedconfig.properties"; private DataSourceSelectComposite selectionComposite = null; @@ -106,7 +106,7 @@ public class OpenState extends State { return; } } - log.debug("Got Datasource: " + getStateMachine().getStatus().getDocument().getAbsolutePath()); // + log.debug("Got Datasource: " + getStateMachine().getStatus().getDocument().getAbsolutePath()); // scan for signature placeholders // - see if we want to scan for placeholders in the settings @@ -128,8 +128,8 @@ public class OpenState extends State { // icon MessageBox dialog = new MessageBox(getStateMachine().getGUIProvider().getMainShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL); - dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); // - dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); // + dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); + dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); // open dialog and await user selection int result = dialog.open(); @@ -143,8 +143,8 @@ public class OpenState extends State { } else if (fields.size() > 1) { PlaceholderSelectionGui gui = new PlaceholderSelectionGui( - getStateMachine().getGUIProvider().getMainShell(), 65570, "text", // - "select the fields", fields); // + getStateMachine().getGUIProvider().getMainShell(), 65570, "text", + "select the fields", fields); int res = gui.open(); if (res != -1) { getStateMachine().getStatus().setSearchForPlaceholderSignature(true); @@ -174,8 +174,8 @@ public class OpenState extends State { // create a dialog with ok and cancel buttons and a question icon MessageBox dialog = new MessageBox(getStateMachine().getGUIProvider().getMainShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL); - dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); // - dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); // + dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); + dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); // open dialog and await user selection int result = dialog.open(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java index 89b7d346..79e6551e 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java @@ -52,7 +52,7 @@ public class OutputState extends State { ConfigProvider config = getStateMachine().getConfigProvider(); Status status = getStateMachine().getStatus(); - File tmpDir = new File(config.getConfigurationDirectory() + File.separator + "tmp"); // + File tmpDir = new File(config.getConfigurationDirectory() + File.separator + "tmp"); if(!tmpDir.exists()) { tmpDir.mkdir(); @@ -83,7 +83,7 @@ public class OutputState extends State { if (status.getSignResult() == null) { ErrorDialog error = new ErrorDialog(getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("error.Signatur"), BUTTONS.RETRY_CANCEL); // + Messages.getString("error.Signatur"), BUTTONS.RETRY_CANCEL); if(error.open() == SWT.RETRY) { this.setNextState(new PrepareSigningState(getStateMachine())); } else { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java index df157774..6e1710bf 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java @@ -124,7 +124,7 @@ public class PositioningState extends State { Emblem emblem = new CachedFileNameEmblem(config.getDefaultEmblem()); param.setEmblem(emblem); if(config.getSignatureNote() != null && !config.getSignatureNote().isEmpty()) { - param.setProperty("SIG_NOTE", config.getSignatureNote()); // + param.setProperty("SIG_NOTE", config.getSignatureNote()); } param.setSignatureLanguage(config.getSignatureLocale().getLanguage()); @@ -156,15 +156,15 @@ public class PositioningState extends State { if ((this.document == null) || (this.loadedDocumentPath != getStateMachine().getStatus().getDocument())) { - log.debug("Checking PDF document for encryption"); // + log.debug("Checking PDF document for encryption"); try { openPDFDocument(); } catch (IOException e) { this.positionComposite = null; - log.error("Failed to display PDF document", e); // + log.error("Failed to display PDF document", e); String message = e.getLocalizedMessage(); if (message == null) - message = Messages.getString("error.IOError"); // + message = Messages.getString("error.IOError"); ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), message, BUTTONS.RETRY_CANCEL); @@ -182,10 +182,10 @@ public class PositioningState extends State { try { position = this.getPositioningComposite(this.document); } catch(Exception ex) { - log.error("Failed to create composite (probably a mac...)", ex); // + log.error("Failed to create composite (probably a mac...)", ex); ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("error.PositioningNotPossible"), BUTTONS.OK); // + Messages.getString("error.PositioningNotPossible"), BUTTONS.OK); dialog.open(); status.setSignaturePosition(new SignaturePosition()); this.setNextState(new BKUSelectionState(getStateMachine())); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java index 062231b4..b31ba4a9 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java @@ -114,7 +114,7 @@ public class PrepareConfigurationState extends State { new FileInputStream( getStateMachine().getConfigProvider().getConfigurationDirectory() + FILE_SEPARATOR + filename)); - log.info("Loaded config from file : " + filename); // + log.info("Loaded config from file : " + filename); } catch (FileNotFoundException ex) { if (filename.equals(Constants.DEFAULT_CONFIG_FILENAME)) { // we only check for resource config file if it is the @@ -125,7 +125,7 @@ public class PrepareConfigurationState extends State { getStateMachine().getConfigProvider() .loadConfiguration(is); - log.info("Loaded config from resource : " + filename); // + log.info("Loaded config from resource : " + filename); } catch (Exception eex) { throw ex; } @@ -136,7 +136,7 @@ public class PrepareConfigurationState extends State { } catch (IOException ex) { throw new InitializationException( - "Failed to read configuration from config file", ex); // + "Failed to read configuration from config file", ex); } } @@ -150,7 +150,7 @@ public class PrepareConfigurationState extends State { String note = config.getSignatureNote(); Locale loc = config.getSignatureLocale(); - String note_old = Messages.getString("simple_config.Note_Default_Old", loc); // + String note_old = Messages.getString("simple_config.Note_Default_Old", loc); if (note.equals(note_old)) resetSignatureNoteField(config); } @@ -189,9 +189,9 @@ public class PrepareConfigurationState extends State { } } catch (Exception e) { log.error( - "Failed to write PDF Over config file to config directory", e); // + "Failed to write PDF Over config file to config directory", e); throw new InitializationException( - "Failed to write PDF Over config file to config directory", // + "Failed to write PDF Over config file to config directory", e); } finally { if (pdfOverConfig != null) { @@ -199,7 +199,7 @@ public class PrepareConfigurationState extends State { pdfOverConfig.close(); } catch (IOException e) { log.warn( - "Failed to close File stream for PDFOver config", e); // + "Failed to close File stream for PDFOver config", e); } } @@ -208,7 +208,7 @@ public class PrepareConfigurationState extends State { inputStream.close(); } catch (IOException e) { log.warn( - "Failed to close Resource stream for PDFOver config", e); // + "Failed to close Resource stream for PDFOver config", e); } } } @@ -237,9 +237,9 @@ public class PrepareConfigurationState extends State { PropertyConfigurator.configureAndWatch(filename); } catch (Exception e) { log.error( - "Failed to write log4j config file to config directory", e); // + "Failed to write log4j config file to config directory", e); throw new InitializationException( - "Failed to write log4j config file to config directory", // + "Failed to write log4j config file to config directory", e); } finally { if (pdfOverConfig != null) { @@ -247,7 +247,7 @@ public class PrepareConfigurationState extends State { pdfOverConfig.close(); } catch (IOException e) { log.warn( - "Failed to close File stream for log4j config", e); // + "Failed to close File stream for log4j config", e); } } @@ -256,7 +256,7 @@ public class PrepareConfigurationState extends State { inputStream.close(); } catch (IOException e) { log.warn( - "Failed to close Resource stream for log4j config", e); // + "Failed to close Resource stream for log4j config", e); } } }*/ @@ -269,9 +269,9 @@ public class PrepareConfigurationState extends State { Zipper.unzip(is, configDir.getAbsolutePath()); } catch (IOException e) { log.error( - "Failed to create local configuration directory!", e); // + "Failed to create local configuration directory!", e); throw new InitializationException( - "Failed to create local configuration directory!", // + "Failed to create local configuration directory!", e); } } @@ -280,14 +280,14 @@ public class PrepareConfigurationState extends State { File versionFile = new File(configDir, Constants.CONFIG_VERSION_FILENAME); try { BufferedWriter versionWriter = new BufferedWriter(new FileWriter(versionFile)); - String version = Constants.APP_VERSION == null ? "Unknown" : Constants.APP_VERSION; // + String version = Constants.APP_VERSION == null ? "Unknown" : Constants.APP_VERSION; versionWriter.write(version); versionWriter.close(); } catch (IOException e) { log.error( - "Failed to create configuration version file!", e); // + "Failed to create configuration version file!", e); throw new InitializationException( - "Failed to create configuration version file!", // + "Failed to create configuration version file!", e); } } @@ -302,9 +302,9 @@ public class PrepareConfigurationState extends State { getStateMachine().getConfigManipulator().saveCurrentConfiguration(); } catch (IOException e) { log.error( - "Failed to set local configuration signature note!", e); // + "Failed to set local configuration signature note!", e); throw new InitializationException( - "Failed to set local configuration signature note!", // + "Failed to set local configuration signature note!", e); } } @@ -312,7 +312,7 @@ public class PrepareConfigurationState extends State { private void createConfiguration(File configDir) throws InitializationException { boolean allOK = false; - log.info("Creating configuration directory"); // + log.info("Creating configuration directory"); if (!configDir.exists()) { configDir.mkdir(); } @@ -345,14 +345,14 @@ public class PrepareConfigurationState extends State { String version; while ((version = versionReader.readLine()) != null) { version = version.trim(); - if (version.length() > 0 && !version.startsWith("#")) { // - log.trace("configuration version from " + versionFile // - + ": " + version); // + if (version.length() > 0 && !version.startsWith("#")) { + log.trace("configuration version from " + versionFile + + ": " + version); return version; } } } catch (IOException ex) { - log.error("failed to read configuration version from " // + log.error("failed to read configuration version from " + versionFile, ex); } finally { try { @@ -362,7 +362,7 @@ public class PrepareConfigurationState extends State { } } } - log.debug("unknown configuration version"); // + log.debug("unknown configuration version"); return null; } @@ -373,24 +373,24 @@ public class PrepareConfigurationState extends State { */ private void backupAndCreatePdfAsConfiguration(File configDir) throws InitializationException { try { - File backup = File.createTempFile(Constants.PDF_AS_CONFIG_BACKUP_FILENAME, ".zip"); // + File backup = File.createTempFile(Constants.PDF_AS_CONFIG_BACKUP_FILENAME, ".zip"); OutputStream os = new FileOutputStream(backup); - Zipper.zip(configDir + FILE_SEPARATOR + "cfg", os, true); // + Zipper.zip(configDir + FILE_SEPARATOR + "cfg", os, true); os.close(); unzipPdfAsConfig(configDir); - File b = new File(configDir, Constants.PDF_AS_CONFIG_BACKUP_FILENAME + ".zip"); // + File b = new File(configDir, Constants.PDF_AS_CONFIG_BACKUP_FILENAME + ".zip"); int i = 1; while (b.exists()) { - b = new File(configDir, Constants.PDF_AS_CONFIG_BACKUP_FILENAME + i++ + ".zip"); // + b = new File(configDir, Constants.PDF_AS_CONFIG_BACKUP_FILENAME + i++ + ".zip"); } backup.renameTo(b); updateVersionFile(configDir); } catch (FileNotFoundException e) { - log.error("Backup file not found", e); // - throw new InitializationException("Backup file not found", e); // + log.error("Backup file not found", e); + throw new InitializationException("Backup file not found", e); } catch (IOException e) { - log.error("Error creating configuration backup", e); // - throw new InitializationException("Error creating configuration backup", e); // + log.error("Error creating configuration backup", e); + throw new InitializationException("Error creating configuration backup", e); } } @@ -405,10 +405,10 @@ public class PrepareConfigurationState extends State { File configDir = new File(cDir); File configFile = new File(configDir, Constants.DEFAULT_CONFIG_FILENAME); if (!configDir.exists() || !configFile.exists()) { - log.debug("Creating configuration file"); // + log.debug("Creating configuration file"); createConfiguration(configDir); } else { - log.debug("Configuration directory exists!"); // + log.debug("Configuration directory exists!"); // Check PDF-AS config version File versionFile = new File(configDir, Constants.CONFIG_VERSION_FILENAME); String configVersion = getVersion(versionFile); @@ -422,9 +422,9 @@ public class PrepareConfigurationState extends State { initializeFromArguments(stateMachine.getCmdArgs(), this.configFileHandler); } catch (InitializationException e) { - log.error("Error in cmd line arguments: ", e); // + log.error("Error in cmd line arguments: ", e); ErrorDialog error = new ErrorDialog(gui.getMainShell(), - Messages.getString("error.CmdLineArgs") + "\n" + // // + Messages.getString("error.CmdLineArgs") + "\n" + e.getMessage(), BUTTONS.OK); error.open(); @@ -440,18 +440,18 @@ public class PrepareConfigurationState extends State { initializeFromArguments(stateMachine.getCmdArgs(), this.handler); } catch (InitializationException e) { - log.error("Error in cmd line arguments: ", e); // + log.error("Error in cmd line arguments: ", e); ErrorDialog error; if (e.getCause() instanceof FileNotFoundException) { error = new ErrorDialog(gui.getMainShell(), String.format( - Messages.getString("error.FileNotExist"), // + Messages.getString("error.FileNotExist"), e.getCause().getMessage()), BUTTONS.OK); } else { error = new ErrorDialog(gui.getMainShell(), - Messages.getString("error.CmdLineArgs") + "\n" + // // + Messages.getString("error.CmdLineArgs") + "\n" + e.getMessage(), BUTTONS.OK); } @@ -476,7 +476,7 @@ public class PrepareConfigurationState extends State { // invoke GUI message in main thread gui.getMainShell().getDisplay().asyncExec(() -> { Dialog info = new Dialog(gui.getMainShell(), - Messages.getString("version_check.UpdateTitle"), // + Messages.getString("version_check.UpdateTitle"), String.format(Messages.getString("version_check.UpdateText"), version), BUTTONS.OK_CANCEL, ICON.INFORMATION); @@ -486,16 +486,16 @@ public class PrepareConfigurationState extends State { try { Desktop.getDesktop().browse(new URI(Constants.UPDATE_URL)); } catch (Exception e) { - log.error("Error opening update location ", e); // + log.error("Error opening update location ", e); } } else { - log.info("SWT Desktop is not supported on this platform"); // + log.info("SWT Desktop is not supported on this platform"); Program.launch(Constants.UPDATE_URL); } } }); } catch (Exception e) { - log.error("Error downloading update information: ", e); // + log.error("Error downloading update information: ", e); } }).start(); } @@ -514,10 +514,10 @@ public class PrepareConfigurationState extends State { setNextState(new OpenState(stateMachine)); } catch (InitializationException e) { - log.error("Failed to initialize: ", e); // + log.error("Failed to initialize: ", e); ErrorDialog error = new ErrorDialog(getStateMachine() .getGUIProvider().getMainShell(), - Messages.getString("error.Initialization"), // + Messages.getString("error.Initialization"), BUTTONS.OK); // error.setException(e); // setNextState(error); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java index 11f5459a..10d1cd9f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java @@ -80,33 +80,33 @@ public class PrepareSigningState extends State { final String proxyPass = configuration.getProxyPass(); if (proxyHost != null && !proxyHost.isEmpty()) { - log.debug("Setting proxy host to " + proxyHost); // - System.setProperty("http.proxyHost", proxyHost); // - System.setProperty("https.proxyHost", proxyHost); // + log.debug("Setting proxy host to " + proxyHost); + System.setProperty("http.proxyHost", proxyHost); + System.setProperty("https.proxyHost", proxyHost); } if (proxyPort > 0 && proxyPort <= 0xFFFF) { String port = Integer.toString(proxyPort); - log.debug("Setting proxy port to " + port); // - System.setProperty("http.proxyPort", port); // - System.setProperty("https.proxyPort", port); // + log.debug("Setting proxy port to " + port); + System.setProperty("http.proxyPort", port); + System.setProperty("https.proxyPort", port); } if (proxyUser != null && !proxyUser.isEmpty()) { - log.debug("Setting proxy username to " + proxyUser); // - System.setProperty("http.proxyUser", proxyUser); // - System.setProperty("https.proxyUser", proxyUser); // + log.debug("Setting proxy username to " + proxyUser); + System.setProperty("http.proxyUser", proxyUser); + System.setProperty("https.proxyUser", proxyUser); } if (proxyPass != null) { - log.debug("Setting proxy password"); // - System.setProperty("http.proxyPassword", proxyPass); // - System.setProperty("https.proxyPassword", proxyPass); // + log.debug("Setting proxy password"); + System.setProperty("http.proxyPassword", proxyPass); + System.setProperty("https.proxyPassword", proxyPass); } if (proxyUser != null && !proxyUser.isEmpty() && proxyPass != null && !proxyPass.isEmpty()) { - log.debug("Enabling proxy authentication"); // + log.debug("Enabling proxy authentication"); Authenticator.setDefault(new Authenticator() { /* (non-Javadoc) * @see java.net.Authenticator#getPasswordAuthentication() @@ -153,7 +153,7 @@ public class PrepareSigningState extends State { if (configuration.getSignatureNote() != null && !configuration.getSignatureNote().isEmpty()) { this.state.signatureParameter.setProperty( - "SIG_NOTE", configuration.getSignatureNote()); // + "SIG_NOTE", configuration.getSignatureNote()); } this.state.signatureParameter @@ -172,7 +172,7 @@ public class PrepareSigningState extends State { .prepare(this.state.signatureParameter); } catch (Exception e) { - log.error("PrepareDocumentThread: ", e); // + log.error("PrepareDocumentThread: ", e); this.state.threadException = e; } finally { this.state.updateStateMachine(); @@ -228,7 +228,7 @@ public class PrepareSigningState extends State { if (this.threadException != null) { ErrorDialog error = new ErrorDialog(getStateMachine() .getGUIProvider().getMainShell(), - Messages.getString("error.PrepareDocument"), // + Messages.getString("error.PrepareDocument"), BUTTONS.RETRY_CANCEL); this.threadException = null; if (error.open() == SWT.RETRY) { @@ -249,7 +249,7 @@ public class PrepareSigningState extends State { } else if (status.getBKU() == BKUs.KS) { this.setNextState(new KSState(getStateMachine())); } else { - log.error("Invalid selected BKU Value \"NONE\" in PrepareSigningState!"); // + log.error("Invalid selected BKU Value \"NONE\" in PrepareSigningState!"); this.setNextState(new BKUSelectionState(getStateMachine())); } } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java index 12412b42..3bc67d65 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java @@ -102,13 +102,13 @@ public class SigningState extends State { this.threadException = new SignatureException(new IllegalStateException()); } - String message = Messages.getString("error.Signatur"); // + String message = Messages.getString("error.Signatur"); if (this.threadException instanceof SignatureException) { Throwable cause = this.threadException; while (cause.getCause() != null) cause = cause.getCause(); if (cause instanceof ConnectException) - message += ": " + cause.getMessage(); // + message += ": " + cause.getMessage(); if (cause instanceof IllegalStateException) { // Dummy exception - don't display error, go back to BKU Selection this.setNextState(new BKUSelectionState(getStateMachine())); |