pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1867856 - in /pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples: pdmodel/AddAnnotations.java signature/cert/CertificateVerifier.java util/PDFMergerExample.java
Date Tue, 01 Oct 2019 18:11:46 GMT
Author: tilman
Date: Tue Oct  1 18:11:46 2019
New Revision: 1867856

URL: http://svn.apache.org/viewvc?rev=1867856&view=rev
Log:
PDFBOX-4071: use jdk8 lambda expressions

Modified:
    pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
    pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java
    pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/util/PDFMergerExample.java

Modified: pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java?rev=1867856&r1=1867855&r2=1867856&view=diff
==============================================================================
--- pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
(original)
+++ pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddAnnotations.java
Tue Oct  1 18:11:46 2019
@@ -310,10 +310,7 @@ public final class AddAnnotations
             // Create the appearance streams.
             // Adobe Reader will always display annotations without appearance streams nicely,
             // but other applications may not.
-            for (PDAnnotation ann : annotations)
-            {
-                ann.constructAppearances();
-            }
+            annotations.forEach(PDAnnotation::constructAppearances);
 
             showPageNo(document, page1, "Page 1");
             showPageNo(document, page2, "Page 2");

Modified: pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java?rev=1867856&r1=1867855&r2=1867856&view=diff
==============================================================================
--- pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java
(original)
+++ pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CertificateVerifier.java
Tue Oct  1 18:11:46 2019
@@ -300,10 +300,7 @@ public final class CertificateVerifier
                 in = new URL(urlString).openStream();
                 CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
                 Collection<? extends Certificate> altCerts = certFactory.generateCertificates(in);
-                for (Certificate altCert : altCerts)
-                {
-                    resultSet.add((X509Certificate) altCert);
-                }
+                altCerts.forEach(altCert -> resultSet.add((X509Certificate) altCert));
                 LOG.info("CA issuers URL: " + altCerts.size() + " certificate(s) downloaded");
             }
             catch (IOException | CertificateException ex)

Modified: pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/util/PDFMergerExample.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/util/PDFMergerExample.java?rev=1867856&r1=1867855&r2=1867856&view=diff
==============================================================================
--- pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/util/PDFMergerExample.java
(original)
+++ pdfbox/branches/issue4569/examples/src/main/java/org/apache/pdfbox/examples/util/PDFMergerExample.java
Tue Oct  1 18:11:46 2019
@@ -97,10 +97,7 @@ public class PDFMergerExample
         }
         finally
         {
-            for (InputStream source : sources)
-            {
-                IOUtils.closeQuietly(source);
-            }
+            sources.forEach(IOUtils::closeQuietly);
             IOUtils.closeQuietly(cosStream);
             IOUtils.closeQuietly(mergedPDFOutputStream);
         }



Mime
View raw message