pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1791994 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java
Date Wed, 19 Apr 2017 21:52:29 GMT
Author: tilman
Date: Wed Apr 19 21:52:29 2017
New Revision: 1791994

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

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java?rev=1791994&r1=1791993&r2=1791994&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java
Wed Apr 19 21:52:29 2017
@@ -80,8 +80,7 @@ class Type5ShadingContext extends Gourau
         long maxSrcColor = (long) Math.pow(2, bitsPerColorComponent) - 1;
         COSStream cosStream = (COSStream) cosDictionary;
 
-        ImageInputStream mciis = new MemoryCacheImageInputStream(cosStream.createInputStream());
-        try
+        try (ImageInputStream mciis = new MemoryCacheImageInputStream(cosStream.createInputStream()))
         {
             boolean eof = false;
             while (!eof)
@@ -98,10 +97,6 @@ class Type5ShadingContext extends Gourau
                 }
             }
         }
-        finally
-        {
-            mciis.close();
-        }
         int sz = vlist.size(), rowNum = sz / numPerRow;
         Vertex[][] latticeArray = new Vertex[rowNum][numPerRow];
         List<ShadedTriangle> list = new ArrayList<>();



Mime
View raw message