pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1640287 - /pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/SynchronizedMetaDataValidation.java
Date Tue, 18 Nov 2014 09:12:13 GMT
Author: lehmi
Date: Tue Nov 18 09:12:13 2014
New Revision: 1640287

URL: http://svn.apache.org/r1640287
Log:
PDFBOX-2503: ignore trailing spaces when comparing DocumentFnformation entries with XMP based
metadata

Modified:
    pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/SynchronizedMetaDataValidation.java

Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/SynchronizedMetaDataValidation.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/SynchronizedMetaDataValidation.java?rev=1640287&r1=1640286&r2=1640287&view=diff
==============================================================================
--- pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/SynchronizedMetaDataValidation.java
(original)
+++ pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/SynchronizedMetaDataValidation.java
Tue Nov 18 09:12:13 2014
@@ -64,6 +64,8 @@ public class SynchronizedMetaDataValidat
         String title = dico.getTitle();
         if (title != null)
         {
+            // automatically trim the provided string value
+            title = title.trim();
             if (dc != null)
             {
                 // Check the x-default value, if not found, check with the first value
@@ -133,6 +135,8 @@ public class SynchronizedMetaDataValidat
         String author = dico.getAuthor();
         if (author != null)
         {
+            // automatically trim the provided string value
+            author = author.trim();
             if (dc != null)
             {
                 if (dc.getCreatorsProperty() != null)
@@ -184,6 +188,8 @@ public class SynchronizedMetaDataValidat
         String subject = dico.getSubject();
         if (subject != null)
         {
+            // automatically trim the provided string value
+            subject = subject.trim();
             if (dc != null)
             {
                 // PDF/A Conformance Erratum (2007) specifies XMP Subject
@@ -231,6 +237,8 @@ public class SynchronizedMetaDataValidat
         String keyword = dico.getKeywords();
         if (keyword != null)
         {
+            // automatically trim the provided string value
+            keyword = keyword.trim();
             if (pdf != null)
             {
                 if (pdf.getKeywordsProperty() == null)
@@ -267,6 +275,8 @@ public class SynchronizedMetaDataValidat
         String producer = dico.getProducer();
         if (producer != null)
         {
+            // automatically trim the provided string value
+            producer = producer.trim();
             if (pdf != null)
             {
                 if (pdf.getProducerProperty() == null)
@@ -305,6 +315,8 @@ public class SynchronizedMetaDataValidat
         String creatorTool = dico.getCreator();
         if (creatorTool != null)
         {
+            // automatically trim the provided string value
+            creatorTool = creatorTool.trim();
             if (xmp != null)
             {
                 if (xmp.getCreatorToolProperty() == null)



Mime
View raw message