You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/11/29 00:48:18 UTC
(commons-jelly) branch master updated: Use Collection#isEmpty()
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jelly.git
The following commit(s) were added to refs/heads/master by this push:
new e8682fe9 Use Collection#isEmpty()
e8682fe9 is described below
commit e8682fe966f025b43b4a6ed60e38e3a351d259e0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Nov 28 19:48:13 2023 -0500
Use Collection#isEmpty()
---
core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java | 2 +-
.../xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java b/core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java
index 023d16f2..790dd308 100644
--- a/core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java
+++ b/core/src/main/java/org/apache/commons/jelly/tags/core/NewTag.java
@@ -78,7 +78,7 @@ public class NewTag extends BaseClassLoaderTag implements ArgTagParent {
try {
Class theClass = getClassLoader().loadClass( className );
Object object = null;
- if (paramTypes.size() == 0) {
+ if (paramTypes.isEmpty()) {
object = theClass.getConstructor().newInstance();
} else {
Object[] values = paramValues.toArray();
diff --git a/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java b/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java
index 81ad82af..6819057b 100644
--- a/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java
+++ b/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java
@@ -117,7 +117,7 @@ public class SetTag extends XPathTagSupport {
if (single.booleanValue() == true) {
if (value instanceof List) {
List l = (List) value;
- if (l.size() == 0)
+ if (l.isEmpty())
value=null;
else
value=l.get(0);