directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject directory-kerby git commit: Removing some redundant type declarations
Date Mon, 22 Oct 2018 11:32:50 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk a34048aec -> 6be771530


Removing some redundant type declarations


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/6be77153
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/6be77153
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/6be77153

Branch: refs/heads/trunk
Commit: 6be77153064dbc7f9a3309a0dc1b60a9dca88a2e
Parents: a34048a
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Oct 22 12:27:12 2018 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Oct 22 12:27:12 2018 +0100

----------------------------------------------------------------------
 .../org/apache/kerby/has/common/spnego/KerberosUtil.java     | 4 ++--
 .../kerby/has/common/ssl/ReloadingX509TrustManager.java      | 2 +-
 .../org/apache/kerby/has/common/ssl/SSLHostnameVerifier.java | 6 +++---
 .../java/org/apache/kerby/has/server/kdc/HasKdcHandler.java  | 4 ++--
 .../src/main/java/org/apache/kerby/MavibotBackend.java       | 2 +-
 .../kerby/kerberos/kdc/identitybackend/IdentityZNode.java    | 2 +-
 .../src/main/java/org/apache/kerby/asn1/type/Asn1String.java | 2 +-
 .../src/main/java/org/apache/kerby/config/Conf.java          | 2 +-
 .../src/main/java/org/apache/kerby/config/ConfigImpl.java    | 4 ++--
 .../src/main/java/org/apache/kerby/config/ConfigObject.java  | 6 +++---
 .../main/java/org/apache/kerby/config/XmlConfigLoader.java   | 2 +-
 .../kerby-util/src/main/java/org/apache/kerby/util/Util.java | 2 +-
 .../src/main/java/org/apache/kerby/xdr/type/XdrString.java   | 2 +-
 .../java/org/apache/kerby/kerberos/kdc/TokenKdcTestBase.java | 2 +-
 .../kerberos/kerb/integration/test/TokenLoginTestBase.java   | 2 +-
 .../java/org/apache/kerby/kerberos/kerb/admin/AuthUtil.java  | 4 ++--
 .../kerby/kerberos/kerb/client/jaas/TokenJaasKrbUtil.java    | 2 +-
 .../kerby/kerberos/kerb/client/preauth/PreauthContext.java   | 4 ++--
 .../kerby/kerberos/kerb/client/preauth/PreauthHandler.java   | 2 +-
 .../kerby/kerberos/kerb/client/preauth/UserResponser.java    | 2 +-
 .../kerby/kerberos/kerb/client/request/KdcRequest.java       | 2 +-
 .../apache/kerby/kerberos/kerb/common/EncryptionUtil.java    | 2 +-
 .../org/apache/kerby/kerberos/kerb/common/KrbErrorUtil.java  | 4 ++--
 .../kerby/kerberos/kerb/preauth/pkinit/IdentityOpts.java     | 8 ++++----
 .../kerby/kerberos/kerb/transport/KdcUdpTransport.java       | 2 +-
 .../org/apache/kerby/kerberos/kerb/type/KrbIntegers.java     | 2 +-
 .../apache/kerby/kerberos/kerb/type/KrbSequenceOfType.java   | 2 +-
 .../java/org/apache/kerby/kerberos/kerb/type/ad/ADAndOr.java | 2 +-
 .../kerby/kerberos/kerb/type/ad/ADEnctypeNegotiation.java    | 2 +-
 .../org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java  | 4 ++--
 .../apache/kerby/kerberos/kerb/crypto/CamelliaEncTest.java   | 4 ++--
 .../kerby/kerberos/kerb/server/preauth/PreauthContext.java   | 2 +-
 .../kerby/kerberos/kerb/server/preauth/PreauthHandler.java   | 2 +-
 .../kerberos/kerb/server/replay/SimpleCacheService.java      | 2 +-
 .../org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java   | 6 +++---
 .../kerby/kerberos/kerb/ccache/CredCacheInputStream.java     | 2 +-
 .../apache/kerby/kerberos/kerb/ccache/CredentialCache.java   | 4 ++--
 .../java/org/apache/kerby/kerberos/kerb/keytab/Keytab.java   | 6 +++---
 .../apache/kerby/kerberos/kerb/keytab/KeytabInputStream.java | 2 +-
 .../org/apache/kerby/kerberos/provider/token/TokenTest.java  | 4 ++--
 .../java/org/apache/kerby/kerberos/tool/token/TokenInit.java | 2 +-
 .../kerby/kerberos/tool/hclient/HasClientLoginTool.java      | 4 ++--
 .../java/org/apache/kerby/kerberos/tool/kadmin/AuthUtil.java | 4 ++--
 43 files changed, 66 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/has-project/has-common/src/main/java/org/apache/kerby/has/common/spnego/KerberosUtil.java
----------------------------------------------------------------------
diff --git a/has-project/has-common/src/main/java/org/apache/kerby/has/common/spnego/KerberosUtil.java b/has-project/has-common/src/main/java/org/apache/kerby/has/common/spnego/KerberosUtil.java
index 14e30dd..f2cafd6 100644
--- a/has-project/has-common/src/main/java/org/apache/kerby/has/common/spnego/KerberosUtil.java
+++ b/has-project/has-common/src/main/java/org/apache/kerby/has/common/spnego/KerberosUtil.java
@@ -205,7 +205,7 @@ public class KerberosUtil {
    */
   static final String[] getPrincipalNames(String keytabFileName) throws IOException {
     Keytab keytab = Keytab.loadKeytab(new File(keytabFileName));
-    Set<String> principals = new HashSet<String>();
+    Set<String> principals = new HashSet<>();
     List<PrincipalName> entries = keytab.getPrincipals();
     for (PrincipalName entry : entries) {
       principals.add(entry.getName().replace("\\", "/"));
@@ -225,7 +225,7 @@ public class KerberosUtil {
                                                  Pattern pattern) throws IOException {
     String[] principals = getPrincipalNames(keytab);
     if (principals.length != 0) {
-      List<String> matchingPrincipals = new ArrayList<String>();
+      List<String> matchingPrincipals = new ArrayList<>();
       for (String principal : principals) {
         if (pattern.matcher(principal).matches()) {
           matchingPrincipals.add(principal);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/ReloadingX509TrustManager.java
----------------------------------------------------------------------
diff --git a/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/ReloadingX509TrustManager.java b/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/ReloadingX509TrustManager.java
index 29ed038..37b8160 100644
--- a/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/ReloadingX509TrustManager.java
+++ b/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/ReloadingX509TrustManager.java
@@ -81,7 +81,7 @@ public final class ReloadingX509TrustManager
     this.type = type;
     file = new File(location);
     this.password = password;
-    trustManagerRef = new AtomicReference<X509TrustManager>();
+    trustManagerRef = new AtomicReference<>();
     trustManagerRef.set(loadTrustManager());
     this.reloadInterval = reloadInterval;
   }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/SSLHostnameVerifier.java
----------------------------------------------------------------------
diff --git a/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/SSLHostnameVerifier.java b/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/SSLHostnameVerifier.java
index c2ffe3e..c5a0f40 100644
--- a/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/SSLHostnameVerifier.java
+++ b/has-project/has-common/src/main/java/org/apache/kerby/has/common/ssl/SSLHostnameVerifier.java
@@ -393,7 +393,7 @@ public interface SSLHostnameVerifier extends javax.net.ssl.HostnameVerifier {
             // STRICT implementations of the HostnameVerifier only use the
             // first CN provided.  All other CNs are ignored.
             // (Firefox, wget, curl, Sun Java 1.4, 5, 6 all work this way).
-            final Set<String> names = new TreeSet<String>();
+            final Set<String> names = new TreeSet<>();
             if (cns != null && cns.length > 0 && cns[0] != null) {
                 names.add(cns[0]);
                 if (ie6) {
@@ -525,7 +525,7 @@ public interface SSLHostnameVerifier extends javax.net.ssl.HostnameVerifier {
 
     class Certificates {
       public static String[] getCNs(X509Certificate cert) {
-        final List<String> cnList = new LinkedList<String>();
+        final List<String> cnList = new LinkedList<>();
         /*
           Sebastian Hauer's original StrictSSLProtocolSocketFactory used
           getName() and had the following comment:
@@ -582,7 +582,7 @@ public interface SSLHostnameVerifier extends javax.net.ssl.HostnameVerifier {
        * @return Array of SubjectALT DNS names stored in the certificate.
        */
       public static String[] getDNSSubjectAlts(X509Certificate cert) {
-          final List<String> subjectAltList = new LinkedList<String>();
+          final List<String> subjectAltList = new LinkedList<>();
           Collection<List<?>> c = null;
           try {
               c = cert.getSubjectAlternativeNames();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/has-project/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
----------------------------------------------------------------------
diff --git a/has-project/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java b/has-project/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
index ce60739..6d5353d 100644
--- a/has-project/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
+++ b/has-project/has-server/src/main/java/org/apache/kerby/has/server/kdc/HasKdcHandler.java
@@ -119,7 +119,7 @@ public class HasKdcHandler {
     public KrbMessage handleMessage(AuthToken authToken, String passPhrase) throws KrbException {
 
         // set the audiences
-        List<String> auds = new ArrayList<String>();
+        List<String> auds = new ArrayList<>();
         String audience = getAudience("krbtgt");
         auds.add(audience);
         authToken.setAudiences(auds);
@@ -296,7 +296,7 @@ public class HasKdcHandler {
     }
 
     public HostAddresses getHostAddresses() {
-        List<HostAddress> hostAddresses = new ArrayList<HostAddress>();
+        List<HostAddress> hostAddresses = new ArrayList<>();
         HostAddresses addresses = null;
         //empty
         if (!hostAddresses.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/MavibotBackend.java
----------------------------------------------------------------------
diff --git a/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/MavibotBackend.java b/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/MavibotBackend.java
index 9711a54..996b55c 100644
--- a/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/MavibotBackend.java
+++ b/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/MavibotBackend.java
@@ -101,7 +101,7 @@ public class MavibotBackend extends AbstractIdentityBackend {
      */
     @Override
     protected Iterable<String> doGetIdentities() throws KrbException {
-        List<String> keys = new ArrayList<String>();
+        List<String> keys = new ArrayList<>();
         KeyCursor<String> cursor = null;
 
         try {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNode.java
----------------------------------------------------------------------
diff --git a/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNode.java b/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNode.java
index 883d9f8..e51b7da 100644
--- a/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNode.java
+++ b/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNode.java
@@ -308,7 +308,7 @@ public class IdentityZNode {
             throw new IllegalArgumentException("The znode " + znode + " is not found");
         }
         List<String> typeNames = ZKUtil.listChildrenNoWatch(this.zk, znode);
-        List<EncryptionKey> keys = new ArrayList<EncryptionKey>(typeNames.size());
+        List<EncryptionKey> keys = new ArrayList<>(typeNames.size());
         for (String typeName : typeNames) {
             byte[] key = getEncryptionKey(typeName);
             EncryptionKey encryptionKey = new EncryptionKey();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-common/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java
----------------------------------------------------------------------
diff --git a/kerby-common/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java b/kerby-common/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java
index 355dd8c..8ee2e15 100644
--- a/kerby-common/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java
+++ b/kerby-common/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java
@@ -270,7 +270,7 @@ public abstract class Asn1String extends Asn1Simple<String> {
     }
 
     public static String[] split(String input, char delimiter) {
-        List<String> v = new ArrayList<String>();
+        List<String> v = new ArrayList<>();
         boolean moreTokens = true;
         String subString;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
----------------------------------------------------------------------
diff --git a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
index a715089..67fc37d 100644
--- a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
+++ b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
@@ -40,7 +40,7 @@ public class Conf implements Config {
     private final ConfigImpl config;
 
     public Conf() {
-        this.resourceConfigs = new ArrayList<ConfigLoader>(1);
+        this.resourceConfigs = new ArrayList<>(1);
         this.config = new ConfigImpl("Conf");
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java
----------------------------------------------------------------------
diff --git a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java
index ec3090f..22cb957 100644
--- a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java
+++ b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java
@@ -41,7 +41,7 @@ public class ConfigImpl implements Config {
     protected ConfigImpl(String resource) {
         this.resource = resource;
         this.properties = new HashMap<String, ConfigObject>();
-        this.configs = new ArrayList<Config>(0);
+        this.configs = new ArrayList<>(0);
     }
 
     protected void reset() {
@@ -56,7 +56,7 @@ public class ConfigImpl implements Config {
 
     @Override
     public Set<String> getNames() {
-        Set<String>propNames = new HashSet<String>(properties.keySet());
+        Set<String>propNames = new HashSet<>(properties.keySet());
         for (Config config : configs) {
             propNames.addAll(config.getNames());
         }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java
----------------------------------------------------------------------
diff --git a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java
index 98b78e4..7008147 100644
--- a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java
+++ b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java
@@ -34,7 +34,7 @@ public class ConfigObject {
     }
 
     public ConfigObject(String[] values) {
-        List<String> valuesList = new ArrayList<String>();
+        List<String> valuesList = new ArrayList<>();
         for (String v : values) {
             valuesList.add(v);
         }
@@ -45,9 +45,9 @@ public class ConfigObject {
 
     public ConfigObject(List<String> values) {
         if (values != null) {
-            this.value = new ArrayList<String>(values);
+            this.value = new ArrayList<>(values);
         } else {
-            this.value = new ArrayList<String>();
+            this.value = new ArrayList<>();
         }
         this.valueType = ValueType.LIST;
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
----------------------------------------------------------------------
diff --git a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
index 78ac7a4..72da7ff 100644
--- a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
+++ b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
@@ -118,7 +118,7 @@ public class XmlConfigLoader extends ConfigLoader {
         }
 
         NodeList nodes = ele.getChildNodes();
-        List<String> values = new ArrayList<String>(nodes.getLength());
+        List<String> values = new ArrayList<>(nodes.getLength());
         for (int i = 0; i < nodes.getLength(); i++) {
             String value = null;
             Node valueNode = nodes.item(i);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-common/kerby-util/src/main/java/org/apache/kerby/util/Util.java
----------------------------------------------------------------------
diff --git a/kerby-common/kerby-util/src/main/java/org/apache/kerby/util/Util.java b/kerby-common/kerby-util/src/main/java/org/apache/kerby/util/Util.java
index 2d55e21..e487c8b 100644
--- a/kerby-common/kerby-util/src/main/java/org/apache/kerby/util/Util.java
+++ b/kerby-common/kerby-util/src/main/java/org/apache/kerby/util/Util.java
@@ -104,7 +104,7 @@ public class Util {
     }
 
     private static Set<String> aliases(KeyStore ks) throws KeyStoreException {
-        Set<String> aliases = new TreeSet<String>();
+        Set<String> aliases = new TreeSet<>();
         Enumeration<String> en = ks.aliases();
         while (en.hasMoreElements()) {
             aliases.add(en.nextElement());

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-common/kerby-xdr/src/main/java/org/apache/kerby/xdr/type/XdrString.java
----------------------------------------------------------------------
diff --git a/kerby-common/kerby-xdr/src/main/java/org/apache/kerby/xdr/type/XdrString.java b/kerby-common/kerby-xdr/src/main/java/org/apache/kerby/xdr/type/XdrString.java
index d648e01..539f17c 100644
--- a/kerby-common/kerby-xdr/src/main/java/org/apache/kerby/xdr/type/XdrString.java
+++ b/kerby-common/kerby-xdr/src/main/java/org/apache/kerby/xdr/type/XdrString.java
@@ -319,7 +319,7 @@ public class XdrString extends XdrSimple<String> {
     }
 
     public static String[] split(String input, char delimiter) {
-        List<String> v = new ArrayList<String>();
+        List<String> v = new ArrayList<>();
         boolean moreTokens = true;
         String subString;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/TokenKdcTestBase.java
----------------------------------------------------------------------
diff --git a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/TokenKdcTestBase.java b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/TokenKdcTestBase.java
index 88d2286..a7c6eb8 100644
--- a/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/TokenKdcTestBase.java
+++ b/kerby-kdc-test/src/test/java/org/apache/kerby/kerberos/kdc/TokenKdcTestBase.java
@@ -92,7 +92,7 @@ public class TokenKdcTestBase extends KdcTestBase {
         authToken.addAttribute("group", GROUP);
         authToken.addAttribute("role", ROLE);
 
-        List<String> aud = new ArrayList<String>();
+        List<String> aud = new ArrayList<>();
         aud.add(audience);
         authToken.setAudiences(aud);
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
index e064b20..aedc0c5 100644
--- a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
+++ b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
@@ -114,7 +114,7 @@ public class TokenLoginTestBase extends LoginTestBase {
 
         authToken.addAttribute("role", ROLE);
 
-        List<String> aud = new ArrayList<String>();
+        List<String> aud = new ArrayList<>();
         aud.add(KrbUtil.makeTgsPrincipal(TestKdcServer.KDC_REALM).getName());
         authToken.setAudiences(aud);
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/AuthUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/AuthUtil.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/AuthUtil.java
index 68d03e7..0a8b3df 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/AuthUtil.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/AuthUtil.java
@@ -44,7 +44,7 @@ public class AuthUtil {
 
     public static Subject loginUsingTicketCache(
         String principal, File cacheFile) throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
+        Set<Principal> principals = new HashSet<>();
         principals.add(new KerberosPrincipal(principal));
 
         Subject subject = new Subject(false, principals,
@@ -59,7 +59,7 @@ public class AuthUtil {
 
     public static Subject loginUsingKeytab(
         String principal, File keytabFile) throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
+        Set<Principal> principals = new HashSet<>();
         principals.add(new KerberosPrincipal(principal));
 
         Subject subject = new Subject(false, principals,

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenJaasKrbUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenJaasKrbUtil.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenJaasKrbUtil.java
index 0ec8df3..d623de6 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenJaasKrbUtil.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/jaas/TokenJaasKrbUtil.java
@@ -72,7 +72,7 @@ public class TokenJaasKrbUtil {
     public static Subject loginUsingToken(
             String principal, String tokenStr, File armorCache, File ccache, File signKeyFile)
             throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
+        Set<Principal> principals = new HashSet<>();
         principals.add(new KerberosPrincipal(principal));
 
         Subject subject = new Subject(false, principals,

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthContext.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthContext.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthContext.java
index d5fa43b..49eab44 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthContext.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthContext.java
@@ -33,8 +33,8 @@ public class PreauthContext {
     private PaData errorPaData;
     private UserResponser userResponser = new UserResponser();
     private PaDataType allowedPaType;
-    private final List<PaDataType> triedPaTypes = new ArrayList<PaDataType>(1);
-    private final List<PreauthHandle> handles = new ArrayList<PreauthHandle>(5);
+    private final List<PaDataType> triedPaTypes = new ArrayList<>(1);
+    private final List<PreauthHandle> handles = new ArrayList<>(5);
 
     public PreauthContext() {
         this.allowedPaType = PaDataType.NONE;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthHandler.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthHandler.java
index 443195a..a93329b 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthHandler.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/PreauthHandler.java
@@ -44,7 +44,7 @@ public class PreauthHandler {
     }
 
     private void loadPreauthPlugins(KrbContext context) {
-        preauths = new ArrayList<KrbPreauth>();
+        preauths = new ArrayList<>();
 
         KrbPreauth preauth = new EncTsPreauth();
         preauth.init(context);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/UserResponser.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/UserResponser.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/UserResponser.java
index eeaad10..7775ba3 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/UserResponser.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/UserResponser.java
@@ -24,7 +24,7 @@ import java.util.List;
 
 public class UserResponser {
 
-    private final List<UserResponseItem> items = new ArrayList<UserResponseItem>(1);
+    private final List<UserResponseItem> items = new ArrayList<>(1);
 
     /**
      * Let customize an interface like CMD or WEB UI to selectively respond all the questions

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
index bb9a6ac..9583bff 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
@@ -62,7 +62,7 @@ public abstract class KdcRequest {
     private Object sessionData;
     private KOptions requestOptions;
     private PrincipalName serverPrincipal;
-    private List<HostAddress> hostAddresses = new ArrayList<HostAddress>();
+    private List<HostAddress> hostAddresses = new ArrayList<>();
     private KdcOptions kdcOptions = new KdcOptions();
     private List<EncryptionType> encryptionTypes;
     private EncryptionType chosenEncryptionType;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
index 777e5a4..c41dc28 100644
--- a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
+++ b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/EncryptionUtil.java
@@ -104,7 +104,7 @@ public class EncryptionUtil {
     public static List<EncryptionKey> generateKeys(
             String principal, String passwd,
             List<EncryptionType> encryptionTypes) throws KrbException {
-        List<EncryptionKey> results = new ArrayList<EncryptionKey>(encryptionTypes.size());
+        List<EncryptionKey> results = new ArrayList<>(encryptionTypes.size());
         for (EncryptionType eType : encryptionTypes) {
             EncryptionKey encKey = EncryptionHandler.string2Key(
                 principal, passwd, eType);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/KrbErrorUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/KrbErrorUtil.java b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/KrbErrorUtil.java
index 98063d0..fb953af 100644
--- a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/KrbErrorUtil.java
+++ b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/common/KrbErrorUtil.java
@@ -53,7 +53,7 @@ public class KrbErrorUtil {
     private static List<EncryptionType> getEtypes(byte[] data) throws IOException {
         EtypeInfo info = new EtypeInfo();
         info.decode(data);
-        List<EncryptionType> results = new ArrayList<EncryptionType>();
+        List<EncryptionType> results = new ArrayList<>();
         for (EtypeInfoEntry entry : info.getElements()) {
             results.add(entry.getEtype());
         }
@@ -63,7 +63,7 @@ public class KrbErrorUtil {
     private static List<EncryptionType> getEtypes2(byte[] data) throws IOException {
         EtypeInfo2 info2 = new EtypeInfo2();
         info2.decode(data);
-        List<EncryptionType> results = new ArrayList<EncryptionType>();
+        List<EncryptionType> results = new ArrayList<>();
         for (EtypeInfo2Entry entry : info2.getElements()) {
             results.add(entry.getEtype());
         }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/IdentityOpts.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/IdentityOpts.java b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/IdentityOpts.java
index ff900b4..dcb8868 100644
--- a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/IdentityOpts.java
+++ b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/IdentityOpts.java
@@ -28,10 +28,10 @@ import java.util.List;
 public class IdentityOpts {
 
     private String identity;
-    private List<String> altIdentities = new ArrayList<String>(1);
-    private List<String> anchors = new ArrayList<String>(4);
-    private List<String> intermediates = new ArrayList<String>(2);
-    private List<String> crls = new ArrayList<String>(2);
+    private List<String> altIdentities = new ArrayList<>(1);
+    private List<String> anchors = new ArrayList<>(4);
+    private List<String> intermediates = new ArrayList<>(2);
+    private List<String> crls = new ArrayList<>(2);
     private String ocsp;
     private IdentityType idType;
     private String certFile;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcUdpTransport.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcUdpTransport.java b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcUdpTransport.java
index 34d38d3..41f3cc0 100644
--- a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcUdpTransport.java
+++ b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/transport/KdcUdpTransport.java
@@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit;
  * Default implementation of {@link KrbTransport} using UDP.
  */
 public class KdcUdpTransport extends KrbUdpTransport {
-    private BlockingQueue<ByteBuffer> bufferQueue = new ArrayBlockingQueue<ByteBuffer>(2);
+    private BlockingQueue<ByteBuffer> bufferQueue = new ArrayBlockingQueue<>(2);
 
     public KdcUdpTransport(DatagramChannel channel, InetSocketAddress remoteAddress) throws IOException {
         super(remoteAddress);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbIntegers.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbIntegers.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbIntegers.java
index 9ca2826..aab34fd 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbIntegers.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbIntegers.java
@@ -45,7 +45,7 @@ public class KrbIntegers extends KrbSequenceOfType<Asn1Integer> {
     }
 
     public List<Integer> getValues() {
-        List<Integer> results = new ArrayList<Integer>();
+        List<Integer> results = new ArrayList<>();
         for (Asn1Integer value : getElements()) {
             results.add(value.getValue().intValue());
         }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbSequenceOfType.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbSequenceOfType.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbSequenceOfType.java
index 10e2832..8f9f7d9 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbSequenceOfType.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/KrbSequenceOfType.java
@@ -45,7 +45,7 @@ public class KrbSequenceOfType<T extends Asn1Type> extends Asn1SequenceOf<T> {
             return new ArrayList<String>();
         }
         
-        List<String> results = new ArrayList<String>(elements.size());
+        List<String> results = new ArrayList<>(elements.size());
         
         for (T ele : elements) {
             if (ele instanceof Asn1String) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADAndOr.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADAndOr.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADAndOr.java
index 50ac2f7..308d34a 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADAndOr.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADAndOr.java
@@ -36,7 +36,7 @@ public class ADAndOr extends AuthorizationDataEntry {
 
     public ADAndOr() {
         super(AuthorizationType.AD_AND_OR);
-        myAndOr = new KrbSequenceOfType<AndOr>();
+        myAndOr = new KrbSequenceOfType<>();
         myAndOr.outerEncodeable = this;
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADEnctypeNegotiation.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADEnctypeNegotiation.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADEnctypeNegotiation.java
index 3a40490..52db970 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADEnctypeNegotiation.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/ADEnctypeNegotiation.java
@@ -37,7 +37,7 @@ public class ADEnctypeNegotiation extends AuthorizationDataEntry {
 
     public ADEnctypeNegotiation() {
         super(AuthorizationType.AD_ETYPE_NEGOTIATION);
-        myEnctypeNeg = new KrbSequenceOfType<Asn1Integer>();
+        myEnctypeNeg = new KrbSequenceOfType<>();
         myEnctypeNeg.outerEncodeable = this;
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java
index 2c171a6..17f89d3 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java
@@ -145,7 +145,7 @@ public class KdcReqBody extends KrbSequenceType {
             return Collections.emptyList();
         }
 
-        List<EncryptionType> results = new ArrayList<EncryptionType>();
+        List<EncryptionType> results = new ArrayList<>();
         for (Integer value : values.getValues()) {
             results.add(EncryptionType.fromValue(value));
         }
@@ -153,7 +153,7 @@ public class KdcReqBody extends KrbSequenceType {
     }
 
     public void setEtypes(List<EncryptionType> etypes) {
-        List<Integer> values = new ArrayList<Integer>();
+        List<Integer> values = new ArrayList<>();
         for (EncryptionType etype: etypes) {
             values.add(etype.getValue());
         }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CamelliaEncTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CamelliaEncTest.java b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CamelliaEncTest.java
index 33d0efe..a07f179 100644
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CamelliaEncTest.java
+++ b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CamelliaEncTest.java
@@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
  */
 public class CamelliaEncTest {
 
-    private List<String> outputs = new ArrayList<String>();
+    private List<String> outputs = new ArrayList<>();
 
     private byte[] plain = new byte[16];
     private byte[] cipher = new byte[16];
@@ -50,7 +50,7 @@ public class CamelliaEncTest {
     private List<String> getExpectedLines() throws IOException {
         try (InputStream res = getClass().getResourceAsStream("/camellia-expect-vt.txt");
              BufferedReader br = new BufferedReader(new InputStreamReader(res))) {
-            List<String> results = new ArrayList<String>();
+            List<String> results = new ArrayList<>();
             String line;
             while ((line = br.readLine()) != null) {
                 line = line.trim();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthContext.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthContext.java b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthContext.java
index 21d2106..7bc5826 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthContext.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthContext.java
@@ -27,7 +27,7 @@ import java.util.List;
 
 public class PreauthContext {
     private boolean preauthRequired = true;
-    private List<PreauthHandle> handles = new ArrayList<PreauthHandle>(5);
+    private List<PreauthHandle> handles = new ArrayList<>(5);
     private PaData outputPaData;
 
     public PreauthContext() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
index 4f45026..b9482d5 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
@@ -45,7 +45,7 @@ public class PreauthHandler {
     }
 
     private void loadPreauthPlugins() {
-        preauths = new ArrayList<KdcPreauth>();
+        preauths = new ArrayList<>();
 
         KdcPreauth preauth = new EncTsPreauth();
         preauths.add(preauth);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/replay/SimpleCacheService.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/replay/SimpleCacheService.java b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/replay/SimpleCacheService.java
index 90b27ec..3f9bf77 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/replay/SimpleCacheService.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/replay/SimpleCacheService.java
@@ -26,7 +26,7 @@ public class SimpleCacheService implements CacheService {
     private final Set<RequestRecord> requests;
 
     public SimpleCacheService() {
-        requests = new HashSet<RequestRecord>();
+        requests = new HashSet<>();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java b/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
index 224d869..fd39a82 100644
--- a/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
+++ b/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
@@ -48,7 +48,7 @@ public final class JaasKrbUtil {
 
     public static Subject loginUsingPassword(
             String principal, String password) throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
+        Set<Principal> principals = new HashSet<>();
         principals.add(new KerberosPrincipal(principal));
 
         Subject subject = new Subject(false, principals,
@@ -64,7 +64,7 @@ public final class JaasKrbUtil {
 
     public static Subject loginUsingTicketCache(
             String principal, File cacheFile) throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
+        Set<Principal> principals = new HashSet<>();
         principals.add(new KerberosPrincipal(principal));
 
         Subject subject = new Subject(false, principals,
@@ -79,7 +79,7 @@ public final class JaasKrbUtil {
 
     public static Subject loginUsingKeytab(
             String principal, File keytabFile) throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
+        Set<Principal> principals = new HashSet<>();
         principals.add(new KerberosPrincipal(principal));
 
         Subject subject = new Subject(false, principals,

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheInputStream.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheInputStream.java b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheInputStream.java
index dded504..610a2af 100644
--- a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheInputStream.java
+++ b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheInputStream.java
@@ -58,7 +58,7 @@ public class CredCacheInputStream extends KrbInputStream {
 
         String realm = readCountedString();
 
-        List<String> nameStrings = new ArrayList<String>();
+        List<String> nameStrings = new ArrayList<>();
         String component;
         for (int i = 0; i < numComponents; i++) { // sub 1 if version 0x501
             component = readCountedString();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredentialCache.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredentialCache.java b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredentialCache.java
index 828a0c5..d979580 100644
--- a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredentialCache.java
+++ b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredentialCache.java
@@ -232,7 +232,7 @@ public class CredentialCache implements KrbCredentialCache {
 
     private List<Credential> readCredentials(CredCacheInputStream ccis)
             throws IOException {
-        List<Credential> results = new ArrayList<Credential>(2);
+        List<Credential> results = new ArrayList<>(2);
 
         Credential cred;
         while (ccis.available() > 0) {
@@ -252,7 +252,7 @@ public class CredentialCache implements KrbCredentialCache {
 
     private List<Tag> readTags(CredCacheInputStream ccis) throws IOException {
         int len = ccis.readShort();
-        List<Tag> tags = new ArrayList<Tag>();
+        List<Tag> tags = new ArrayList<>();
 
         int tag, tagLen, time, usec;
         while (len > 0) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/Keytab.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/Keytab.java b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/Keytab.java
index 52e15d9..d876d91 100644
--- a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/Keytab.java
+++ b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/Keytab.java
@@ -107,7 +107,7 @@ public final class Keytab implements KrbKeytab {
 
     @Override
     public List<KeytabEntry> getKeytabEntries(PrincipalName principal) {
-        List<KeytabEntry> results = new ArrayList<KeytabEntry>();
+        List<KeytabEntry> results = new ArrayList<>();
 
         List<KeytabEntry> internal = principalEntries.get(principal);
         if (internal == null) {
@@ -167,7 +167,7 @@ public final class Keytab implements KrbKeytab {
         PrincipalName principal = entry.getPrincipal();
         List<KeytabEntry> entries = principalEntries.get(principal);
         if (entries == null) {
-            entries = new ArrayList<KeytabEntry>();
+            entries = new ArrayList<>();
             principalEntries.put(principal, entries);
         }
         entries.add(entry);
@@ -178,7 +178,7 @@ public final class Keytab implements KrbKeytab {
     }
 
     private List<KeytabEntry> readEntries(KeytabInputStream kis) throws IOException {
-        List<KeytabEntry> entries = new ArrayList<KeytabEntry>();
+        List<KeytabEntry> entries = new ArrayList<>();
 
         int bytesLeft = kis.available();
         while (bytesLeft > 0) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabInputStream.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabInputStream.java b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabInputStream.java
index 0b839c7..67ad554 100644
--- a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabInputStream.java
+++ b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabInputStream.java
@@ -49,7 +49,7 @@ public class KeytabInputStream extends KrbInputStream {
 
         String realm = readCountedString();
 
-        List<String> nameStrings = new ArrayList<String>();
+        List<String> nameStrings = new ArrayList<>();
         for (int i = 0; i < numComponents; i++) { // sub 1 if version 0x501
             String component = readCountedString();
             nameStrings.add(component);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-provider/token-provider/src/test/java/org/apache/kerby/kerberos/provider/token/TokenTest.java
----------------------------------------------------------------------
diff --git a/kerby-provider/token-provider/src/test/java/org/apache/kerby/kerberos/provider/token/TokenTest.java b/kerby-provider/token-provider/src/test/java/org/apache/kerby/kerberos/provider/token/TokenTest.java
index 602a941..2a93f32 100644
--- a/kerby-provider/token-provider/src/test/java/org/apache/kerby/kerberos/provider/token/TokenTest.java
+++ b/kerby-provider/token-provider/src/test/java/org/apache/kerby/kerberos/provider/token/TokenTest.java
@@ -50,7 +50,7 @@ public class TokenTest {
     static final String ROLE = "ADMIN";
 
     private AuthToken authToken;
-    private List<String> auds = new ArrayList<String>();
+    private List<String> auds = new ArrayList<>();
     private EncryptionMethod encryptionMethod = EncryptionMethod.A128GCM;
 
     @Before
@@ -263,7 +263,7 @@ public class TokenTest {
 
     @Test
     public void testInvalidAudienceJWT() throws Exception {
-        List<String> audiences = new ArrayList<String>();
+        List<String> audiences = new ArrayList<>();
         audiences.add("invalid@EXAMPLE.COM");
 
         TokenEncoder tokenEncoder = KrbRuntime.getTokenProvider("JWT").createTokenEncoder();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/token/TokenInit.java
----------------------------------------------------------------------
diff --git a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/token/TokenInit.java b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/token/TokenInit.java
index a1cd5da..ad26d37 100644
--- a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/token/TokenInit.java
+++ b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/token/TokenInit.java
@@ -48,7 +48,7 @@ public class TokenInit {
             authToken.addAttribute("role", role);
         }
 
-        List<String> aud = new ArrayList<String>();
+        List<String> aud = new ArrayList<>();
         aud.add("krb5kdc-with-token-extension");
         authToken.setAudiences(aud);
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-tool/has-tool/src/main/java/org/apache/kerby/kerberos/tool/hclient/HasClientLoginTool.java
----------------------------------------------------------------------
diff --git a/kerby-tool/has-tool/src/main/java/org/apache/kerby/kerberos/tool/hclient/HasClientLoginTool.java b/kerby-tool/has-tool/src/main/java/org/apache/kerby/kerberos/tool/hclient/HasClientLoginTool.java
index 585b9ee..697ab2c 100644
--- a/kerby-tool/has-tool/src/main/java/org/apache/kerby/kerberos/tool/hclient/HasClientLoginTool.java
+++ b/kerby-tool/has-tool/src/main/java/org/apache/kerby/kerberos/tool/hclient/HasClientLoginTool.java
@@ -43,8 +43,8 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
 public class HasClientLoginTool {
-    private static List<String> principalList = new ArrayList<String>();
-    private static List<File>  keytabList = new ArrayList<File>();
+    private static List<String> principalList = new ArrayList<>();
+    private static List<File>  keytabList = new ArrayList<>();
 
     private static final String KEYTAB_USAGE = (OSUtil.isWindows()
         ? "Usage: bin\\k=login-test.cmd" : "Usage: sh bin/login-test.sh")

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6be77153/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/AuthUtil.java
----------------------------------------------------------------------
diff --git a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/AuthUtil.java b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/AuthUtil.java
index f0f3f62..4374d9c 100644
--- a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/AuthUtil.java
+++ b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/AuthUtil.java
@@ -44,7 +44,7 @@ public class AuthUtil {
 
     public static Subject loginUsingTicketCache(
         String principal, File cacheFile) throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
+        Set<Principal> principals = new HashSet<>();
         principals.add(new KerberosPrincipal(principal));
 
         Subject subject = new Subject(false, principals,
@@ -59,7 +59,7 @@ public class AuthUtil {
 
     public static Subject loginUsingKeytab(
         String principal, File keytabFile) throws LoginException {
-        Set<Principal> principals = new HashSet<Principal>();
+        Set<Principal> principals = new HashSet<>();
         principals.add(new KerberosPrincipal(principal));
 
         Subject subject = new Subject(false, principals,


Mime
View raw message