From 7ba6fecaf1bc00c3e21102d6ba5fb6c6fc5f3398 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Wed, 14 Apr 2021 14:53:57 +0200 Subject: some code optimization to reduce memory consumption --- .../data/GenericSignatureVerificationResponse.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'eaaf_modules/eaaf_module_moa-sig/src') diff --git a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eaaf/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eaaf/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java index 28501c54..6006b731 100644 --- a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eaaf/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java +++ b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eaaf/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java @@ -3,6 +3,7 @@ package at.gv.egiz.eaaf.modules.sigverify.moasig.impl.data; import java.io.Serializable; import java.security.cert.CertificateException; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.List; @@ -54,7 +55,7 @@ public class GenericSignatureVerificationResponse private ExtendedCertificateValidation extendedCertificateValidation; - private List formValidationResults = new ArrayList<>(); + private List formValidationResults = null; @Override public Date getSigningDateTime() { @@ -105,6 +106,17 @@ public class GenericSignatureVerificationResponse } + @Override + public List getFormValidationResults() { + if (formValidationResults == null) { + return Collections.emptyList(); + + } else { + return formValidationResults; + + } + } + /** * Set signature creation timestramp. * @@ -161,7 +173,13 @@ public class GenericSignatureVerificationResponse if (formCheckResult != null) { for (Object elObj : formCheckResult) { if (elObj instanceof AdESFormResults) { - AdESFormResults el = (AdESFormResults)elObj; + AdESFormResults el = (AdESFormResults)elObj; + + if (formValidationResults == null) { + formValidationResults = new ArrayList<>(); + + } + formValidationResults.add(ExtendedResult.builder() .code(el.getCode()) .info(el.getName()) -- cgit v1.2.3