pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1760235 - in /pdfbox/branches/2.0: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/ pdfbox/src/main/java/org/apache/pdfbox/rendering/ preflight/src/main/java/or...
Date Sun, 11 Sep 2016 10:04:16 GMT
Author: tilman
Date: Sun Sep 11 10:04:16 2016
New Revision: 1760235

URL: http://svn.apache.org/viewvc?rev=1760235&view=rev
Log:
PDFBOX-2852: remove unnecessary type casting and type arguments, as suggested by Lorenz Pahl

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/FieldUtils.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDChoice.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/TrueTypeFontValidator.java
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type1FontValidator.java
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java
    pdfbox/branches/2.0/preflight/src/test/java/org/apache/pdfbox/preflight/TestIsartorBavaria.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java
Sun Sep 11 10:04:16 2016
@@ -1,213 +1,213 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pdfbox.pdmodel.graphics.blend;
-
-import org.apache.pdfbox.cos.COSArray;
-import org.apache.pdfbox.cos.COSBase;
-import org.apache.pdfbox.cos.COSName;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Blend mode.
- *
- * @author Kühn & Weyh Software GmbH
- */
-public abstract class BlendMode
-{
-    /**
-     * Determines the blend mode from the BM entry in the COS ExtGState.
-     *
-     * @param cosBlendMode name or array
-     * @return blending mode
-     */
-    public static BlendMode getInstance(COSBase cosBlendMode)
-    {
-        BlendMode result = null;
-        if (cosBlendMode instanceof COSName)
-        {
-            result = BLEND_MODES.get((COSName)cosBlendMode);
-        }
-        else if (cosBlendMode instanceof COSArray)
-        {
-            COSArray cosBlendModeArray = (COSArray) cosBlendMode;
-            for (int i = 0; i < cosBlendModeArray.size(); i++)
-            {
-                result = BLEND_MODES.get(cosBlendModeArray.get(i));
-                if (result != null)
-                {
-                    break;
-                }
-            }
-        }
-
-        if (result != null)
-        {
-            return result;
-        }
-        return BlendMode.COMPATIBLE;
-    }
-
-    public static final SeparableBlendMode NORMAL = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return srcValue;
-        }
-    };
-
-    public static final SeparableBlendMode COMPATIBLE = NORMAL;
-
-    public static final SeparableBlendMode MULTIPLY = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return srcValue * dstValue;
-        }
-    };
-
-    public static final SeparableBlendMode SCREEN = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return srcValue + dstValue - srcValue * dstValue;
-        }
-    };
-
-    public static final SeparableBlendMode OVERLAY = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return (dstValue <= 0.5) ? 2 * dstValue * srcValue : 2 * (srcValue + dstValue
- srcValue
-                    * dstValue) - 1;
-        }
-    };
-
-    public static final SeparableBlendMode DARKEN = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return Math.min(srcValue, dstValue);
-        }
-    };
-
-    public static final SeparableBlendMode LIGHTEN = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return Math.max(srcValue, dstValue);
-        }
-    };
-
-    public static final SeparableBlendMode COLOR_DODGE = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return (srcValue < 1) ? Math.min(1, dstValue / (1 - srcValue)) : 1;
-        }
-    };
-
-    public static final SeparableBlendMode COLOR_BURN = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return (srcValue > 0) ? 1 - Math.min(1, (1 - dstValue) / srcValue) : 0;
-        }
-    };
-
-    public static final SeparableBlendMode HARD_LIGHT = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return (srcValue <= 0.5) ? 2 * dstValue * srcValue :
-                    2 * (srcValue + dstValue - srcValue * dstValue) - 1;
-        }
-    };
-
-    public static final SeparableBlendMode SOFT_LIGHT = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            if (srcValue <= 0.5)
-            {
-                return dstValue - (1 - 2 * srcValue) * dstValue * (1 - dstValue);
-            }
-            else
-            {
-                float d = (dstValue <= 0.25) ? ((16 * dstValue - 12) * dstValue + 4) *
dstValue
-                        : (float) Math .sqrt(dstValue);
-                return dstValue + (2 * srcValue - 1) * (d - dstValue);
-            }
-        }
-    };
-
-    public static final SeparableBlendMode DIFFERENCE = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return Math.abs(dstValue - srcValue);
-        }
-    };
-
-    public static final SeparableBlendMode EXCLUSION = new SeparableBlendMode()
-    {
-        @Override
-        public float blendChannel(float srcValue, float dstValue)
-        {
-            return dstValue + srcValue - 2 * dstValue * srcValue;
-        }
-    };
-
-    // this map *must* come after the declarations above, otherwise its values will be null
-    private static final Map<COSName, BlendMode> BLEND_MODES = createBlendModeMap();
-
-    private static Map<COSName, BlendMode> createBlendModeMap()
-    {
-        Map<COSName, BlendMode> map = new HashMap<COSName, BlendMode>(13);
-        map.put(COSName.NORMAL, BlendMode.NORMAL);
-        map.put(COSName.COMPATIBLE, BlendMode.COMPATIBLE);
-        map.put(COSName.MULTIPLY, BlendMode.MULTIPLY);
-        map.put(COSName.SCREEN, BlendMode.SCREEN);
-        map.put(COSName.OVERLAY, BlendMode.OVERLAY);
-        map.put(COSName.DARKEN, BlendMode.DARKEN);
-        map.put(COSName.LIGHTEN, BlendMode.LIGHTEN);
-        map.put(COSName.COLOR_DODGE, BlendMode.COLOR_DODGE);
-        map.put(COSName.COLOR_BURN, BlendMode.COLOR_BURN);
-        map.put(COSName.HARD_LIGHT, BlendMode.HARD_LIGHT);
-        map.put(COSName.SOFT_LIGHT, BlendMode.SOFT_LIGHT);
-        map.put(COSName.DIFFERENCE, BlendMode.DIFFERENCE);
-        map.put(COSName.EXCLUSION, BlendMode.EXCLUSION);
-        // TODO - non-separable blending modes
-        return map;
-    }
-
-    BlendMode()
-    {
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pdfbox.pdmodel.graphics.blend;
+
+import org.apache.pdfbox.cos.COSArray;
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSName;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Blend mode.
+ *
+ * @author Kühn &amp; Weyh Software GmbH
+ */
+public abstract class BlendMode
+{
+    /**
+     * Determines the blend mode from the BM entry in the COS ExtGState.
+     *
+     * @param cosBlendMode name or array
+     * @return blending mode
+     */
+    public static BlendMode getInstance(COSBase cosBlendMode)
+    {
+        BlendMode result = null;
+        if (cosBlendMode instanceof COSName)
+        {
+            result = BLEND_MODES.get(cosBlendMode);
+        }
+        else if (cosBlendMode instanceof COSArray)
+        {
+            COSArray cosBlendModeArray = (COSArray) cosBlendMode;
+            for (int i = 0; i < cosBlendModeArray.size(); i++)
+            {
+                result = BLEND_MODES.get(cosBlendModeArray.get(i));
+                if (result != null)
+                {
+                    break;
+                }
+            }
+        }
+
+        if (result != null)
+        {
+            return result;
+        }
+        return BlendMode.COMPATIBLE;
+    }
+
+    public static final SeparableBlendMode NORMAL = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return srcValue;
+        }
+    };
+
+    public static final SeparableBlendMode COMPATIBLE = NORMAL;
+
+    public static final SeparableBlendMode MULTIPLY = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return srcValue * dstValue;
+        }
+    };
+
+    public static final SeparableBlendMode SCREEN = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return srcValue + dstValue - srcValue * dstValue;
+        }
+    };
+
+    public static final SeparableBlendMode OVERLAY = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return (dstValue <= 0.5) ? 2 * dstValue * srcValue : 2 * (srcValue + dstValue
- srcValue
+                    * dstValue) - 1;
+        }
+    };
+
+    public static final SeparableBlendMode DARKEN = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return Math.min(srcValue, dstValue);
+        }
+    };
+
+    public static final SeparableBlendMode LIGHTEN = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return Math.max(srcValue, dstValue);
+        }
+    };
+
+    public static final SeparableBlendMode COLOR_DODGE = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return (srcValue < 1) ? Math.min(1, dstValue / (1 - srcValue)) : 1;
+        }
+    };
+
+    public static final SeparableBlendMode COLOR_BURN = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return (srcValue > 0) ? 1 - Math.min(1, (1 - dstValue) / srcValue) : 0;
+        }
+    };
+
+    public static final SeparableBlendMode HARD_LIGHT = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return (srcValue <= 0.5) ? 2 * dstValue * srcValue :
+                    2 * (srcValue + dstValue - srcValue * dstValue) - 1;
+        }
+    };
+
+    public static final SeparableBlendMode SOFT_LIGHT = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            if (srcValue <= 0.5)
+            {
+                return dstValue - (1 - 2 * srcValue) * dstValue * (1 - dstValue);
+            }
+            else
+            {
+                float d = (dstValue <= 0.25) ? ((16 * dstValue - 12) * dstValue + 4) *
dstValue
+                        : (float) Math .sqrt(dstValue);
+                return dstValue + (2 * srcValue - 1) * (d - dstValue);
+            }
+        }
+    };
+
+    public static final SeparableBlendMode DIFFERENCE = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return Math.abs(dstValue - srcValue);
+        }
+    };
+
+    public static final SeparableBlendMode EXCLUSION = new SeparableBlendMode()
+    {
+        @Override
+        public float blendChannel(float srcValue, float dstValue)
+        {
+            return dstValue + srcValue - 2 * dstValue * srcValue;
+        }
+    };
+
+    // this map *must* come after the declarations above, otherwise its values will be null
+    private static final Map<COSName, BlendMode> BLEND_MODES = createBlendModeMap();
+
+    private static Map<COSName, BlendMode> createBlendModeMap()
+    {
+        Map<COSName, BlendMode> map = new HashMap<COSName, BlendMode>(13);
+        map.put(COSName.NORMAL, BlendMode.NORMAL);
+        map.put(COSName.COMPATIBLE, BlendMode.COMPATIBLE);
+        map.put(COSName.MULTIPLY, BlendMode.MULTIPLY);
+        map.put(COSName.SCREEN, BlendMode.SCREEN);
+        map.put(COSName.OVERLAY, BlendMode.OVERLAY);
+        map.put(COSName.DARKEN, BlendMode.DARKEN);
+        map.put(COSName.LIGHTEN, BlendMode.LIGHTEN);
+        map.put(COSName.COLOR_DODGE, BlendMode.COLOR_DODGE);
+        map.put(COSName.COLOR_BURN, BlendMode.COLOR_BURN);
+        map.put(COSName.HARD_LIGHT, BlendMode.HARD_LIGHT);
+        map.put(COSName.SOFT_LIGHT, BlendMode.SOFT_LIGHT);
+        map.put(COSName.DIFFERENCE, BlendMode.DIFFERENCE);
+        map.put(COSName.EXCLUSION, BlendMode.EXCLUSION);
+        // TODO - non-separable blending modes
+        return map;
+    }
+
+    BlendMode()
+    {
+    }
+}

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/FieldUtils.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/FieldUtils.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/FieldUtils.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/FieldUtils.java
Sun Sep 11 10:04:16 2016
@@ -186,7 +186,7 @@ public final class FieldUtils
                 return getItemsFromPair(items, pairIdx);
             }            
         }
-        return Collections.<String>emptyList();
+        return Collections.emptyList();
     }    
 
     /**

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java
Sun Sep 11 10:04:16 2016
@@ -243,7 +243,7 @@ public final class PDAcroForm implements
                     	}
                     	Integer pageRef = annotationToPageRef.get(widget.getCOSObject());
                     	if (pageRef != null) {
-                    		page = document.getPage((int) pageRef);
+                    		page = document.getPage(pageRef);
                     	}
                     }
 

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDChoice.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDChoice.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDChoice.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDChoice.java
Sun Sep 11 10:04:16 2016
@@ -228,7 +228,7 @@ public abstract class PDChoice extends P
         {
             return COSArrayList.convertIntegerCOSArrayToList((COSArray) value);
         }
-        return Collections.<Integer>emptyList();
+        return Collections.emptyList();
     }
 
     /**

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Sun
Sep 11 10:04:16 2016
@@ -1089,7 +1089,7 @@ public class PageDrawer extends PDFGraph
         graphics.setStroke(stroke);
         graphics.setClip(null);
         COSArray pathsArray = (COSArray) base;
-        for (COSBase baseElement : (Iterable<? extends COSBase>) pathsArray.toList())
+        for (COSBase baseElement : pathsArray.toList())
         {
             if (!(baseElement instanceof COSArray))
             {

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/TrueTypeFontValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/TrueTypeFontValidator.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/TrueTypeFontValidator.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/TrueTypeFontValidator.java
Sun Sep 11 10:04:16 2016
@@ -73,7 +73,7 @@ public class TrueTypeFontValidator exten
              * For symbolic font, no encoding entry is allowed and only one encoding entry
is expected into the FontFile
              * CMap (Check latter when the FontFile stream will be checked)
              */
-            if (fd.isSymbolic() && ((COSDictionary) fontDictionary).getItem(COSName.ENCODING)
!= null)
+            if (fd.isSymbolic() && fontDictionary.getItem(COSName.ENCODING) != null)
             {
                 this.fontContainer.push(new ValidationError(ERROR_FONTS_ENCODING,
                         fd.getFontName() + ": The Encoding should be missing for the Symbolic
TTF"));

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type1FontValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type1FontValidator.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type1FontValidator.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type1FontValidator.java
Sun Sep 11 10:04:16 2016
@@ -43,7 +43,7 @@ public class Type1FontValidator extends
 {
     public Type1FontValidator(PreflightContext context, PDSimpleFont font)
     {
-        super(context, font, font.getCOSObject(), new Type1Container((PDSimpleFont)font));
+        super(context, font, font.getCOSObject(), new Type1Container(font));
     }
 
     @Override

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java
Sun Sep 11 10:04:16 2016
@@ -177,7 +177,7 @@ public class AcroFormValidationProcess e
         if (field instanceof PDTerminalField)
         {
             // The widget validation will be done by the widget annotation, a widget contained
in a Field can't have action. 
-            PDAnnotationWidget widget = ((PDTerminalField)field).getWidgets().get(0); //
fixme: fails to check multiple widgets
+            PDAnnotationWidget widget = field.getWidgets().get(0); // fixme: fails to check
multiple widgets
             if (res && widget != null)
             {
                 ContextHelper.validateElement(ctx, widget.getCOSObject(), ANNOTATIONS_PROCESS);
@@ -189,7 +189,7 @@ public class AcroFormValidationProcess e
                     return false;
                 }
             }
-            return exploreWidgets(ctx, ((PDTerminalField)field).getWidgets());
+            return exploreWidgets(ctx, field.getWidgets());
         }
         else
         {

Modified: pdfbox/branches/2.0/preflight/src/test/java/org/apache/pdfbox/preflight/TestIsartorBavaria.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/test/java/org/apache/pdfbox/preflight/TestIsartorBavaria.java?rev=1760235&r1=1760234&r2=1760235&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/test/java/org/apache/pdfbox/preflight/TestIsartorBavaria.java
(original)
+++ pdfbox/branches/2.0/preflight/src/test/java/org/apache/pdfbox/preflight/TestIsartorBavaria.java
Sun Sep 11 10:04:16 2016
@@ -86,7 +86,7 @@ public class TestIsartorBavaria
                     String error = new StringTokenizer(path, "//").nextToken().trim();
                     String[] errTab = error.split(",");
                     Set<String> errorSet = new HashSet<String>(Arrays.asList(errTab));
-                    data.add(new Object[] { (File) pdfFile, errorSet } );
+                    data.add(new Object[] { pdfFile, errorSet } );
                 }
             }
         }
@@ -113,7 +113,7 @@ public class TestIsartorBavaria
                             String error = new StringTokenizer(path, "//").nextToken().trim();
                             errorSet.addAll(Arrays.asList(error.split(",")));
                         }
-                        data.add(new Object[] { (File) pdfFile, errorSet } );
+                        data.add(new Object[] { pdfFile, errorSet } );
                     }
                 }
             }



Mime
View raw message