From 7f66428916800f37fcc3ea67310d2ef73eb2fa38 Mon Sep 17 00:00:00 2001 From: Emina Ahmetovic Date: Thu, 24 Sep 2020 09:46:48 +0200 Subject: update libraries, use StringUtils --- .../gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'pdf-as-lib/src/main/java') diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java index 5919ee5d..500b9e24 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java @@ -32,6 +32,7 @@ import at.gv.egiz.pdfas.common.settings.ISettings; import at.gv.egiz.pdfas.lib.api.IConfigurationConstants; import at.gv.egiz.pdfas.lib.impl.configuration.PlaceholderWebConfiguration; import at.gv.egiz.pdfas.lib.impl.status.OperationStatus; +import org.apache.commons.lang3.StringUtils; public class PlaceholderFilter implements IConfigurationConstants, PlaceholderExtractorConstants { @@ -45,18 +46,18 @@ public class PlaceholderFilter implements IConfigurationConstants, if (status.getPlaceholderConfiguration().isGlobalPlaceholderEnabled()) { PlaceholderExtractor extractor = status.getBackend().getPlaceholderExtractor(); - if(signatureLocation!=null) { + if(StringUtils.isNotEmpty(signatureLocation)) { placeholderID = signatureLocation; } else { placeholderID = PlaceholderWebConfiguration.getValue(PLACEHOLDER_WEB_ID); - if(placeholderID == null) { + if(StringUtils.isEmpty(placeholderID)) { placeholderID = settings.getValue(PLACEHOLDER_ID); } } String placeholderModeString = settings.getValue(PLACEHOLDER_MODE); int placeholderMode = PLACEHOLDER_MATCH_MODE_MODERATE; - if (placeholderModeString != null) { + if (StringUtils.isNotEmpty(placeholderModeString)) { try { placeholderMode = Integer.parseInt(placeholderModeString); if (placeholderMode < PLACEHOLDER_MODE_MIN @@ -78,11 +79,11 @@ public class PlaceholderFilter implements IConfigurationConstants, int placeholderMode = PLACEHOLDER_MATCH_MODE_SORTED; placeholderID = status.getPlaceholderConfiguration().getProfilePlaceholderID(status.getRequestedSignature().getSignatureProfileID()); - if(placeholderID != null) { + if(StringUtils.isNotEmpty(placeholderID)) { placeholderMode = PLACEHOLDER_MATCH_MODE_MODERATE; } String placeholderModeString = settings.getValue(PLACEHOLDER_MODE); - if (placeholderModeString != null) { + if (StringUtils.isNotEmpty(placeholderModeString)) { try { placeholderMode = Integer.parseInt(placeholderModeString); if (placeholderMode < PLACEHOLDER_MODE_MIN -- cgit v1.2.3