From c8fc960d2dd31333ce5de03e5efa5dc11b3e019e Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 30 Dec 2021 21:35:45 +0000 Subject: use isEmpty() git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896547 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java | 2 +- .../src/main/java/org/apache/poi/hsmf/MAPIMessage.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'poi-scratchpad/src') 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 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 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 val = mainChunks.getProperties().get(prop); - if (val != null && val.size() > 0) { + if (val != null && !val.isEmpty()) { return ((TimePropertyValue)val.get(0)).getValue(); } } -- cgit v1.2.3