pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1642244 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/
Date Thu, 27 Nov 2014 22:24:43 GMT
Author: tilman
Date: Thu Nov 27 22:24:42 2014
New Revision: 1642244

URL: http://svn.apache.org/r1642244
Log:
PDFBOX-1675: improve error messages; code cleanup

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/CatalogValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/EmptyValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/FileSpecificationValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/PageTreeValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/StreamValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/XRefValidationProcess.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java?rev=1642244&r1=1642243&r2=1642244&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/AcroFormValidationProcess.java
Thu Nov 27 22:24:42 2014
@@ -105,7 +105,7 @@ public class AcroFormValidationProcess e
     {
         if (lFields != null)
         {
-            // the list can be null if the Field doesn't have children
+            // the list can be null if the field doesn't have children
             for (Object obj : lFields)
             {
                 if (obj instanceof PDFieldTreeNode)
@@ -117,7 +117,7 @@ public class AcroFormValidationProcess e
                 }
                 else if (obj instanceof PDAnnotationWidget)
                 {
-                    // "A field?s children in the hierarchy may also include widget annotations"
+                    // "A field's children in the hierarchy may also include widget annotations"
                     ContextHelper.validateElement(ctx, ((PDAnnotationWidget) obj).getDictionary(),
ANNOTATIONS_PROCESS);
                 }
                 else

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/CatalogValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/CatalogValidationProcess.java?rev=1642244&r1=1642243&r2=1642244&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/CatalogValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/CatalogValidationProcess.java
Thu Nov 27 22:24:42 2014
@@ -455,11 +455,11 @@ public class CatalogValidationProcess ex
         {
             // this is not a ICC_Profile
             addValidationError(ctx, new ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_INVALID,
-                    "DestOutputProfile isn't a valid ICCProfile. Caused by : " + e.getMessage()));
+                    "DestOutputProfile isn't a valid ICCProfile: " + e.getMessage(), e));
         }
         catch (IOException e)
         {
             throw new ValidationException("Unable to parse the ICC Profile.", e);
         }
-            }
+    }
 }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/EmptyValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/EmptyValidationProcess.java?rev=1642244&r1=1642243&r2=1642244&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/EmptyValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/EmptyValidationProcess.java
Thu Nov 27 22:24:42 2014
@@ -32,6 +32,7 @@ import org.apache.pdfbox.preflight.excep
 public class EmptyValidationProcess implements ValidationProcess
 {
 
+    @Override
     public void validate(PreflightContext context) throws ValidationException
     {
         // this class does nothing

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/FileSpecificationValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/FileSpecificationValidationProcess.java?rev=1642244&r1=1642243&r2=1642244&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/FileSpecificationValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/FileSpecificationValidationProcess.java
Thu Nov 27 22:24:42 2014
@@ -45,6 +45,7 @@ import org.apache.pdfbox.preflight.excep
 public class FileSpecificationValidationProcess extends AbstractProcess
 {
 
+    @Override
     public void validate(PreflightContext ctx) throws ValidationException
     {
         PDDocument pdfDoc = ctx.getDocument();

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/PageTreeValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/PageTreeValidationProcess.java?rev=1642244&r1=1642243&r2=1642244&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/PageTreeValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/PageTreeValidationProcess.java
Thu Nov 27 22:24:42 2014
@@ -34,6 +34,7 @@ import org.apache.pdfbox.preflight.utils
 public class PageTreeValidationProcess extends AbstractProcess
 {
 
+    @Override
     public void validate(PreflightContext context) throws ValidationException
     {
         PDDocumentCatalog catalog = context.getDocument().getDocumentCatalog();

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/StreamValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/StreamValidationProcess.java?rev=1642244&r1=1642243&r2=1642244&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/StreamValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/StreamValidationProcess.java
Thu Nov 27 22:24:42 2014
@@ -324,7 +324,7 @@ public class StreamValidationProcess ext
         }
         catch (IOException e)
         {
-            throw new ValidationException("Unable to read a stream to validate it due to
: " + e.getMessage(), e);
+            throw new ValidationException("Unable to read a stream to validate: " + e.getMessage(),
e);
         }
         finally
         {

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java?rev=1642244&r1=1642243&r2=1642244&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java
Thu Nov 27 22:24:42 2014
@@ -168,7 +168,7 @@ public class TrailerValidationProcess ex
         catch (IOException e)
         {
             addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_SYNTAX_TRAILER,
-                    "Unable to check PDF Trailers due to : " + e.getMessage()));
+                    "Unable to check PDF Trailers: " + e.getMessage(), e));
         }
     }
 
@@ -439,8 +439,6 @@ public class TrailerValidationProcess ex
             addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_SYNTAX_DICT_INVALID,
                     "Invalid key in The Linearized dictionary"));
         }
-
-        return;
     }
 
 }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/XRefValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/XRefValidationProcess.java?rev=1642244&r1=1642243&r2=1642244&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/XRefValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/XRefValidationProcess.java
Thu Nov 27 22:24:42 2014
@@ -32,6 +32,7 @@ import org.apache.pdfbox.preflight.excep
 public class XRefValidationProcess extends AbstractProcess
 {
 
+    @Override
     public void validate(PreflightContext ctx) throws ValidationException
     {
         COSDocument document = ctx.getDocument().getDocument();



Mime
View raw message