aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad
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-scratchpad
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-scratchpad')
-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
2 files changed, 6 insertions, 6 deletions
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();
}
}