pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1768582 - in /pdfbox/trunk: pdfbox/src/main/java/org/apache/pdfbox/filter/ pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/ pdfbox/src/mai...
Date Mon, 07 Nov 2016 20:43:48 GMT
Author: tilman
Date: Mon Nov  7 20:43:47 2016
New Revision: 1768582

URL: http://svn.apache.org/viewvc?rev=1768582&view=rev
Log:
PDFBOX-2852: add missing type arguments, as suggested by Lorenz Pahl

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/LZWFilter.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3CharProc.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSeedValue.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/LZWFilter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/LZWFilter.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/LZWFilter.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/LZWFilter.java Mon Nov  7 20:43:47
2016
@@ -157,7 +157,7 @@ public class LZWFilter extends Filter
         decoded.flush();
     }
 
-    private void checkIndexBounds(List codeTable, long index, MemoryCacheImageInputStream
in)
+    private void checkIndexBounds(List<byte[]> codeTable, long index, MemoryCacheImageInputStream
in)
             throws IOException
     {
         if (index < 0)

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
Mon Nov  7 20:43:47 2016
@@ -102,7 +102,7 @@ public class ContentStreamWriter
      * @param tokens The tokens to write to the stream.
      * @throws IOException If there is an error writing to the stream.
      */
-    public void writeTokens( List tokens ) throws IOException
+    public void writeTokens( List<?> tokens ) throws IOException
     {
         for (Object token : tokens)
         {

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java Mon
Nov  7 20:43:47 2016
@@ -194,7 +194,7 @@ public class PDDocumentCatalog implement
      *
      * @param threads The list of threads, or null to clear it.
      */
-    public void setThreads(List threads)
+    public void setThreads(List<PDThread> threads)
     {
         root.setItem(COSName.THREADS, COSArrayList.converterToCOSArray(threads));
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java Mon Nov
 7 20:43:47 2016
@@ -284,7 +284,7 @@ public class FDFField implements COSObje
         COSBase cos = null;
         if (value instanceof List)
         {
-            cos = COSArrayList.convertStringListToCOSStringCOSArray((List) value);
+            cos = COSArrayList.convertStringListToCOSStringCOSArray((List<String>)
value);
         }
         else if (value instanceof String)
         {

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3CharProc.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3CharProc.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3CharProc.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3CharProc.java
Mon Nov  7 20:43:47 2016
@@ -1,195 +1,195 @@
-/*
- * 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.font;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.pdfbox.contentstream.PDContentStream;
-import org.apache.pdfbox.contentstream.operator.Operator;
-import org.apache.pdfbox.cos.COSBase;
-import org.apache.pdfbox.cos.COSNumber;
-import org.apache.pdfbox.cos.COSObject;
-import org.apache.pdfbox.cos.COSStream;
-import org.apache.pdfbox.pdfparser.PDFStreamParser;
-import org.apache.pdfbox.pdmodel.PDResources;
-import org.apache.pdfbox.pdmodel.common.COSObjectable;
-import org.apache.pdfbox.pdmodel.common.PDRectangle;
-import org.apache.pdfbox.pdmodel.common.PDStream;
-import org.apache.pdfbox.util.Matrix;
-
-/**
- * A Type 3 character procedure. This is a standalone PDF content stream.
- *
- * @author John Hewson
- */
-public final class PDType3CharProc implements COSObjectable, PDContentStream
-{
-    private final PDType3Font font;
-    private final COSStream charStream;
-
-    public PDType3CharProc(PDType3Font font, COSStream charStream)
-    {
-        this.font = font;
-        this.charStream = charStream;
-    }
-
-    @Override
-    public COSStream getCOSObject()
-    {
-        return charStream;
-    }
-
-    public PDType3Font getFont()
-    {
-        return font;
-    }
-    
-    public PDStream getContentStream()
-    {
-        return new PDStream(charStream);
-    }
-
-    @Override
-    public InputStream getContents() throws IOException
-    {
-        return charStream.createInputStream();
-    }
-
-    @Override
-    public PDResources getResources()
-    {
-        return font.getResources();
-    }
-
-    @Override
-    public PDRectangle getBBox()
-    {
-        return font.getFontBBox();
-    }
-
-    /**
-     * Calculate the bounding box of this glyph. This will work only if the first operator
in the
-     * stream is d1.
-     *
-     * @return the bounding box of this glyph, or null if the first operator is not d1.
-     * @throws IOException If an io error occurs while parsing the stream.
-     */
-    public PDRectangle getGlyphBBox() throws IOException
-    {
-        List<COSBase> arguments = new ArrayList<COSBase>();
-        PDFStreamParser parser = new PDFStreamParser(this);
-        Object token = parser.parseNextToken();
-        while (token != null)
-        {
-            if (token instanceof COSObject)
-            {
-                arguments.add(((COSObject) token).getObject());
-            }
-            else if (token instanceof Operator)
-            {
-                if (((Operator) token).getName().equals("d1") && arguments.size()
== 6)
-                {
-                    for (int i = 0; i < 6; ++i)
-                    {
-                        if (!(arguments.get(i) instanceof COSNumber))
-                        {
-                            return null;
-                        }
-                    }
-                    return new PDRectangle(
-                            ((COSNumber) arguments.get(2)).floatValue(),
-                            ((COSNumber) arguments.get(3)).floatValue(),
-                            ((COSNumber) arguments.get(4)).floatValue() - ((COSNumber) arguments.get(2)).floatValue(),
-                            ((COSNumber) arguments.get(5)).floatValue() - ((COSNumber) arguments.get(3)).floatValue());
-                }
-                else
-                {
-                    return null;
-                }
-            }
-            else
-            {
-                arguments.add((COSBase) token);
-            }
-            token = parser.parseNextToken();
-        }
-        return null;
-    }
-
-    @Override
-    public Matrix getMatrix()
-    {
-        return font.getFontMatrix();
-    }
-
-    /**
-     * todo.
-     * 
-     * @return
-     * @throws IOException
-     */
-    public float getWidth() throws IOException
-    {
-        List<COSBase> arguments = new ArrayList<COSBase>();
-        PDFStreamParser parser = new PDFStreamParser(this);
-        Object token = parser.parseNextToken();
-        while (token != null)
-        {
-            if (token instanceof COSObject)
-            {
-                arguments.add(((COSObject) token).getObject());
-            }
-            else if (token instanceof Operator)
-            {
-                return parseWidth((Operator) token, arguments);
-            }
-            else
-            {
-                arguments.add((COSBase) token);
-            }
-            token = parser.parseNextToken();
-        }
-        throw new IOException("Unexpected end of stream");
-    }
-
-    private float parseWidth(Operator operator, List arguments) throws IOException
-    {
-        if (operator.getName().equals("d0") || operator.getName().equals("d1"))
-        {
-            Object obj = arguments.get(0);
-            if (obj instanceof Number)
-            {
-                return ((Number) obj).floatValue();
-            }
-            else if (obj instanceof COSNumber)
-            {
-                return ((COSNumber) obj).floatValue();
-            }
-            else
-            {
-                throw new IOException("Unexpected argument type: " + obj.getClass().getName());
-            }
-        }
-        else
-        {
-            throw new IOException("First operator must be d0 or d1");
-        }
-    }
-}
+/*
+ * 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.font;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.pdfbox.contentstream.PDContentStream;
+import org.apache.pdfbox.contentstream.operator.Operator;
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSNumber;
+import org.apache.pdfbox.cos.COSObject;
+import org.apache.pdfbox.cos.COSStream;
+import org.apache.pdfbox.pdfparser.PDFStreamParser;
+import org.apache.pdfbox.pdmodel.PDResources;
+import org.apache.pdfbox.pdmodel.common.COSObjectable;
+import org.apache.pdfbox.pdmodel.common.PDRectangle;
+import org.apache.pdfbox.pdmodel.common.PDStream;
+import org.apache.pdfbox.util.Matrix;
+
+/**
+ * A Type 3 character procedure. This is a standalone PDF content stream.
+ *
+ * @author John Hewson
+ */
+public final class PDType3CharProc implements COSObjectable, PDContentStream
+{
+    private final PDType3Font font;
+    private final COSStream charStream;
+
+    public PDType3CharProc(PDType3Font font, COSStream charStream)
+    {
+        this.font = font;
+        this.charStream = charStream;
+    }
+
+    @Override
+    public COSStream getCOSObject()
+    {
+        return charStream;
+    }
+
+    public PDType3Font getFont()
+    {
+        return font;
+    }
+    
+    public PDStream getContentStream()
+    {
+        return new PDStream(charStream);
+    }
+
+    @Override
+    public InputStream getContents() throws IOException
+    {
+        return charStream.createInputStream();
+    }
+
+    @Override
+    public PDResources getResources()
+    {
+        return font.getResources();
+    }
+
+    @Override
+    public PDRectangle getBBox()
+    {
+        return font.getFontBBox();
+    }
+
+    /**
+     * Calculate the bounding box of this glyph. This will work only if the first operator
in the
+     * stream is d1.
+     *
+     * @return the bounding box of this glyph, or null if the first operator is not d1.
+     * @throws IOException If an io error occurs while parsing the stream.
+     */
+    public PDRectangle getGlyphBBox() throws IOException
+    {
+        List<COSBase> arguments = new ArrayList<COSBase>();
+        PDFStreamParser parser = new PDFStreamParser(this);
+        Object token = parser.parseNextToken();
+        while (token != null)
+        {
+            if (token instanceof COSObject)
+            {
+                arguments.add(((COSObject) token).getObject());
+            }
+            else if (token instanceof Operator)
+            {
+                if (((Operator) token).getName().equals("d1") && arguments.size()
== 6)
+                {
+                    for (int i = 0; i < 6; ++i)
+                    {
+                        if (!(arguments.get(i) instanceof COSNumber))
+                        {
+                            return null;
+                        }
+                    }
+                    return new PDRectangle(
+                            ((COSNumber) arguments.get(2)).floatValue(),
+                            ((COSNumber) arguments.get(3)).floatValue(),
+                            ((COSNumber) arguments.get(4)).floatValue() - ((COSNumber) arguments.get(2)).floatValue(),
+                            ((COSNumber) arguments.get(5)).floatValue() - ((COSNumber) arguments.get(3)).floatValue());
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            else
+            {
+                arguments.add((COSBase) token);
+            }
+            token = parser.parseNextToken();
+        }
+        return null;
+    }
+
+    @Override
+    public Matrix getMatrix()
+    {
+        return font.getFontMatrix();
+    }
+
+    /**
+     * todo.
+     * 
+     * @return
+     * @throws IOException
+     */
+    public float getWidth() throws IOException
+    {
+        List<COSBase> arguments = new ArrayList<COSBase>();
+        PDFStreamParser parser = new PDFStreamParser(this);
+        Object token = parser.parseNextToken();
+        while (token != null)
+        {
+            if (token instanceof COSObject)
+            {
+                arguments.add(((COSObject) token).getObject());
+            }
+            else if (token instanceof Operator)
+            {
+                return parseWidth((Operator) token, arguments);
+            }
+            else
+            {
+                arguments.add((COSBase) token);
+            }
+            token = parser.parseNextToken();
+        }
+        throw new IOException("Unexpected end of stream");
+    }
+
+    private float parseWidth(Operator operator, List<COSBase> arguments) throws IOException
+    {
+        if (operator.getName().equals("d0") || operator.getName().equals("d1"))
+        {
+            Object obj = arguments.get(0);
+            if (obj instanceof Number)
+            {
+                return ((Number) obj).floatValue();
+            }
+            else if (obj instanceof COSNumber)
+            {
+                return ((COSNumber) obj).floatValue();
+            }
+            else
+            {
+                throw new IOException("Unexpected argument type: " + obj.getClass().getName());
+            }
+        }
+        else
+        {
+            throw new IOException("First operator must be d0 or d1");
+        }
+    }
+}

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java
Mon Nov  7 20:43:47 2016
@@ -370,10 +370,10 @@ public final class PDICCBased extends PD
 
     /**
      * Sets the list of alternateColorSpace color spaces.
-     * This should be a list of PDColorSpace objects.
+     *
      * @param list the list of color space objects
      */
-    public void setAlternateColorSpaces(List list)
+    public void setAlternateColorSpaces(List<PDColorSpace> list)
     {
         COSArray altArray = null;
         if(list != null)

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSeedValue.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSeedValue.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSeedValue.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSeedValue.java
Mon Nov  7 20:43:47 2016
@@ -284,7 +284,7 @@ public class PDSeedValue implements COSO
                     actuals.add(element);
                 }
             }
-            retval = new COSArrayList(actuals, fields);
+            retval = new COSArrayList<String>(actuals, fields);
         }
         return retval;
     }
@@ -324,7 +324,7 @@ public class PDSeedValue implements COSO
                     actuals.add(element);
                 }
             }
-            retval = new COSArrayList(actuals, fields);
+            retval = new COSArrayList<String>(actuals, fields);
         }
         return retval;
     }
@@ -413,7 +413,7 @@ public class PDSeedValue implements COSO
                     actuals.add(element);
                 }
             }
-            retval = new COSArrayList(actuals, fields);
+            retval = new COSArrayList<String>(actuals, fields);
         }
         return retval;
     }
@@ -530,7 +530,7 @@ public class PDSeedValue implements COSO
                     actuals.add(element);
                 }
             }
-            retval = new COSArrayList(actuals, fields);
+            retval = new COSArrayList<String>(actuals, fields);
         }
         return retval;
     }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java
Mon Nov  7 20:43:47 2016
@@ -299,7 +299,7 @@ public class PreflightContentStream exte
             return;
         }
 
-        FontContainer fontContainer = context.getFontContainer(font.getCOSObject());
+        FontContainer<?> fontContainer = context.getFontContainer(font.getCOSObject());
         if (renderingMode == RenderingMode.NEITHER && (fontContainer == null || !fontContainer.isEmbeddedFont()))
         {
             // font not embedded and rendering mode is 3. Valid case and nothing to check

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java?rev=1768582&r1=1768581&r2=1768582&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
Mon Nov  7 20:43:47 2016
@@ -222,7 +222,7 @@ public abstract class PreflightStreamEng
      * @throws ContentStreamException
      *             ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY if the operand is invalid
      */
-    protected void validateRenderingIntent(Operator operator, List arguments) throws ContentStreamException
+    protected void validateRenderingIntent(Operator operator, List<?> arguments) throws
ContentStreamException
     {
         if ("ri".equals(operator.getName()))
         {



Mime
View raw message