pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1843824 - /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java
Date Sun, 14 Oct 2018 10:19:32 GMT
Author: tilman
Date: Sun Oct 14 10:19:32 2018
New Revision: 1843824

URL: http://svn.apache.org/viewvc?rev=1843824&view=rev
Log:
PDFBOX-3017: improve formatting, remove cast

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java?rev=1843824&r1=1843823&r2=1843824&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/cert/CRLVerifier.java
Sun Oct 14 10:19:32 2018
@@ -138,19 +138,17 @@ public final class CRLVerifier
             NamingException, CRLException,
             CertificateVerificationException
     {
-        Map<String, String> env = new Hashtable<String, String>();
-        env.put(Context.INITIAL_CONTEXT_FACTORY,
-                "com.sun.jndi.ldap.LdapCtxFactory");
+        Hashtable<String, String> env = new Hashtable<String, String>();
+        env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
         env.put(Context.PROVIDER_URL, ldapURL);
 
-        DirContext ctx = new InitialDirContext((Hashtable) env);
+        DirContext ctx = new InitialDirContext(env);
         Attributes avals = ctx.getAttributes("");
         Attribute aval = avals.get("certificateRevocationList;binary");
         byte[] val = (byte[]) aval.get();
-        if ((val == null) || (val.length == 0))
+        if (val == null || val.length == 0)
         {
-            throw new CertificateVerificationException(
-                    "Can not download CRL from: " + ldapURL);
+            throw new CertificateVerificationException("Can not download CRL from: " + ldapURL);
         }
         else
         {



Mime
View raw message