aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/text/XDDFTextParagraph.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java6
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java6
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFEndnote.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java2
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java4
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java2
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java2
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java10
-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
22 files changed, 35 insertions, 31 deletions
diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java
index 36696d03f8..b2be5c5038 100644
--- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java
+++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java
@@ -191,7 +191,7 @@ public class ExcelAntTest extends Task{
" of " + testCount + " evaluations failed to " +
"evaluate correctly.",
Project.MSG_ERR );
- if(showFailureDetail && failureMessages.size() > 0 ) {
+ if(showFailureDetail && !failureMessages.isEmpty()) {
for (String failureMessage : failureMessages) {
log(failureMessage, Project.MSG_ERR);
}
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/text/XDDFTextParagraph.java b/poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/text/XDDFTextParagraph.java
index 4f52d26a7a..021228247a 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/text/XDDFTextParagraph.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/text/XDDFTextParagraph.java
@@ -80,7 +80,7 @@ public class XDDFTextParagraph implements Iterable<XDDFTextRun> {
public void setText(String text) {
// keep the properties of current last run
XmlObject existing = null;
- if (_runs.size() > 0) {
+ if (!_runs.isEmpty()) {
existing = _runs.get(_runs.size() - 1).getProperties().copy();
}
// remove all runs
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
index 77f05767a2..9f97d4cd3c 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
@@ -134,7 +134,7 @@ public class XSLFTextParagraph implements TextParagraph<XSLFShape,XSLFTextParagr
public XSLFTextRun addLineBreak(){
XSLFLineBreak run = new XSLFLineBreak(_p.addNewBr(), this);
CTTextCharacterProperties brProps = run.getRPr(true);
- if(_runs.size() > 0){
+ if (!_runs.isEmpty()) {
// by default line break has the font size of the last text run
CTTextCharacterProperties prevRun = _runs.get(_runs.size() - 1).getRPr(true);
brProps.set(prevRun);
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java
index ad566183f9..82625070f1 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSharedStringsTable.java
@@ -66,7 +66,7 @@ public class XSSFBSharedStringsTable implements SharedStrings {
pkg.getPartsByContentType(XSSFBRelation.SHARED_STRINGS_BINARY.getContentType());
// Some workbooks have no shared strings table.
- if (parts.size() > 0) {
+ if (!parts.isEmpty()) {
PackagePart sstPart = parts.get(0);
try (InputStream stream = sstPart.getInputStream()) {
readFrom(stream);
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java
index b726545daf..0d8851c609 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java
@@ -226,7 +226,7 @@ public class XSSFBSheetHandler extends XSSFBParser {
private void outputHeaderFooter(XSSFBHeaderFooter headerFooter) {
String text = headerFooter.getString();
- if (text != null && text.trim().length() > 0) {
+ if (text != null && !text.trim().isEmpty()) {
handler.headerFooter(text, headerFooter.isHeader(), headerFooter.getHeaderFooterTypeLabel());
}
}
@@ -238,7 +238,7 @@ public class XSSFBSheetHandler extends XSSFBParser {
return;
}
Queue<CellAddress> queue = comments.getAddresses();
- while (queue.size() > 0) {
+ while (!queue.isEmpty()) {
CellAddress cellAddress = queue.peek();
if (cellAddress.getRow() == currentRow && cellAddress.getColumn() < colNum) {
cellAddress = queue.remove();
@@ -261,7 +261,7 @@ public class XSSFBSheetHandler extends XSSFBParser {
}
Queue<CellAddress> queue = comments.getAddresses();
int lastInterpolatedRow = -1;
- while (queue.size() > 0) {
+ while (!queue.isEmpty()) {
CellAddress cellAddress = queue.peek();
if (currentRow == CHECK_ALL_ROWS || cellAddress.getRow() < currentRow) {
cellAddress = queue.remove();
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
index 2f0c958260..95f0faaa14 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
@@ -129,7 +129,7 @@ public class ReadOnlySharedStringsTable extends DefaultHandler implements Shared
pkg.getPartsByContentType(XSSFRelation.SHARED_STRINGS.getContentType());
// Some workbooks have no shared strings table.
- if (parts.size() > 0) {
+ if (!parts.isEmpty()) {
PackagePart sstPart = parts.get(0);
try (InputStream stream = sstPart.getInputStream()) {
readFrom(stream);
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java
index 9b2050e080..3345eac4eb 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java
@@ -693,7 +693,7 @@ public class StylesTable extends POIXMLDocumentPart implements Styles {
styleSheet.setBorders(ctBorders);
// Xfs
- if(xfs.size() > 0) {
+ if (!xfs.isEmpty()) {
CTCellXfs ctXfs = styleSheet.getCellXfs();
if (ctXfs == null) {
ctXfs = CTCellXfs.Factory.newInstance();
@@ -706,7 +706,7 @@ public class StylesTable extends POIXMLDocumentPart implements Styles {
}
// Style xfs
- if(styleXfs.size() > 0) {
+ if (!styleXfs.isEmpty()) {
CTCellStyleXfs ctSXfs = styleSheet.getCellStyleXfs();
if (ctSXfs == null) {
ctSXfs = CTCellStyleXfs.Factory.newInstance();
@@ -719,7 +719,7 @@ public class StylesTable extends POIXMLDocumentPart implements Styles {
}
// Style dxfs
- if(dxfs.size() > 0) {
+ if (!dxfs.isEmpty()) {
CTDxfs ctDxfs = styleSheet.getDxfs();
if (ctDxfs == null) {
ctDxfs = CTDxfs.Factory.newInstance();
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
index 50ab442b15..4c8694f0a0 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
@@ -3632,7 +3632,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet, OoxmlSheetEx
}
// Now re-generate our CTHyperlinks, if needed
- if(hyperlinks.size() > 0) {
+ if (!hyperlinks.isEmpty()) {
if(worksheet.getHyperlinks() == null) {
worksheet.addNewHyperlinks();
}
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java
index 0d33e0c4f6..f93c644744 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextParagraph.java
@@ -112,7 +112,7 @@ public class XSSFTextParagraph implements Iterable<XSSFTextRun>{
public XSSFTextRun addLineBreak(){
CTTextLineBreak br = _p.addNewBr();
CTTextCharacterProperties brProps = br.addNewRPr();
- if(_runs.size() > 0){
+ if (!_runs.isEmpty()) {
// by default line break has the font size of the last text run
CTTextCharacterProperties prevRun = _runs.get(_runs.size() - 1).getRPr();
brProps.set(prevRun);
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
index 0552d8182f..7988e4e6e0 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
@@ -1741,7 +1741,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
*/
private void saveNamedRanges(){
// Named ranges
- if(namedRanges.size() > 0) {
+ if (!namedRanges.isEmpty()) {
CTDefinedNames names = CTDefinedNames.Factory.newInstance();
CTDefinedName[] nr = new CTDefinedName[namedRanges.size()];
int i = 0;
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFEndnote.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFEndnote.java
index 7c24e851d7..2319bf5eaa 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFEndnote.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFEndnote.java
@@ -68,7 +68,7 @@ public class XWPFEndnote extends XWPFAbstractFootnoteEndnote {
public void ensureFootnoteRef(XWPFParagraph p) {
XWPFRun r = null;
- if (p.getRuns().size() > 0) {
+ if (!p.runsIsEmpty()) {
r = p.getRuns().get(0);
}
if (r == null) {
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java
index 52584c310c..25be2a2681 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java
@@ -63,7 +63,7 @@ public class XWPFFootnote extends XWPFAbstractFootnoteEndnote {
public void ensureFootnoteRef(XWPFParagraph p) {
XWPFRun r = null;
- if (p.getRuns().size() > 0) {
+ if (!p.runsIsEmpty()) {
r = p.getRuns().get(0);
}
if (r == null) {
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
index c3185b4d3e..24837cc540 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
@@ -180,6 +180,10 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
return Collections.unmodifiableList(runs);
}
+ public boolean runsIsEmpty() {
+ return runs.isEmpty();
+ }
+
/**
* Return literal runs and sdt/content control objects.
*/
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java
index cff2221fb6..e4c5e6015d 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java
@@ -641,7 +641,7 @@ public final class TestXSSFExportToXML {
void testBug59026() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("59026.xlsx")) {
Collection<XSSFMap> mappings = wb.getCustomXMLMappings();
- assertTrue(mappings.size() > 0);
+ assertFalse(mappings.isEmpty());
for (XSSFMap map : mappings) {
XSSFExportToXml exporter = new XSSFExportToXml(map);
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
index 931b2df2de..8a0dc66958 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
@@ -906,7 +906,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
// Add the new picture in
int offset = 0;
- if (_pictures.size() > 0) {
+ if (!_pictures.isEmpty()) {
HSLFPictureData prev = _pictures.get(_pictures.size() - 1);
offset = prev.getOffset() + prev.getBseSize();
}
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java
index 6965aef448..c71f2a8e9b 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java
@@ -226,7 +226,7 @@ public class MAPIMessage extends POIReadOnlyDocument {
ByteChunk htmlBodyBinaryChunk = mainChunks.getHtmlBodyChunkBinary();
if (htmlBodyBinaryChunk != null) {
List<PropertyValue> cpid = mainChunks.getProperties().get(MAPIProperty.INTERNET_CPID);
- if (cpid != null && cpid.size() > 0) {
+ if (cpid != null && !cpid.isEmpty()) {
int codepage = ((LongPropertyValue) cpid.get(0)).getValue();
try {
String encoding = CodePageUtil.codepageToEncoding(codepage, true);
@@ -423,7 +423,7 @@ public class MAPIMessage extends POIReadOnlyDocument {
// General codepage: Message codepage property.
//
List<PropertyValue> val = mainChunks.getProperties().get(MAPIProperty.MESSAGE_CODEPAGE);
- if (val != null && val.size() > 0) {
+ if (val != null && !val.isEmpty()) {
int codepage = ((LongPropertyValue) val.get(0)).getValue();
try {
String encoding = CodePageUtil.codepageToEncoding(codepage, true);
@@ -437,7 +437,7 @@ public class MAPIMessage extends POIReadOnlyDocument {
//
if (generalcodepage == null) {
val = mainChunks.getProperties().get(MAPIProperty.MESSAGE_LOCALE_ID);
- if (val != null && val.size() > 0) {
+ if (val != null && !val.isEmpty()) {
int lcid = ((LongPropertyValue) val.get(0)).getValue();
int codepage = LocaleUtil.getDefaultCodePageFromLCID(lcid);
try {
@@ -476,7 +476,7 @@ public class MAPIMessage extends POIReadOnlyDocument {
// UTF-8 is ignored for text body. This seems to be a special Outlook behavior.
//
val = mainChunks.getProperties().get(MAPIProperty.INTERNET_CPID);
- if (val != null && val.size() > 0) {
+ if (val != null && !val.isEmpty()) {
int codepage = ((LongPropertyValue) val.get(0)).getValue();
try {
String encoding = CodePageUtil.codepageToEncoding(codepage, true);
@@ -644,7 +644,7 @@ public class MAPIMessage extends POIReadOnlyDocument {
MAPIProperty.CREATION_TIME
}) {
List<PropertyValue> val = mainChunks.getProperties().get(prop);
- if (val != null && val.size() > 0) {
+ if (val != null && !val.isEmpty()) {
return ((TimePropertyValue)val.get(0)).getValue();
}
}
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;