From 04a3b1d060e8ecb08e43e9ecf3b7fa3e1d48d362 Mon Sep 17 00:00:00 2001
From: Jakob Heher <jakob.heher@iaik.tugraz.at>
Date: Thu, 7 Jul 2022 15:38:46 +0200
Subject: cleanup unused imports/methods

---
 .../src/main/java/at/asit/pdfover/signator/Signator.java            | 6 ++++--
 .../src/main/java/at/asit/pdfover/signator/SignerFactory.java       | 2 --
 2 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'pdf-over-signator/src/main/java')

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
-- 
cgit v1.2.3