--- old/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java 2015-04-23 15:27:51.020132050 -0700 +++ new/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java 2015-04-23 15:27:50.680132042 -0700 @@ -711,7 +711,7 @@ cf = CertificateFactory.getInstance("X509"); } else { // version 2 - cfs = new Hashtable(3); + cfs = new Hashtable<>(3); } entries.clear(); --- old/src/java.base/share/classes/com/sun/crypto/provider/PBEKeyFactory.java 2015-04-23 15:27:51.920132071 -0700 +++ new/src/java.base/share/classes/com/sun/crypto/provider/PBEKeyFactory.java 2015-04-23 15:27:51.576132063 -0700 @@ -56,7 +56,7 @@ } static { - validTypes = new HashSet(17); + validTypes = new HashSet<>(17); validTypes.add("PBEWithMD5AndDES".toUpperCase(Locale.ENGLISH)); validTypes.add("PBEWithSHA1AndDESede".toUpperCase(Locale.ENGLISH)); validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase(Locale.ENGLISH)); --- old/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java 2015-04-23 15:27:52.784132091 -0700 +++ new/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java 2015-04-23 15:27:52.448132083 -0700 @@ -115,7 +115,7 @@ final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING"; AccessController.doPrivileged( - new java.security.PrivilegedAction() { + new java.security.PrivilegedAction<>() { public Object run() { /* --- old/src/java.base/share/classes/com/sun/net/ssl/KeyManagerFactory.java 2015-04-23 15:27:53.716132113 -0700 +++ new/src/java.base/share/classes/com/sun/net/ssl/KeyManagerFactory.java 2015-04-23 15:27:53.348132104 -0700 @@ -63,7 +63,7 @@ */ public final static String getDefaultAlgorithm() { String type; - type = AccessController.doPrivileged(new PrivilegedAction() { + type = AccessController.doPrivileged(new PrivilegedAction<>() { public String run() { return Security.getProperty("sun.ssl.keymanager.type"); } --- old/src/java.base/share/classes/com/sun/net/ssl/TrustManagerFactory.java 2015-04-23 15:27:54.732132136 -0700 +++ new/src/java.base/share/classes/com/sun/net/ssl/TrustManagerFactory.java 2015-04-23 15:27:54.352132127 -0700 @@ -63,7 +63,7 @@ */ public final static String getDefaultAlgorithm() { String type; - type = AccessController.doPrivileged(new PrivilegedAction() { + type = AccessController.doPrivileged(new PrivilegedAction<>() { public String run() { return Security.getProperty("sun.ssl.trustmanager.type"); } --- old/src/java.base/share/classes/java/security/AccessControlContext.java 2015-04-23 15:27:55.744132160 -0700 +++ new/src/java.base/share/classes/java/security/AccessControlContext.java 2015-04-23 15:27:55.360132151 -0700 @@ -458,7 +458,7 @@ Thread.dumpStack(); final ProtectionDomain pd = context[i]; final Debug db = debug; - AccessController.doPrivileged (new PrivilegedAction() { + AccessController.doPrivileged (new PrivilegedAction<>() { public Void run() { db.println("domain that failed "+pd); return null; --- old/src/java.base/share/classes/java/security/AccessController.java 2015-04-23 15:27:56.720132182 -0700 +++ new/src/java.base/share/classes/java/security/AccessController.java 2015-04-23 15:27:56.360132174 -0700 @@ -612,7 +612,7 @@ private static ProtectionDomain getCallerPD(final Class caller) { ProtectionDomain callerPd = doPrivileged - (new PrivilegedAction() { + (new PrivilegedAction<>() { public ProtectionDomain run() { return caller.getProtectionDomain(); } --- old/src/java.base/share/classes/java/security/AllPermission.java 2015-04-23 15:27:57.752132206 -0700 +++ new/src/java.base/share/classes/java/security/AllPermission.java 2015-04-23 15:27:57.400132198 -0700 @@ -212,7 +212,7 @@ * @return an enumeration of all the AllPermission objects. */ public Enumeration elements() { - return new Enumeration() { + return new Enumeration<>() { private boolean hasMore = all_allowed; public boolean hasMoreElements() { --- old/src/java.base/share/classes/java/security/BasicPermission.java 2015-04-23 15:27:58.700132228 -0700 +++ new/src/java.base/share/classes/java/security/BasicPermission.java 2015-04-23 15:27:58.320132219 -0700 @@ -332,7 +332,7 @@ */ public BasicPermissionCollection(Class clazz) { - perms = new HashMap(11); + perms = new HashMap<>(11); all_allowed = false; permClass = clazz; } @@ -533,7 +533,7 @@ @SuppressWarnings("unchecked") Hashtable permissions = (Hashtable)gfields.get("permissions", null); - perms = new HashMap(permissions.size()*2); + perms = new HashMap<>(permissions.size()*2); perms.putAll(permissions); // Get all_allowed --- old/src/java.base/share/classes/java/security/CodeSource.java 2015-04-23 15:27:59.620132249 -0700 +++ new/src/java.base/share/classes/java/security/CodeSource.java 2015-04-23 15:27:59.256132241 -0700 @@ -543,7 +543,7 @@ if (size > 0) { // we know of 3 different cert types: X.509, PGP, SDSI, which // could all be present in the stream at the same time - cfs = new Hashtable(3); + cfs = new Hashtable<>(3); this.certs = new java.security.cert.Certificate[size]; } --- old/src/java.base/share/classes/java/security/Identity.java 2015-04-23 15:28:00.548132271 -0700 +++ new/src/java.base/share/classes/java/security/Identity.java 2015-04-23 15:28:00.188132263 -0700 @@ -185,7 +185,7 @@ check("setIdentityPublicKey"); this.publicKey = key; - certificates = new Vector(); + certificates = new Vector<>(); } /** @@ -248,7 +248,7 @@ check("addIdentityCertificate"); if (certificates == null) { - certificates = new Vector(); + certificates = new Vector<>(); } if (publicKey != null) { if (!keyEquals(publicKey, certificate.getPublicKey())) { --- old/src/java.base/share/classes/java/security/IdentityScope.java 2015-04-23 15:28:01.540132294 -0700 +++ new/src/java.base/share/classes/java/security/IdentityScope.java 2015-04-23 15:28:01.172132285 -0700 @@ -74,7 +74,7 @@ private static void initializeSystemScope() { String classname = AccessController.doPrivileged( - new PrivilegedAction() { + new PrivilegedAction<>() { public String run() { return Security.getProperty("system.scope"); } --- old/src/java.base/share/classes/java/security/KeyStore.java 2015-04-23 15:28:02.488132316 -0700 +++ new/src/java.base/share/classes/java/security/KeyStore.java 2015-04-23 15:28:02.136132308 -0700 @@ -976,7 +976,7 @@ */ public final static String getDefaultType() { String kstype; - kstype = AccessController.doPrivileged(new PrivilegedAction() { + kstype = AccessController.doPrivileged(new PrivilegedAction<>() { public String run() { return Security.getProperty(KEYSTORE_TYPE); } --- old/src/java.base/share/classes/java/security/Permissions.java 2015-04-23 15:28:03.468132339 -0700 +++ new/src/java.base/share/classes/java/security/Permissions.java 2015-04-23 15:28:03.108132330 -0700 @@ -99,7 +99,7 @@ * Creates a new Permissions object containing no PermissionCollections. */ public Permissions() { - permsMap = new HashMap, PermissionCollection>(11); + permsMap = new HashMap<>(11); allPermission = null; } @@ -394,7 +394,7 @@ @SuppressWarnings("unchecked") Hashtable, PermissionCollection> perms = (Hashtable, PermissionCollection>)gfields.get("perms", null); - permsMap = new HashMap, PermissionCollection>(perms.size()*2); + permsMap = new HashMap<>(perms.size()*2); permsMap.putAll(perms); // Set hasUnresolved @@ -488,7 +488,7 @@ */ PermissionsHash() { - permsMap = new HashMap(11); + permsMap = new HashMap<>(11); } /** @@ -597,7 +597,7 @@ @SuppressWarnings("unchecked") Hashtable perms = (Hashtable)gfields.get("perms", null); - permsMap = new HashMap(perms.size()*2); + permsMap = new HashMap<>(perms.size()*2); permsMap.putAll(perms); } } --- old/src/java.base/share/classes/java/security/Policy.java 2015-04-23 15:28:04.412132360 -0700 +++ new/src/java.base/share/classes/java/security/Policy.java 2015-04-23 15:28:04.044132352 -0700 @@ -170,7 +170,7 @@ PolicyInfo pinfo = policy.get(); if (pinfo.policy == null) { String policy_class = AccessController.doPrivileged( - new PrivilegedAction() { + new PrivilegedAction<>() { public String run() { return Security.getProperty("policy.provider"); } @@ -199,7 +199,7 @@ final String pc = policy_class; Policy pol = AccessController.doPrivileged( - new PrivilegedAction() { + new PrivilegedAction<>() { public Policy run() { try { ClassLoader cl = @@ -303,7 +303,7 @@ */ ProtectionDomain policyDomain = - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction<>() { public ProtectionDomain run() { return p.getClass().getProtectionDomain(); } --- old/src/java.base/share/classes/java/security/ProtectionDomain.java 2015-04-23 15:28:05.428132384 -0700 +++ new/src/java.base/share/classes/java/security/ProtectionDomain.java 2015-04-23 15:28:05.080132376 -0700 @@ -367,7 +367,7 @@ PermissionCollection perms = java.security.AccessController.doPrivileged - (new java.security.PrivilegedAction() { + (new java.security.PrivilegedAction<>() { public PermissionCollection run() { Policy p = Policy.getPolicyNoCheck(); return p.getPermissions(ProtectionDomain.this); --- old/src/java.base/share/classes/java/security/Provider.java 2015-04-23 15:28:06.356132405 -0700 +++ new/src/java.base/share/classes/java/security/Provider.java 2015-04-23 15:28:06.000132397 -0700 @@ -711,7 +711,7 @@ legacyChanged = true; if (legacyStrings == null) { - legacyStrings = new LinkedHashMap(); + legacyStrings = new LinkedHashMap<>(); } return true; } @@ -773,7 +773,7 @@ private void implReplaceAll(BiFunction function) { legacyChanged = true; if (legacyStrings == null) { - legacyStrings = new LinkedHashMap(); + legacyStrings = new LinkedHashMap<>(); } else { legacyStrings.replaceAll((BiFunction) function); } @@ -905,7 +905,7 @@ } serviceSet = null; if (legacyMap == null) { - legacyMap = new LinkedHashMap(); + legacyMap = new LinkedHashMap<>(); } else { legacyMap.clear(); } @@ -1133,7 +1133,7 @@ ("service.getProvider() must match this Provider object"); } if (serviceMap == null) { - serviceMap = new LinkedHashMap(); + serviceMap = new LinkedHashMap<>(); } servicesChanged = true; String type = s.getType(); @@ -1305,7 +1305,7 @@ } static { - knownEngines = new HashMap(); + knownEngines = new HashMap<>(); // JCA addEngine("AlgorithmParameterGenerator", false, null); addEngine("AlgorithmParameters", false, null); @@ -1431,14 +1431,14 @@ private void addAlias(String alias) { if (aliases.isEmpty()) { - aliases = new ArrayList(2); + aliases = new ArrayList<>(2); } aliases.add(alias); } void addAttribute(String type, String value) { if (attributes.isEmpty()) { - attributes = new HashMap(8); + attributes = new HashMap<>(8); } attributes.put(new UString(type), value); } @@ -1471,12 +1471,12 @@ if (aliases == null) { this.aliases = Collections.emptyList(); } else { - this.aliases = new ArrayList(aliases); + this.aliases = new ArrayList<>(aliases); } if (attributes == null) { this.attributes = Collections.emptyMap(); } else { - this.attributes = new HashMap(); + this.attributes = new HashMap<>(); for (Map.Entry entry : attributes.entrySet()) { this.attributes.put(new UString(entry.getKey()), entry.getValue()); } @@ -1644,7 +1644,7 @@ ("class configured for " + type + " (provider: " + provider.getName() + ") is not public."); } - classRef = new WeakReference>(clazz); + classRef = new WeakReference<>(clazz); } return clazz; } catch (ClassNotFoundException e) { --- old/src/java.base/share/classes/java/security/SecureRandom.java 2015-04-23 15:28:07.336132428 -0700 +++ new/src/java.base/share/classes/java/security/SecureRandom.java 2015-04-23 15:28:06.972132420 -0700 @@ -616,7 +616,7 @@ throws NoSuchAlgorithmException { String property = AccessController.doPrivileged( - new PrivilegedAction() { + new PrivilegedAction<>() { @Override public String run() { return Security.getProperty( --- old/src/java.base/share/classes/java/security/Security.java 2015-04-23 15:28:08.240132449 -0700 +++ new/src/java.base/share/classes/java/security/Security.java 2015-04-23 15:28:07.892132441 -0700 @@ -66,7 +66,7 @@ // things in initialize that might require privs. // (the FileInputStream call and the File.exists call, // the securityPropFile call, etc) - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction<>() { public Void run() { initialize(); return null; @@ -810,7 +810,7 @@ final boolean pd = key.equals("package.definition"); if (pa || pd) { - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction<>() { public Void run() { try { /* Get the class via the bootstrap class loader. */ --- old/src/java.base/share/classes/java/security/Signature.java 2015-04-23 15:28:09.228132472 -0700 +++ new/src/java.base/share/classes/java/security/Signature.java 2015-04-23 15:28:08.852132463 -0700 @@ -265,7 +265,7 @@ private final static Map signatureInfo; static { - signatureInfo = new ConcurrentHashMap(); + signatureInfo = new ConcurrentHashMap<>(); Boolean TRUE = Boolean.TRUE; // pre-initialize with values for our SignatureSpi implementations signatureInfo.put("sun.security.provider.DSA$RawDSA", TRUE); --- old/src/java.base/share/classes/java/security/Signer.java 2015-04-23 15:28:10.220132495 -0700 +++ new/src/java.base/share/classes/java/security/Signer.java 2015-04-23 15:28:09.840132486 -0700 @@ -140,7 +140,7 @@ } try { AccessController.doPrivileged( - new PrivilegedExceptionAction() { + new PrivilegedExceptionAction<>() { public Void run() throws KeyManagementException { setPublicKey(pub); return null; --- old/src/java.base/share/classes/java/security/UnresolvedPermission.java 2015-04-23 15:28:11.128132516 -0700 +++ new/src/java.base/share/classes/java/security/UnresolvedPermission.java 2015-04-23 15:28:10.784132508 -0700 @@ -560,7 +560,7 @@ if (size > 0) { // we know of 3 different cert types: X.509, PGP, SDSI, which // could all be present in the stream at the same time - cfs = new Hashtable(3); + cfs = new Hashtable<>(3); this.certs = new java.security.cert.Certificate[size]; } --- old/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java 2015-04-23 15:28:12.024132537 -0700 +++ new/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java 2015-04-23 15:28:11.684132529 -0700 @@ -61,7 +61,7 @@ * */ public UnresolvedPermissionCollection() { - perms = new HashMap>(11); + perms = new HashMap<>(11); } /** @@ -82,7 +82,7 @@ synchronized (this) { v = perms.get(up.getName()); if (v == null) { - v = new ArrayList(); + v = new ArrayList<>(); perms.put(up.getName(), v); } } @@ -203,7 +203,7 @@ Hashtable> permissions = (Hashtable>) gfields.get("permissions", null); - perms = new HashMap>(permissions.size()*2); + perms = new HashMap<>(permissions.size()*2); // Convert each entry (Vector) into a List Set>> set = permissions.entrySet(); --- old/src/java.base/share/classes/java/security/cert/CertPathBuilder.java 2015-04-23 15:28:12.904132557 -0700 +++ new/src/java.base/share/classes/java/security/cert/CertPathBuilder.java 2015-04-23 15:28:12.552132549 -0700 @@ -301,7 +301,7 @@ */ public final static String getDefaultType() { String cpbtype = - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction<>() { public String run() { return Security.getProperty(CPB_TYPE); } --- old/src/java.base/share/classes/java/security/cert/CertPathValidator.java 2015-04-23 15:28:13.808132578 -0700 +++ new/src/java.base/share/classes/java/security/cert/CertPathValidator.java 2015-04-23 15:28:13.444132569 -0700 @@ -313,7 +313,7 @@ */ public final static String getDefaultType() { String cpvtype = - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction<>() { public String run() { return Security.getProperty(CPV_TYPE); } --- old/src/java.base/share/classes/java/security/cert/CertStore.java 2015-04-23 15:28:14.748132600 -0700 +++ new/src/java.base/share/classes/java/security/cert/CertStore.java 2015-04-23 15:28:14.348132590 -0700 @@ -409,7 +409,7 @@ */ public final static String getDefaultType() { String cstype; - cstype = AccessController.doPrivileged(new PrivilegedAction() { + cstype = AccessController.doPrivileged(new PrivilegedAction<>() { public String run() { return Security.getProperty(CERTSTORE_TYPE); } --- old/src/java.base/share/classes/java/security/cert/CertificateRevokedException.java 2015-04-23 15:28:15.716132622 -0700 +++ new/src/java.base/share/classes/java/security/cert/CertificateRevokedException.java 2015-04-23 15:28:15.356132614 -0700 @@ -231,7 +231,7 @@ if (size == 0) { extensions = Collections.emptyMap(); } else { - extensions = new HashMap(size); + extensions = new HashMap<>(size); } // Read in the extensions and put the mappings in the extensions map --- old/src/java.base/share/classes/java/security/cert/PKIXParameters.java 2015-04-23 15:28:16.588132642 -0700 +++ new/src/java.base/share/classes/java/security/cert/PKIXParameters.java 2015-04-23 15:28:16.240132634 -0700 @@ -120,8 +120,8 @@ setTrustAnchors(trustAnchors); this.unmodInitialPolicies = Collections.emptySet(); - this.certPathCheckers = new ArrayList(); - this.certStores = new ArrayList(); + this.certPathCheckers = new ArrayList<>(); + this.certStores = new ArrayList<>(); } /** @@ -144,7 +144,7 @@ if (keystore == null) throw new NullPointerException("the keystore parameter must be " + "non-null"); - Set hashSet = new HashSet(); + Set hashSet = new HashSet<>(); Enumeration aliases = keystore.aliases(); while (aliases.hasMoreElements()) { String alias = aliases.nextElement(); @@ -156,8 +156,8 @@ } setTrustAnchors(hashSet); this.unmodInitialPolicies = Collections.emptySet(); - this.certPathCheckers = new ArrayList(); - this.certStores = new ArrayList(); + this.certPathCheckers = new ArrayList<>(); + this.certStores = new ArrayList<>(); } /** @@ -207,7 +207,7 @@ } } this.unmodTrustAnchors = Collections.unmodifiableSet - (new HashSet(trustAnchors)); + (new HashSet<>(trustAnchors)); } /** @@ -256,7 +256,7 @@ + "of type java.lang.String"); } this.unmodInitialPolicies = - Collections.unmodifiableSet(new HashSet(initialPolicies)); + Collections.unmodifiableSet(new HashSet<>(initialPolicies)); } else this.unmodInitialPolicies = Collections.emptySet(); } @@ -280,7 +280,7 @@ */ public void setCertStores(List stores) { if (stores == null) { - this.certStores = new ArrayList(); + this.certStores = new ArrayList<>(); } else { for (Iterator i = stores.iterator(); i.hasNext();) { if (!(i.next() instanceof CertStore)) { @@ -288,7 +288,7 @@ + "of type java.security.cert.CertStore"); } } - this.certStores = new ArrayList(stores); + this.certStores = new ArrayList<>(stores); } } @@ -316,7 +316,7 @@ */ public List getCertStores() { return Collections.unmodifiableList - (new ArrayList(this.certStores)); + (new ArrayList<>(this.certStores)); } /** @@ -544,14 +544,13 @@ */ public void setCertPathCheckers(List checkers) { if (checkers != null) { - List tmpList = - new ArrayList(); + List tmpList = new ArrayList<>(); for (PKIXCertPathChecker checker : checkers) { tmpList.add((PKIXCertPathChecker)checker.clone()); } this.certPathCheckers = tmpList; } else { - this.certPathCheckers = new ArrayList(); + this.certPathCheckers = new ArrayList<>(); } } @@ -567,7 +566,7 @@ * @see #setCertPathCheckers */ public List getCertPathCheckers() { - List tmpList = new ArrayList(); + List tmpList = new ArrayList<>(); for (PKIXCertPathChecker ck : certPathCheckers) { tmpList.add((PKIXCertPathChecker)ck.clone()); } @@ -667,11 +666,11 @@ // must clone these because addCertStore, et al. modify them if (certStores != null) { - copy.certStores = new ArrayList(certStores); + copy.certStores = new ArrayList<>(certStores); } if (certPathCheckers != null) { copy.certPathCheckers = - new ArrayList(certPathCheckers.size()); + new ArrayList<>(certPathCheckers.size()); for (PKIXCertPathChecker checker : certPathCheckers) { copy.certPathCheckers.add( (PKIXCertPathChecker)checker.clone()); --- old/src/java.base/share/classes/java/security/cert/PKIXRevocationChecker.java 2015-04-23 15:28:17.516132664 -0700 +++ new/src/java.base/share/classes/java/security/cert/PKIXRevocationChecker.java 2015-04-23 15:28:17.164132656 -0700 @@ -170,7 +170,7 @@ { this.ocspExtensions = (extensions == null) ? Collections.emptyList() - : new ArrayList(extensions); + : new ArrayList<>(extensions); } /** @@ -232,7 +232,7 @@ public void setOptions(Set