summaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-12-30 21:35:45 +0000
committerPJ Fanning <fanningpj@apache.org>2021-12-30 21:35:45 +0000
commitc8fc960d2dd31333ce5de03e5efa5dc11b3e019e (patch)
tree30c29c10c32cd74ee1e2d539c813c03166db13d5 /poi
parent9345c84194c677ce9bc1caab386e4d7936771e35 (diff)
downloadpoi-c8fc960d2dd31333ce5de03e5efa5dc11b3e019e.tar.gz
poi-c8fc960d2dd31333ce5de03e5efa5dc11b3e019e.zip
use isEmpty()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896547 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r--poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java2
-rw-r--r--poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheet.java2
-rw-r--r--poi/src/main/java/org/apache/poi/poifs/property/DirectoryProperty.java2
-rw-r--r--poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java4
-rw-r--r--poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java4
-rw-r--r--poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java2
6 files changed, 8 insertions, 8 deletions
diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java
index 4634d93349..38266f409d 100644
--- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java
+++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java
@@ -218,7 +218,7 @@ public final class HSSFChart {
} else if(r instanceof SeriesTextRecord) {
// Applies to a series, unless we've seen a legend already
SeriesTextRecord str = (SeriesTextRecord)r;
- if(lastChart.legendRecord == null && lastChart.series.size() > 0) {
+ if(lastChart.legendRecord == null && !lastChart.series.isEmpty()) {
HSSFSeries series = lastChart.series.get(lastChart.series.size()-1);
series.seriesTitleText = str;
} else {
diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
index 0bc614264e..a0984ae0d9 100644
--- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
+++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
@@ -300,7 +300,7 @@ public final class HSSFSheet implements Sheet {
}
}
- if (_rows.size() > 0) {
+ if (!_rows.isEmpty()) {
Integer key = Integer.valueOf(row.getRowNum());
HSSFRow removedRow = _rows.remove(key);
if (removedRow != row) {
diff --git a/poi/src/main/java/org/apache/poi/poifs/property/DirectoryProperty.java b/poi/src/main/java/org/apache/poi/poifs/property/DirectoryProperty.java
index b7e6356b38..bfa8796634 100644
--- a/poi/src/main/java/org/apache/poi/poifs/property/DirectoryProperty.java
+++ b/poi/src/main/java/org/apache/poi/poifs/property/DirectoryProperty.java
@@ -189,7 +189,7 @@ public class DirectoryProperty extends Property implements Parent, Iterable<Prop
*/
protected void preWrite()
{
- if (_children.size() > 0)
+ if (!_children.isEmpty())
{
Property[] children = _children.toArray(new Property[ 0 ]);
diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java b/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java
index 7f233aa5bc..3765e3b4fa 100644
--- a/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java
+++ b/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java
@@ -261,7 +261,7 @@ public class CellNumberFormatter extends CellFormatter {
first = false;
}
}
- if (fractionalSpecials.size() > 0) {
+ if (!fractionalSpecials.isEmpty()) {
fmtBuf.append('.');
for (Special s : fractionalSpecials) {
if (isDigitFmt(s)) {
@@ -822,7 +822,7 @@ public class CellNumberFormatter extends CellFormatter {
private void writeFractional(StringBuffer result, StringBuffer output) {
int digit;
int strip;
- if (fractionalSpecials.size() > 0) {
+ if (!fractionalSpecials.isEmpty()) {
String decimalSeparator = Character.toString(getDecimalFormatSymbols().getDecimalSeparator());
digit = result.indexOf(decimalSeparator) + 1;
if (exponent != null) {
diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java b/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java
index 339203890e..2de8b9dfba 100644
--- a/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java
+++ b/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java
@@ -49,7 +49,7 @@ public class CellNumberPartHandler implements PartHandler {
// See comment in writeScientific -- exponent handling is complex.
// (1) When parsing the format, remove the sign from after the 'e' and
// put it before the first digit of the exponent.
- if (exponent == null && specials.size() > 0) {
+ if (exponent == null && !specials.isEmpty()) {
exponent = new Special('.', pos);
specials.add(exponent);
insertSignForExponent = part.charAt(1);
@@ -73,7 +73,7 @@ public class CellNumberPartHandler implements PartHandler {
break;
case '.':
- if (decimalPoint == null && specials.size() > 0) {
+ if (decimalPoint == null && !specials.isEmpty()) {
decimalPoint = new Special('.', pos);
specials.add(decimalPoint);
}
diff --git a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java
index 907529a5d2..886340091c 100644
--- a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java
+++ b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java
@@ -357,7 +357,7 @@ final class TestPOIFSFileSystem {
dis.reset();
}
}
- assertTrue(props.size() > 0);
+ assertFalse(props.isEmpty());
}
}
return count;