pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1818390 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java
Date Sat, 16 Dec 2017 12:06:21 GMT
Author: tilman
Date: Sat Dec 16 12:06:21 2017
New Revision: 1818390

URL: http://svn.apache.org/viewvc?rev=1818390&view=rev
Log:
PDFBOX-2852: use isEmpty()

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java?rev=1818390&r1=1818389&r2=1818390&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java Sat Dec 16 12:06:21
2017
@@ -501,7 +501,7 @@ public class CFFParser
 
             List<Number> privMatrix = null;
             List<Map<String, Object>> fontDicts = ((CFFCIDFont) font).getFontDicts();
-            if (fontDicts.size() > 0 && fontDicts.get(0).containsKey("FontMatrix"))
+            if (!fontDicts.isEmpty() && fontDicts.get(0).containsKey("FontMatrix"))
             {
                 privMatrix = (List<Number>) fontDicts.get(0).get("FontMatrix");
             }
@@ -1150,25 +1150,25 @@ public class CFFParser
         public Boolean getBoolean(String name, boolean defaultValue)
         {
             Entry entry = getEntry(name);
-            return entry != null && entry.getArray().size() > 0 ? entry.getBoolean(0)
: defaultValue;
+            return entry != null && !entry.getArray().isEmpty() ? entry.getBoolean(0)
: defaultValue;
         }
 
         public List<Number> getArray(String name, List<Number> defaultValue)
         {
             Entry entry = getEntry(name);
-            return entry != null && entry.getArray().size() > 0 ? entry.getArray()
: defaultValue;
+            return entry != null && !entry.getArray().isEmpty() ? entry.getArray()
: defaultValue;
         }
 
         public Number getNumber(String name, Number defaultValue)
         {
             Entry entry = getEntry(name);
-            return entry != null && entry.getArray().size() > 0 ? entry.getNumber(0)
: defaultValue;
+            return entry != null && !entry.getArray().isEmpty() ? entry.getNumber(0)
: defaultValue;
         }
 
         public List<Number> getDelta(String name, List<Number> defaultValue)

         {
             Entry entry = getEntry(name);
-            return entry != null && entry.getDelta().size() > 0 ? entry.getDelta()
: defaultValue;
+            return entry != null && !entry.getArray().isEmpty() ? entry.getDelta()
: defaultValue;
         }
         
         /**



Mime
View raw message