pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1803873 - /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/function/TestPDFunctionType4.java
Date Wed, 02 Aug 2017 17:02:28 GMT
Author: tilman
Date: Wed Aug  2 17:02:28 2017
New Revision: 1803873

URL: http://svn.apache.org/viewvc?rev=1803873&view=rev
Log:
PDFBOX-2852: use jdk7 syntax

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/function/TestPDFunctionType4.java

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/function/TestPDFunctionType4.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/function/TestPDFunctionType4.java?rev=1803873&r1=1803872&r2=1803873&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/function/TestPDFunctionType4.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/function/TestPDFunctionType4.java
Wed Aug  2 17:02:28 2017
@@ -40,10 +40,11 @@ public class TestPDFunctionType4 extends
         rangeArray.setFloatArray(range);
         stream.setItem("Range", rangeArray);
         
-        OutputStream out = stream.createOutputStream();
-        byte[] data = function.getBytes("US-ASCII");
-        out.write(data, 0, data.length);
-        out.close();
+        try (OutputStream out = stream.createOutputStream())
+        {
+            byte[] data = function.getBytes("US-ASCII");
+            out.write(data, 0, data.length);
+        }
 
         return new PDFunctionType4(stream);
     }



Mime
View raw message