This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new ea76b93 camel-util: minor ObjectHelper improvements (#3812)
ea76b93 is described below
commit ea76b9336fe9666de78fd1f3ccf77ea93d6c087b
Author: Alexey Markevich <[email protected]>
AuthorDate: Fri May 8 18:45:27 2020 +0300
camel-util: minor ObjectHelper improvements (#3812)
---
.../src/main/java/org/apache/camel/util/ObjectHelper.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
a/core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java
b/core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java
index c06a8dd..317b529 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java
@@ -194,8 +194,7 @@ public final class ObjectHelper {
if (value == null) {
return false;
} else if (value instanceof String) {
- String text = (String) value;
- return text.trim().length() > 0;
+ return !((String) value).trim().isEmpty();
} else if (value instanceof Collection) {
return !((Collection<?>) value).isEmpty();
} else if (value instanceof Map) {
@@ -1015,8 +1014,7 @@ public final class ObjectHelper {
return list.getLength() > 0;
} else if (value instanceof Collection) {
// is it an empty collection
- Collection<?> col = (Collection<?>) value;
- return col.size() > 0;
+ return !((Collection<?>) value).isEmpty();
}
return value != null;
}