Skip to content

Commit

Permalink
Fix wrong isNotEmpty calls
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed May 14, 2024
1 parent c254804 commit 0c120c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,14 @@ public ApiMethodHelper(Class<T> apiMethodEnum, Map<String, String> aliases, List
// add method name alias
String alias = matcher.replaceAll(aliasEntry.getValue());
// convert first character to lowercase
ObjectHelper.isNotEmpty(alias);
ObjectHelper.notNullOrEmpty(alias, "alias");
final char firstChar = alias.charAt(0);
if (!Character.isLowerCase(firstChar)) {
final StringBuilder builder = new StringBuilder();
builder.append(Character.toLowerCase(firstChar)).append(alias, 1, alias.length());
alias = builder.toString();
}
Set<String> names = tmpAliasesMap.get(alias);
if (names == null) {
names = new HashSet<>();
tmpAliasesMap.put(alias, names);
}
Set<String> names = tmpAliasesMap.computeIfAbsent(alias, k -> new HashSet<>());
names.add(name);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ boolean isFrozen() {
* (the names are suitably extended by the segment originally lopped off).
*/
protected Map<String, Object> internalBind(String name, Object value) throws NamingException {
org.apache.camel.util.ObjectHelper.isNotEmpty(name);
org.apache.camel.util.ObjectHelper.notNullOrEmpty(name, "name");
org.apache.camel.util.ObjectHelper.notNull(frozen, "frozen");

Map<String, Object> newBindings = new HashMap<>();
Expand All @@ -122,7 +122,7 @@ protected Map<String, Object> internalBind(String name, Object value) throws Nam
newBindings.put(name, value);
} else {
String segment = name.substring(0, pos);
org.apache.camel.util.ObjectHelper.isNotEmpty(segment);
org.apache.camel.util.ObjectHelper.notNullOrEmpty(segment, "segment");
Object o = treeBindings.get(segment);
if (o == null) {
o = newContext();
Expand Down

0 comments on commit 0c120c9

Please sign in to comment.