summaryrefslogtreecommitdiff
path: root/pdf-over-signator/src/main/java
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-07 15:38:46 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-07 15:38:46 +0200
commit04a3b1d060e8ecb08e43e9ecf3b7fa3e1d48d362 (patch)
treef7752f13421323d44f052f7175768a12a99d7e2b /pdf-over-signator/src/main/java
parente568e0adf216569b5a0baed85d2d5e09b5d5d7f8 (diff)
downloadpdf-over-04a3b1d060e8ecb08e43e9ecf3b7fa3e1d48d362.tar.gz
pdf-over-04a3b1d060e8ecb08e43e9ecf3b7fa3e1d48d362.tar.bz2
pdf-over-04a3b1d060e8ecb08e43e9ecf3b7fa3e1d48d362.zip
cleanup unused imports/methods
Diffstat (limited to 'pdf-over-signator/src/main/java')
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java6
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
index 31cf18be..798788d2 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
@@ -18,6 +18,8 @@ package at.asit.pdfover.signator;
//Imports
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.InvocationTargetException;
import java.util.EnumMap;
import java.util.Map;
@@ -55,12 +57,12 @@ public class Signator {
// SignerFactory factory = (SignerFactory)pdfAsClass.newInstance();
// registerSigner(Signers.PDFAS, factory);
Class<?> pdfAs4Class = Class.forName("at.asit.pdfover.signer.pdfas.PdfAs4SignerFactory");
- SignerFactory factory = (SignerFactory)pdfAs4Class.newInstance();
+ SignerFactory factory = (SignerFactory)pdfAs4Class.getDeclaredConstructor().newInstance();
registerSigner(Signers.PDFAS4, factory);
} catch (ClassNotFoundException e) {
log.error("PDF Signer Factory not found", e);
throw new RuntimeException("PDF Signer Factory not found", e);
- } catch (InstantiationException e) {
+ } catch (InstantiationException | InvocationTargetException | NoSuchMethodException e) {
log.error("PDF Signer Factory could not be instantiated", e);
throw new RuntimeException("PDF Signer Factory could not be instantiated", e);
} catch (IllegalAccessException e) {
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java
index 24b86300..cde150f8 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java
@@ -15,8 +15,6 @@
*/
package at.asit.pdfover.signator;
-import at.asit.pdfover.signator.Signer;
-
/**
* A Signer factory
* Creates Signer instances