pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1821398 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationTextMarkup.java
Date Wed, 17 Jan 2018 17:20:22 GMT
Author: tilman
Date: Wed Jan 17 17:20:22 2018
New Revision: 1821398

URL: http://svn.apache.org/viewvc?rev=1821398&view=rev
Log:
PDFBOX-2852: avoid ClassCastException

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationTextMarkup.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationTextMarkup.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationTextMarkup.java?rev=1821398&r1=1821397&r2=1821398&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationTextMarkup.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationTextMarkup.java
Wed Jan 17 17:20:22 2018
@@ -18,6 +18,7 @@ package org.apache.pdfbox.pdmodel.intera
 
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSArray;
+import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSName;
 
 /**
@@ -93,15 +94,13 @@ public class PDAnnotationTextMarkup exte
      */
     public float[] getQuadPoints()
     {
-        COSArray quadPoints = (COSArray) getCOSObject().getDictionaryObject(COSName.QUADPOINTS);
-        if (quadPoints != null)
+        COSBase base = getCOSObject().getDictionaryObject(COSName.QUADPOINTS);
+        if (base instanceof COSArray)
         {
-            return quadPoints.toFloatArray();
-        }
-        else
-        {
-            return null; // Should never happen as this is a required item
+            return ((COSArray) base).toFloatArray();
         }
+        // Should never happen as this is a required item
+        return null; 
     }
 
     /**



Mime
View raw message