summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java10
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Messages.java15
2 files changed, 10 insertions, 15 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java
index ad4fa70e..6ce5b176 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java
@@ -85,7 +85,7 @@ public class CertificateDownloadSource {
- if (!cp.getProxyHost().equals("")) {
+ if (!cp.getProxyHost().equals("")) { //$NON-NLS-1$
log.info("Found PDF-Over Host settings: "+cp.getProxyHost().toString()); //$NON-NLS-1$
try{
@@ -103,7 +103,7 @@ public class CertificateDownloadSource {
{log.info("Illegal Argument for Proxy and/or Host)");} //$NON-NLS-1$
} else {
- log.info("Opening default connection");
+ log.info("Opening default connection"); //$NON-NLS-1$
connection = url.openConnection();
}
@@ -131,7 +131,7 @@ public class CertificateDownloadSource {
Document doc = dBuilder.newDocument();
// root element
- Node rootElement = doc.createElement("certificates");
+ Node rootElement = doc.createElement("certificates"); //$NON-NLS-1$
doc.appendChild(rootElement);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
@@ -169,7 +169,7 @@ public class CertificateDownloadSource {
Node certificates_added = doc_added.getFirstChild();
NodeList certificates_added_list = certificates_added.getChildNodes();
- log.info("===== Starting to download accepted certificates =====");
+ log.info("===== Starting to download accepted certificates ====="); //$NON-NLS-1$
// identify the certificate that has to be downloaded
for (int i = 0; i < certificates_added_list.getLength(); i++) {
@@ -187,7 +187,7 @@ public class CertificateDownloadSource {
}
URLConnection connection;
- if (!certificateNode.getTextContent().equals("")) {
+ if (!certificateNode.getTextContent().equals("")) { //$NON-NLS-1$
String certResource = Constants.CERTIFICATE_DOWNLOAD_XML_URL
+ certificateNode.getTextContent();
URL url = new URL(certResource);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Messages.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Messages.java
index 6271656c..c48337e6 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Messages.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Messages.java
@@ -38,10 +38,7 @@ public class Messages {
private static final String BUNDLE_NAME = "at.asit.pdfover.gui.messages"; //$NON-NLS-1$
- private static HashMap<Locale, ResourceBundle> bundles = new HashMap<Locale, ResourceBundle>();
-
- //private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- // .getBundle(BUNDLE_NAME);
+ private static HashMap<Locale, ResourceBundle> bundles = new HashMap<>();
private static Locale currentLocale = getDefaultLocale();
@@ -71,17 +68,17 @@ public class Messages {
private static ResourceBundle getBundle(Locale locale) {
if(!bundles.containsKey(locale)) {
- log.debug("Loading resource bundle for " + locale); //$NON-NLS-1$
+ log.debug("Loading resource bundle for {}", locale); //$NON-NLS-1$
ResourceBundle tmp = null;
try {
tmp = ResourceBundle.getBundle(BUNDLE_NAME, locale);
- log.debug("Received bundle for " + tmp.getLocale()); //$NON-NLS-1$
+ log.debug("Received bundle for {}", tmp.getLocale()); //$NON-NLS-1$
} catch(Exception e) {
- log.error("NO RESOURCE BUNDLE FOR " + locale.toString(), e); //$NON-NLS-1$
+ log.error("NO RESOURCE BUNDLE FOR {} {}", locale, e); //$NON-NLS-1$
tmp = ResourceBundle.getBundle(BUNDLE_NAME);
}
if(tmp == null) {
- log.error("NO RESOURCE BUNDLE FOR " + locale.toString()); //$NON-NLS-1$
+ log.error("NO RESOURCE BUNDLE FOR {}", locale); //$NON-NLS-1$
tmp = ResourceBundle.getBundle(BUNDLE_NAME);
}
bundles.put(locale, tmp);
@@ -98,7 +95,6 @@ public class Messages {
public static String getString(String key) {
try {
return getBundle(currentLocale).getString(key);
- //return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
@@ -113,7 +109,6 @@ public class Messages {
public static String getString(String key, Locale locale) {
try {
return getBundle(locale).getString(key);
- //return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}