Skip to content

Commit

Permalink
master: Remove commons lang dependency in favor of ISOUtil.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ozzy Espaillat committed Dec 28, 2023
1 parent c736743 commit c9a5722
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion jpos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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());
}
}
Expand All @@ -44,7 +44,7 @@ String findKey(String key, Class<?> type, Map<?, ?> entries) throws Configuratio

protected String getMatch(String key, List<String> typeMatches, List<String> keyMatches)
throws ConfigurationException {
if (StringUtils.isNotBlank(key)) {
if (!ISOUtil.isEmpty(key)) {
return getMatch(key, keyMatches);
} else {
return getMatch(key, typeMatches);
Expand Down
7 changes: 7 additions & 0 deletions jpos/src/main/java/org/jpos/iso/ISOUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c9a5722

Please sign in to comment.