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 2021/01/17 01:34:50 UTC
[commons-beanutils] branch master updated: Use 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-beanutils.git
The following commit(s) were added to refs/heads/master by this push:
new 2f93ad5 Use isEmpty().
2f93ad5 is described below
commit 2f93ad58fa1568694fe042a9ec3cba3855329d0b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jan 16 20:34:45 2021 -0500
Use isEmpty().
---
.../java/org/apache/commons/beanutils2/DynaProperty.java | 4 ++--
.../java/org/apache/commons/beanutils2/LazyDynaList.java | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/commons/beanutils2/DynaProperty.java b/src/main/java/org/apache/commons/beanutils2/DynaProperty.java
index bb490ed..6291b88 100644
--- a/src/main/java/org/apache/commons/beanutils2/DynaProperty.java
+++ b/src/main/java/org/apache/commons/beanutils2/DynaProperty.java
@@ -135,12 +135,12 @@ public class DynaProperty implements Serializable {
/** The <em>(optional)</em> type of content elements for indexed {@code DynaProperty} */
protected transient Class<?> contentType;
-
+
/**
* Empty array.
*/
static final DynaProperty[] EMPTY_DYNA_PROPERTY_ARRAY = new DynaProperty[0];
-
+
/**
* Gets the <em>(optional)</em> type of the indexed content for {@code DynaProperty}'s
* that support this feature.
diff --git a/src/main/java/org/apache/commons/beanutils2/LazyDynaList.java b/src/main/java/org/apache/commons/beanutils2/LazyDynaList.java
index b12b9ff..4906a50 100644
--- a/src/main/java/org/apache/commons/beanutils2/LazyDynaList.java
+++ b/src/main/java/org/apache/commons/beanutils2/LazyDynaList.java
@@ -295,7 +295,7 @@ public class LazyDynaList extends ArrayList<Object> {
@Override
public boolean addAll(final Collection<?> collection) {
- if (collection == null || collection.size() == 0) {
+ if (collection == null || collection.isEmpty()) {
return false;
}
@@ -324,7 +324,7 @@ public class LazyDynaList extends ArrayList<Object> {
@Override
public boolean addAll(final int index, final Collection<?> collection) {
- if (collection == null || collection.size() == 0) {
+ if (collection == null || collection.isEmpty()) {
return false;
}
@@ -333,7 +333,7 @@ public class LazyDynaList extends ArrayList<Object> {
// Call "transform" with first element, before
// List is "grown" to ensure the correct DynaClass
// is set.
- if (size() == 0) {
+ if (isEmpty()) {
transform(collection.iterator().next());
}
@@ -408,7 +408,7 @@ public class LazyDynaList extends ArrayList<Object> {
@Override
public Object[] toArray() {
- if (size() == 0 && elementType == null) {
+ if (isEmpty() && elementType == null) {
return LazyDynaBean.EMPTY_LAZY_DYNA_BEAN_ARRAY;
}
@@ -438,7 +438,7 @@ public class LazyDynaList extends ArrayList<Object> {
final Class<?> arrayType = model.getClass().getComponentType();
if (DynaBean.class.isAssignableFrom(arrayType)
- || size() == 0 && elementType == null) {
+ || isEmpty() && elementType == null) {
return super.toArray(model);
}
@@ -483,7 +483,7 @@ public class LazyDynaList extends ArrayList<Object> {
*/
public DynaBean[] toDynaBeanArray() {
- if (size() == 0 && elementDynaBeanType == null) {
+ if (isEmpty() && elementDynaBeanType == null) {
return LazyDynaBean.EMPTY_LAZY_DYNA_BEAN_ARRAY;
}