pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1763808 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
Date Fri, 07 Oct 2016 18:25:08 GMT
Author: tilman
Date: Fri Oct  7 18:25:07 2016
New Revision: 1763808

URL: http://svn.apache.org/viewvc?rev=1763808&view=rev
Log:
PDFBOX-3375: another attempt to solve concurrency issues with PDDeviceRGB, as suggested by
Cornelis Hoeflake

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1763808&r1=1763807&r2=1763808&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Fri
Oct  7 18:25:07 2016
@@ -53,6 +53,7 @@ import org.apache.pdfbox.pdmodel.encrypt
 import org.apache.pdfbox.pdmodel.encryption.SecurityHandler;
 import org.apache.pdfbox.pdmodel.encryption.SecurityHandlerFactory;
 import org.apache.pdfbox.pdmodel.font.PDFont;
+import org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary;
 import org.apache.pdfbox.pdmodel.interactive.digitalsignature.ExternalSigningSupport;
@@ -73,6 +74,14 @@ import org.apache.pdfbox.pdmodel.interac
 public class PDDocument implements Closeable
 {
     private static final Log LOG = LogFactory.getLog(PDDocument.class);
+    
+    /**
+     * avoid concurrency issues with PDDeviceRGB
+     */
+    static
+    {
+    	PDDeviceRGB.INSTANCE.toRGB(new float[]{1,1,1,1});
+    }
 
     private final COSDocument document;
 



Mime
View raw message