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-jxpath.git
The following commit(s) were added to refs/heads/master by this push: new 42be45c Use Collection#isEmpty() 42be45c is described below commit 42be45ce0197611436f05b311d4e9a829ce15c71 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Tue Nov 28 19:55:03 2023 -0500 Use Collection#isEmpty() --- .../java/org/apache/commons/jxpath/ri/axes/SimplePathInterpreter.java | 4 ++-- .../java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/jxpath/ri/axes/SimplePathInterpreter.java b/src/main/java/org/apache/commons/jxpath/ri/axes/SimplePathInterpreter.java index 09dd016..761716b 100644 --- a/src/main/java/org/apache/commons/jxpath/ri/axes/SimplePathInterpreter.java +++ b/src/main/java/org/apache/commons/jxpath/ri/axes/SimplePathInterpreter.java @@ -600,7 +600,7 @@ public class SimplePathInterpreter { final EvalContext context, final List parents, final Step[] steps, final int currentStep, final Expression[] predicates, final int currentPredicate) { - if (parents.size() == 0) { + if (parents.isEmpty()) { return null; } @@ -622,7 +622,7 @@ public class SimplePathInterpreter { newList.add(pointer); } } - if (newList.size() == 0) { + if (newList.isEmpty()) { return null; } return doPredicatesStandard( diff --git a/src/main/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java b/src/main/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java index 78827e7..45b76b7 100644 --- a/src/main/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java +++ b/src/main/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java @@ -234,10 +234,10 @@ public class JDOMNodePointer extends NodePointer { @Override public boolean isLeaf() { if (node instanceof Element) { - return ((Element) node).getContent().size() == 0; + return ((Element) node).getContent().isEmpty(); } if (node instanceof Document) { - return ((Document) node).getContent().size() == 0; + return ((Document) node).getContent().isEmpty(); } return true; }