diff --git a/jpos/build.gradle b/jpos/build.gradle index d6356541bf..c00415581b 100644 --- a/jpos/build.gradle +++ b/jpos/build.gradle @@ -29,7 +29,6 @@ dependencies { implementation libraries.sshd implementation libraries.eddsa implementation libraries.bytebuddy - implementation libraries.commons_lang3 testImplementation libraries.commons_lang3 testImplementation libraries.hamcrest diff --git a/jpos/src/main/java/org/jpos/annotation/resolvers/parameters/RegistryResolver.java b/jpos/src/main/java/org/jpos/annotation/resolvers/parameters/RegistryResolver.java index c08ba107d1..a3d9e0ba4e 100644 --- a/jpos/src/main/java/org/jpos/annotation/resolvers/parameters/RegistryResolver.java +++ b/jpos/src/main/java/org/jpos/annotation/resolvers/parameters/RegistryResolver.java @@ -6,9 +6,9 @@ import java.util.Map; import java.util.Map.Entry; -import org.apache.commons.lang3.StringUtils; import org.jpos.annotation.Registry; import org.jpos.core.ConfigurationException; +import org.jpos.iso.ISOUtil; import org.jpos.transaction.Context; import org.jpos.transaction.TransactionParticipant; import org.jpos.util.NameRegistrar; @@ -22,7 +22,7 @@ private static final class RegistryResolverImpl implements Resolver { public void configure(Parameter f) throws ConfigurationException { Registry annotation = f.getAnnotation(Registry.class); registryKey = findKey(annotation.value(), f.getType(), NameRegistrar.getAsMap()); - if (StringUtils.isEmpty(registryKey)) { + if (ISOUtil.isEmpty(registryKey)) { throw new ConfigurationException("Could not find Registry entry for " + f.getName()); } } @@ -44,7 +44,7 @@ String findKey(String key, Class type, Map entries) throws Configuratio protected String getMatch(String key, List typeMatches, List keyMatches) throws ConfigurationException { - if (StringUtils.isNotBlank(key)) { + if (!ISOUtil.isEmpty(key)) { return getMatch(key, keyMatches); } else { return getMatch(key, typeMatches); diff --git a/jpos/src/main/java/org/jpos/iso/ISOUtil.java b/jpos/src/main/java/org/jpos/iso/ISOUtil.java index d92f9264c7..af710b810c 100644 --- a/jpos/src/main/java/org/jpos/iso/ISOUtil.java +++ b/jpos/src/main/java/org/jpos/iso/ISOUtil.java @@ -1105,6 +1105,13 @@ public static boolean isZero( String s ) { public static boolean isBlank( String s ){ return s.trim().length() == 0; } + + /** + * @return true if the string is null or is blank filled (space char filled) + */ + public static boolean isEmpty(String s) { + return s == null || isBlank(s); + } /** * Return true if the string is alphanum.