pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1769195 - in /pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight: ./ font/ font/container/ process/reflect/
Date Thu, 10 Nov 2016 21:00:52 GMT
Author: tilman
Date: Thu Nov 10 21:00:52 2016
New Revision: 1769195

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

Modified:
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type0FontValidator.java
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type3FontValidator.java
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/Type0Container.java
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/FontValidationProcess.java

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java?rev=1769195&r1=1769194&r2=1769195&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightContext.java
Thu Nov 10 21:00:52 2016
@@ -41,7 +41,7 @@ public class PreflightContext implements
     /**
      * Contains the list of font name embedded in the PDF document.
      */
-    private final Map<COSBase, FontContainer> fontContainers = new HashMap<COSBase,
FontContainer>();
+    private final Map<COSBase, FontContainer<?>> fontContainers = new HashMap<COSBase,
FontContainer<?>>();
 
     /**
      * The PDFbox object representation of the PDF source.
@@ -162,7 +162,7 @@ public class PreflightContext implements
      * @param cBase the COSBase for the font container.
      * @param fc the font container.
      */
-    public void addFontContainer(COSBase cBase, FontContainer fc)
+    public void addFontContainer(COSBase cBase, FontContainer<?> fc)
     {
         this.fontContainers.put(cBase, fc);
     }
@@ -174,7 +174,7 @@ public class PreflightContext implements
      * @param cBase the COSBase for the font container
      * @return the font container.
      */
-    public FontContainer getFontContainer(COSBase cBase)
+    public FontContainer<?> getFontContainer(COSBase cBase)
     {
         return this.fontContainers.get(cBase);
     }

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type0FontValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type0FontValidator.java?rev=1769195&r1=1769194&r2=1769195&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type0FontValidator.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type0FontValidator.java
Thu Nov 10 21:00:52 2016
@@ -48,6 +48,7 @@ import org.apache.pdfbox.cos.COSDocument
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSStream;
 import org.apache.pdfbox.io.IOUtils;
+import org.apache.pdfbox.pdmodel.font.PDCIDFont;
 import org.apache.pdfbox.pdmodel.font.PDCIDFontType0;
 import org.apache.pdfbox.pdmodel.font.PDCIDFontType2;
 import org.apache.pdfbox.pdmodel.font.PDFont;
@@ -133,7 +134,7 @@ public class Type0FontValidator extends
             return;
         }
 
-        FontValidator<? extends FontContainer> cidFontValidator = createDescendantValidator(cidFont);
+        FontValidator<? extends FontContainer<? extends PDCIDFont>> cidFontValidator
= createDescendantValidator(cidFont);
         if (cidFontValidator != null)
         {
             this.fontContainer.setDelegateFontContainer(cidFontValidator.getFontContainer());
@@ -141,10 +142,10 @@ public class Type0FontValidator extends
         }
     }
 
-    protected FontValidator<? extends FontContainer> createDescendantValidator(COSDictionary
cidFont)
+    protected FontValidator<? extends FontContainer<? extends PDCIDFont>> createDescendantValidator(COSDictionary
cidFont)
     {
         String subtype = cidFont.getNameAsString(COSName.SUBTYPE);
-        FontValidator<? extends FontContainer> cidFontValidator = null;
+        FontValidator<? extends FontContainer<? extends PDCIDFont>> cidFontValidator
= null;
         if (FONT_DICTIONARY_VALUE_TYPE0.equals(subtype))
         {
             cidFontValidator = createCIDType0FontValidator(cidFont);
@@ -164,7 +165,7 @@ public class Type0FontValidator extends
     /**
      * Create the validation object for CIDType0 Font
      */
-    protected FontValidator<? extends FontContainer> createCIDType0FontValidator(COSDictionary
fDict)
+    protected FontValidator<? extends FontContainer<PDCIDFontType0>> createCIDType0FontValidator(COSDictionary
fDict)
     {
         try
         {
@@ -184,7 +185,7 @@ public class Type0FontValidator extends
      * @param fDict a CIDType2 font dictionary.
      * @return a CIDType2 tont font validator.
      */
-    protected FontValidator<? extends FontContainer> createCIDType2FontValidator(COSDictionary
fDict)
+    protected FontValidator<? extends FontContainer<PDCIDFontType2>> createCIDType2FontValidator(COSDictionary
fDict)
     {
         try
         {

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type3FontValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type3FontValidator.java?rev=1769195&r1=1769194&r2=1769195&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type3FontValidator.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/Type3FontValidator.java
Thu Nov 10 21:00:52 2016
@@ -444,7 +444,7 @@ public class Type3FontValidator extends
                     try
                     {
                         PDFont aFont = PDFontFactory.createFont(xObjFont);
-                        FontContainer aContainer = this.context.getFontContainer(aFont.getCOSObject());
+                        FontContainer<?> aContainer = this.context.getFontContainer(aFont.getCOSObject());
                         // another font is used in the Type3, check if the font is valid.
                         if (!aContainer.isValid())
                         {

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/Type0Container.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/Type0Container.java?rev=1769195&r1=1769194&r2=1769195&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/Type0Container.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/Type0Container.java
Thu Nov 10 21:00:52 2016
@@ -27,16 +27,16 @@ import java.util.List;
 import org.apache.pdfbox.pdmodel.font.PDFont;
 import org.apache.pdfbox.preflight.ValidationResult.ValidationError;
 
-public class Type0Container extends FontContainer
+public class Type0Container extends FontContainer<PDFont>
 {
-    private FontContainer delegateFontContainer;
+    private FontContainer<?> delegateFontContainer;
 
     public Type0Container(PDFont font)
     {
         super(font);
     }
 
-    public void setDelegateFontContainer(FontContainer delegateFontContainer)
+    public void setDelegateFontContainer(FontContainer<?> delegateFontContainer)
     {
         this.delegateFontContainer = delegateFontContainer;
     }

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/FontValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/FontValidationProcess.java?rev=1769195&r1=1769194&r2=1769195&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/FontValidationProcess.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/FontValidationProcess.java
Thu Nov 10 21:00:52 2016
@@ -68,11 +68,11 @@ public class FontValidationProcess exten
         else
         {
             PDFont font = (PDFont) vPath.peek();
-            FontContainer fontContainer = context.getFontContainer(font.getCOSObject());
+            FontContainer<?> fontContainer = context.getFontContainer(font.getCOSObject());
             if (fontContainer == null)
             {
                 // if fontContainer isn't null the font is already checked
-                FontValidator<? extends FontContainer> validator = getFontValidator(context,
font);
+                FontValidator<? extends FontContainer<? extends PDFont>> validator
= getFontValidator(context, font);
                 if (validator != null)
                 {
                     validator.validate();
@@ -88,7 +88,7 @@ public class FontValidationProcess exten
      * @param font the font object.
      * @return the font validator instance for the font type.
      */
-    protected FontValidator<? extends FontContainer> getFontValidator(PreflightContext
context, PDFont font)
+    protected FontValidator<? extends FontContainer<? extends PDFont>> getFontValidator(PreflightContext
context, PDFont font)
     {
         String subtype = font.getSubType();
         if (FONT_DICTIONARY_VALUE_TRUETYPE.equals(subtype))



Mime
View raw message