pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1642357 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ResourcesValidationProcess.java
Date Fri, 28 Nov 2014 20:02:39 GMT
Author: tilman
Date: Fri Nov 28 20:02:39 2014
New Revision: 1642357

URL: http://svn.apache.org/r1642357
Log:
PDFBOX-2529: pass the page number in the ValidationException

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ResourcesValidationProcess.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ResourcesValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ResourcesValidationProcess.java?rev=1642357&r1=1642356&r2=1642357&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ResourcesValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ResourcesValidationProcess.java
Fri Nov 28 20:02:39 2014
@@ -58,11 +58,12 @@ import org.apache.pdfbox.preflight.utils
 public class ResourcesValidationProcess extends AbstractProcess
 {
 
+    @Override
     public void validate(PreflightContext ctx) throws ValidationException
     {
         PreflightPath vPath = ctx.getValidationPath();
-        if (vPath.isEmpty()) {
-            return;
+        if (vPath.isEmpty())
+        {
         }
         else if (!vPath.isExpectedType(PDResources.class))
         {
@@ -70,9 +71,8 @@ public class ResourcesValidationProcess 
         } 
         else
         {
-
             PDResources resources = (PDResources) vPath.peek();
-
+            
             validateFonts(ctx, resources);
             validateExtGStates(ctx, resources);
             validateShadingPattern(ctx, resources);
@@ -237,7 +237,7 @@ public class ResourcesValidationProcess 
         }
         catch (IOException e)
         {
-            context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_PATTERN_DEFINITION,
e.getMessage()));
+            context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_PATTERN_DEFINITION,
e.getMessage(), e));
         }
     }
 
@@ -263,7 +263,7 @@ public class ResourcesValidationProcess 
         }
         catch (IOException e)
         {
-            context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_PATTERN_DEFINITION,
e.getMessage()));
+            context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_PATTERN_DEFINITION,
e.getMessage(), e));
         }
     }
 
@@ -294,7 +294,7 @@ public class ResourcesValidationProcess 
                     }
                     catch (IOException e)
                     {
-                        throw new ValidationException(e.getMessage(), e);
+                        throw new ValidationException(e.getMessage(), e, context.getCurrentPageNumber());
                     }
                 }
             }



Mime
View raw message