8078468: Update security libraries to use diamond with anonymous classes
Reviewed-by: weijun
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java Thu Apr 23 18:51:18 2015 -0700
@@ -711,7 +711,7 @@
cf = CertificateFactory.getInstance("X509");
} else {
// version 2
- cfs = new Hashtable<String, CertificateFactory>(3);
+ cfs = new Hashtable<>(3);
}
entries.clear();
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKeyFactory.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKeyFactory.java Thu Apr 23 18:51:18 2015 -0700
@@ -56,7 +56,7 @@
}
static {
- validTypes = new HashSet<String>(17);
+ validTypes = new HashSet<>(17);
validTypes.add("PBEWithMD5AndDES".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndDESede".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase(Locale.ENGLISH));
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java Thu Apr 23 18:51:18 2015 -0700
@@ -115,7 +115,7 @@
final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING";
AccessController.doPrivileged(
- new java.security.PrivilegedAction<Object>() {
+ new java.security.PrivilegedAction<>() {
public Object run() {
/*
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/KeyManagerFactory.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/KeyManagerFactory.java Thu Apr 23 18:51:18 2015 -0700
@@ -63,7 +63,7 @@
*/
public final static String getDefaultAlgorithm() {
String type;
- type = AccessController.doPrivileged(new PrivilegedAction<String>() {
+ type = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
return Security.getProperty("sun.ssl.keymanager.type");
}
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/TrustManagerFactory.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/TrustManagerFactory.java Thu Apr 23 18:51:18 2015 -0700
@@ -63,7 +63,7 @@
*/
public final static String getDefaultAlgorithm() {
String type;
- type = AccessController.doPrivileged(new PrivilegedAction<String>() {
+ type = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
return Security.getProperty("sun.ssl.trustmanager.type");
}
--- a/jdk/src/java.base/share/classes/java/security/AccessControlContext.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java Thu Apr 23 18:51:18 2015 -0700
@@ -458,7 +458,7 @@
Thread.dumpStack();
final ProtectionDomain pd = context[i];
final Debug db = debug;
- AccessController.doPrivileged (new PrivilegedAction<Void>() {
+ AccessController.doPrivileged (new PrivilegedAction<>() {
public Void run() {
db.println("domain that failed "+pd);
return null;
--- a/jdk/src/java.base/share/classes/java/security/AccessController.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AccessController.java Thu Apr 23 18:51:18 2015 -0700
@@ -612,7 +612,7 @@
private static ProtectionDomain getCallerPD(final Class <?> caller) {
ProtectionDomain callerPd = doPrivileged
- (new PrivilegedAction<ProtectionDomain>() {
+ (new PrivilegedAction<>() {
public ProtectionDomain run() {
return caller.getProtectionDomain();
}
--- a/jdk/src/java.base/share/classes/java/security/AllPermission.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/AllPermission.java Thu Apr 23 18:51:18 2015 -0700
@@ -212,7 +212,7 @@
* @return an enumeration of all the AllPermission objects.
*/
public Enumeration<Permission> elements() {
- return new Enumeration<Permission>() {
+ return new Enumeration<>() {
private boolean hasMore = all_allowed;
public boolean hasMoreElements() {
--- a/jdk/src/java.base/share/classes/java/security/BasicPermission.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/BasicPermission.java Thu Apr 23 18:51:18 2015 -0700
@@ -332,7 +332,7 @@
*/
public BasicPermissionCollection(Class<?> clazz) {
- perms = new HashMap<String, Permission>(11);
+ perms = new HashMap<>(11);
all_allowed = false;
permClass = clazz;
}
@@ -533,7 +533,7 @@
@SuppressWarnings("unchecked")
Hashtable<String, Permission> permissions =
(Hashtable<String, Permission>)gfields.get("permissions", null);
- perms = new HashMap<String, Permission>(permissions.size()*2);
+ perms = new HashMap<>(permissions.size()*2);
perms.putAll(permissions);
// Get all_allowed
--- a/jdk/src/java.base/share/classes/java/security/CodeSource.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/CodeSource.java Thu Apr 23 18:51:18 2015 -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<String, CertificateFactory>(3);
+ cfs = new Hashtable<>(3);
this.certs = new java.security.cert.Certificate[size];
}
--- a/jdk/src/java.base/share/classes/java/security/Identity.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Identity.java Thu Apr 23 18:51:18 2015 -0700
@@ -185,7 +185,7 @@
check("setIdentityPublicKey");
this.publicKey = key;
- certificates = new Vector<Certificate>();
+ certificates = new Vector<>();
}
/**
@@ -248,7 +248,7 @@
check("addIdentityCertificate");
if (certificates == null) {
- certificates = new Vector<Certificate>();
+ certificates = new Vector<>();
}
if (publicKey != null) {
if (!keyEquals(publicKey, certificate.getPublicKey())) {
--- a/jdk/src/java.base/share/classes/java/security/IdentityScope.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/IdentityScope.java Thu Apr 23 18:51:18 2015 -0700
@@ -74,7 +74,7 @@
private static void initializeSystemScope() {
String classname = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
+ new PrivilegedAction<>() {
public String run() {
return Security.getProperty("system.scope");
}
--- a/jdk/src/java.base/share/classes/java/security/KeyStore.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java Thu Apr 23 18:51:18 2015 -0700
@@ -976,7 +976,7 @@
*/
public final static String getDefaultType() {
String kstype;
- kstype = AccessController.doPrivileged(new PrivilegedAction<String>() {
+ kstype = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
return Security.getProperty(KEYSTORE_TYPE);
}
--- a/jdk/src/java.base/share/classes/java/security/Permissions.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Permissions.java Thu Apr 23 18:51:18 2015 -0700
@@ -99,7 +99,7 @@
* Creates a new Permissions object containing no PermissionCollections.
*/
public Permissions() {
- permsMap = new HashMap<Class<?>, PermissionCollection>(11);
+ permsMap = new HashMap<>(11);
allPermission = null;
}
@@ -394,7 +394,7 @@
@SuppressWarnings("unchecked")
Hashtable<Class<?>, PermissionCollection> perms =
(Hashtable<Class<?>, PermissionCollection>)gfields.get("perms", null);
- permsMap = new HashMap<Class<?>, PermissionCollection>(perms.size()*2);
+ permsMap = new HashMap<>(perms.size()*2);
permsMap.putAll(perms);
// Set hasUnresolved
@@ -488,7 +488,7 @@
*/
PermissionsHash() {
- permsMap = new HashMap<Permission, Permission>(11);
+ permsMap = new HashMap<>(11);
}
/**
@@ -597,7 +597,7 @@
@SuppressWarnings("unchecked")
Hashtable<Permission, Permission> perms =
(Hashtable<Permission, Permission>)gfields.get("perms", null);
- permsMap = new HashMap<Permission, Permission>(perms.size()*2);
+ permsMap = new HashMap<>(perms.size()*2);
permsMap.putAll(perms);
}
}
--- a/jdk/src/java.base/share/classes/java/security/Policy.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Policy.java Thu Apr 23 18:51:18 2015 -0700
@@ -170,7 +170,7 @@
PolicyInfo pinfo = policy.get();
if (pinfo.policy == null) {
String policy_class = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
+ 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<Policy>() {
+ new PrivilegedAction<>() {
public Policy run() {
try {
ClassLoader cl =
@@ -303,7 +303,7 @@
*/
ProtectionDomain policyDomain =
- AccessController.doPrivileged(new PrivilegedAction<ProtectionDomain>() {
+ AccessController.doPrivileged(new PrivilegedAction<>() {
public ProtectionDomain run() {
return p.getClass().getProtectionDomain();
}
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java Thu Apr 23 18:51:18 2015 -0700
@@ -367,7 +367,7 @@
PermissionCollection perms =
java.security.AccessController.doPrivileged
- (new java.security.PrivilegedAction<PermissionCollection>() {
+ (new java.security.PrivilegedAction<>() {
public PermissionCollection run() {
Policy p = Policy.getPolicyNoCheck();
return p.getPermissions(ProtectionDomain.this);
--- a/jdk/src/java.base/share/classes/java/security/Provider.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Provider.java Thu Apr 23 18:51:18 2015 -0700
@@ -711,7 +711,7 @@
legacyChanged = true;
if (legacyStrings == null) {
- legacyStrings = new LinkedHashMap<String,String>();
+ legacyStrings = new LinkedHashMap<>();
}
return true;
}
@@ -773,7 +773,7 @@
private void implReplaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) {
legacyChanged = true;
if (legacyStrings == null) {
- legacyStrings = new LinkedHashMap<String,String>();
+ legacyStrings = new LinkedHashMap<>();
} else {
legacyStrings.replaceAll((BiFunction<? super String, ? super String, ? extends String>) function);
}
@@ -905,7 +905,7 @@
}
serviceSet = null;
if (legacyMap == null) {
- legacyMap = new LinkedHashMap<ServiceKey,Service>();
+ legacyMap = new LinkedHashMap<>();
} else {
legacyMap.clear();
}
@@ -1133,7 +1133,7 @@
("service.getProvider() must match this Provider object");
}
if (serviceMap == null) {
- serviceMap = new LinkedHashMap<ServiceKey,Service>();
+ serviceMap = new LinkedHashMap<>();
}
servicesChanged = true;
String type = s.getType();
@@ -1305,7 +1305,7 @@
}
static {
- knownEngines = new HashMap<String,EngineDescription>();
+ 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<String>(2);
+ aliases = new ArrayList<>(2);
}
aliases.add(alias);
}
void addAttribute(String type, String value) {
if (attributes.isEmpty()) {
- attributes = new HashMap<UString,String>(8);
+ attributes = new HashMap<>(8);
}
attributes.put(new UString(type), value);
}
@@ -1471,12 +1471,12 @@
if (aliases == null) {
this.aliases = Collections.<String>emptyList();
} else {
- this.aliases = new ArrayList<String>(aliases);
+ this.aliases = new ArrayList<>(aliases);
}
if (attributes == null) {
this.attributes = Collections.<UString,String>emptyMap();
} else {
- this.attributes = new HashMap<UString,String>();
+ this.attributes = new HashMap<>();
for (Map.Entry<String,String> 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<Class<?>>(clazz);
+ classRef = new WeakReference<>(clazz);
}
return clazz;
} catch (ClassNotFoundException e) {
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java Thu Apr 23 18:51:18 2015 -0700
@@ -616,7 +616,7 @@
throws NoSuchAlgorithmException {
String property = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
+ new PrivilegedAction<>() {
@Override
public String run() {
return Security.getProperty(
--- a/jdk/src/java.base/share/classes/java/security/Security.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Security.java Thu Apr 23 18:51:18 2015 -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<Void>() {
+ 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<Void>() {
+ AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() {
try {
/* Get the class via the bootstrap class loader. */
--- a/jdk/src/java.base/share/classes/java/security/Signature.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Signature.java Thu Apr 23 18:51:18 2015 -0700
@@ -265,7 +265,7 @@
private final static Map<String,Boolean> signatureInfo;
static {
- signatureInfo = new ConcurrentHashMap<String,Boolean>();
+ signatureInfo = new ConcurrentHashMap<>();
Boolean TRUE = Boolean.TRUE;
// pre-initialize with values for our SignatureSpi implementations
signatureInfo.put("sun.security.provider.DSA$RawDSA", TRUE);
--- a/jdk/src/java.base/share/classes/java/security/Signer.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/Signer.java Thu Apr 23 18:51:18 2015 -0700
@@ -140,7 +140,7 @@
}
try {
AccessController.doPrivileged(
- new PrivilegedExceptionAction<Void>() {
+ new PrivilegedExceptionAction<>() {
public Void run() throws KeyManagementException {
setPublicKey(pub);
return null;
--- a/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java Thu Apr 23 18:51:18 2015 -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<String, CertificateFactory>(3);
+ cfs = new Hashtable<>(3);
this.certs = new java.security.cert.Certificate[size];
}
--- a/jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java Thu Apr 23 18:51:18 2015 -0700
@@ -61,7 +61,7 @@
*
*/
public UnresolvedPermissionCollection() {
- perms = new HashMap<String, List<UnresolvedPermission>>(11);
+ perms = new HashMap<>(11);
}
/**
@@ -82,7 +82,7 @@
synchronized (this) {
v = perms.get(up.getName());
if (v == null) {
- v = new ArrayList<UnresolvedPermission>();
+ v = new ArrayList<>();
perms.put(up.getName(), v);
}
}
@@ -203,7 +203,7 @@
Hashtable<String, Vector<UnresolvedPermission>> permissions =
(Hashtable<String, Vector<UnresolvedPermission>>)
gfields.get("permissions", null);
- perms = new HashMap<String, List<UnresolvedPermission>>(permissions.size()*2);
+ perms = new HashMap<>(permissions.size()*2);
// Convert each entry (Vector) into a List
Set<Map.Entry<String, Vector<UnresolvedPermission>>> set = permissions.entrySet();
--- a/jdk/src/java.base/share/classes/java/security/cert/CertPathBuilder.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertPathBuilder.java Thu Apr 23 18:51:18 2015 -0700
@@ -301,7 +301,7 @@
*/
public final static String getDefaultType() {
String cpbtype =
- AccessController.doPrivileged(new PrivilegedAction<String>() {
+ AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
return Security.getProperty(CPB_TYPE);
}
--- a/jdk/src/java.base/share/classes/java/security/cert/CertPathValidator.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertPathValidator.java Thu Apr 23 18:51:18 2015 -0700
@@ -313,7 +313,7 @@
*/
public final static String getDefaultType() {
String cpvtype =
- AccessController.doPrivileged(new PrivilegedAction<String>() {
+ AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
return Security.getProperty(CPV_TYPE);
}
--- a/jdk/src/java.base/share/classes/java/security/cert/CertStore.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertStore.java Thu Apr 23 18:51:18 2015 -0700
@@ -409,7 +409,7 @@
*/
public final static String getDefaultType() {
String cstype;
- cstype = AccessController.doPrivileged(new PrivilegedAction<String>() {
+ cstype = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() {
return Security.getProperty(CERTSTORE_TYPE);
}
--- a/jdk/src/java.base/share/classes/java/security/cert/CertificateRevokedException.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateRevokedException.java Thu Apr 23 18:51:18 2015 -0700
@@ -231,7 +231,7 @@
if (size == 0) {
extensions = Collections.emptyMap();
} else {
- extensions = new HashMap<String, Extension>(size);
+ extensions = new HashMap<>(size);
}
// Read in the extensions and put the mappings in the extensions map
--- a/jdk/src/java.base/share/classes/java/security/cert/PKIXParameters.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/PKIXParameters.java Thu Apr 23 18:51:18 2015 -0700
@@ -120,8 +120,8 @@
setTrustAnchors(trustAnchors);
this.unmodInitialPolicies = Collections.<String>emptySet();
- this.certPathCheckers = new ArrayList<PKIXCertPathChecker>();
- this.certStores = new ArrayList<CertStore>();
+ 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<TrustAnchor> hashSet = new HashSet<TrustAnchor>();
+ Set<TrustAnchor> hashSet = new HashSet<>();
Enumeration<String> aliases = keystore.aliases();
while (aliases.hasMoreElements()) {
String alias = aliases.nextElement();
@@ -156,8 +156,8 @@
}
setTrustAnchors(hashSet);
this.unmodInitialPolicies = Collections.<String>emptySet();
- this.certPathCheckers = new ArrayList<PKIXCertPathChecker>();
- this.certStores = new ArrayList<CertStore>();
+ this.certPathCheckers = new ArrayList<>();
+ this.certStores = new ArrayList<>();
}
/**
@@ -207,7 +207,7 @@
}
}
this.unmodTrustAnchors = Collections.unmodifiableSet
- (new HashSet<TrustAnchor>(trustAnchors));
+ (new HashSet<>(trustAnchors));
}
/**
@@ -256,7 +256,7 @@
+ "of type java.lang.String");
}
this.unmodInitialPolicies =
- Collections.unmodifiableSet(new HashSet<String>(initialPolicies));
+ Collections.unmodifiableSet(new HashSet<>(initialPolicies));
} else
this.unmodInitialPolicies = Collections.<String>emptySet();
}
@@ -280,7 +280,7 @@
*/
public void setCertStores(List<CertStore> stores) {
if (stores == null) {
- this.certStores = new ArrayList<CertStore>();
+ this.certStores = new ArrayList<>();
} else {
for (Iterator<CertStore> i = stores.iterator(); i.hasNext();) {
if (!(i.next() instanceof CertStore)) {
@@ -288,7 +288,7 @@
+ "of type java.security.cert.CertStore");
}
}
- this.certStores = new ArrayList<CertStore>(stores);
+ this.certStores = new ArrayList<>(stores);
}
}
@@ -316,7 +316,7 @@
*/
public List<CertStore> getCertStores() {
return Collections.unmodifiableList
- (new ArrayList<CertStore>(this.certStores));
+ (new ArrayList<>(this.certStores));
}
/**
@@ -544,14 +544,13 @@
*/
public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) {
if (checkers != null) {
- List<PKIXCertPathChecker> tmpList =
- new ArrayList<PKIXCertPathChecker>();
+ List<PKIXCertPathChecker> tmpList = new ArrayList<>();
for (PKIXCertPathChecker checker : checkers) {
tmpList.add((PKIXCertPathChecker)checker.clone());
}
this.certPathCheckers = tmpList;
} else {
- this.certPathCheckers = new ArrayList<PKIXCertPathChecker>();
+ this.certPathCheckers = new ArrayList<>();
}
}
@@ -567,7 +566,7 @@
* @see #setCertPathCheckers
*/
public List<PKIXCertPathChecker> getCertPathCheckers() {
- List<PKIXCertPathChecker> tmpList = new ArrayList<PKIXCertPathChecker>();
+ List<PKIXCertPathChecker> 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<CertStore>(certStores);
+ copy.certStores = new ArrayList<>(certStores);
}
if (certPathCheckers != null) {
copy.certPathCheckers =
- new ArrayList<PKIXCertPathChecker>(certPathCheckers.size());
+ new ArrayList<>(certPathCheckers.size());
for (PKIXCertPathChecker checker : certPathCheckers) {
copy.certPathCheckers.add(
(PKIXCertPathChecker)checker.clone());
--- a/jdk/src/java.base/share/classes/java/security/cert/PKIXRevocationChecker.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/PKIXRevocationChecker.java Thu Apr 23 18:51:18 2015 -0700
@@ -170,7 +170,7 @@
{
this.ocspExtensions = (extensions == null)
? Collections.<Extension>emptyList()
- : new ArrayList<Extension>(extensions);
+ : new ArrayList<>(extensions);
}
/**
@@ -232,7 +232,7 @@
public void setOptions(Set<Option> options) {
this.options = (options == null)
? Collections.<Option>emptySet()
- : new HashSet<Option>(options);
+ : new HashSet<>(options);
}
/**
--- a/jdk/src/java.base/share/classes/java/security/cert/X509CRLSelector.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509CRLSelector.java Thu Apr 23 18:51:18 2015 -0700
@@ -124,8 +124,8 @@
issuerX500Principals = null;
} else {
// clone
- issuerX500Principals = new HashSet<X500Principal>(issuers);
- issuerNames = new HashSet<Object>();
+ issuerX500Principals = new HashSet<>(issuers);
+ issuerNames = new HashSet<>();
for (X500Principal p : issuerX500Principals) {
issuerNames.add(p.getEncoded());
}
@@ -288,10 +288,10 @@
*/
private void addIssuerNameInternal(Object name, X500Principal principal) {
if (issuerNames == null) {
- issuerNames = new HashSet<Object>();
+ issuerNames = new HashSet<>();
}
if (issuerX500Principals == null) {
- issuerX500Principals = new HashSet<X500Principal>();
+ issuerX500Principals = new HashSet<>();
}
issuerNames.add(name);
issuerX500Principals.add(principal);
@@ -311,7 +311,7 @@
private static HashSet<Object> cloneAndCheckIssuerNames(Collection<?> names)
throws IOException
{
- HashSet<Object> namesCopy = new HashSet<Object>();
+ HashSet<Object> namesCopy = new HashSet<>();
Iterator<?> i = names.iterator();
while (i.hasNext()) {
Object nameObject = i.next();
@@ -363,7 +363,7 @@
*/
private static HashSet<X500Principal> parseIssuerNames(Collection<Object> names)
throws IOException {
- HashSet<X500Principal> x500Principals = new HashSet<X500Principal>();
+ HashSet<X500Principal> x500Principals = new HashSet<>();
for (Iterator<Object> t = names.iterator(); t.hasNext(); ) {
Object nameObject = t.next();
if (nameObject instanceof String) {
@@ -701,9 +701,9 @@
X509CRLSelector copy = (X509CRLSelector)super.clone();
if (issuerNames != null) {
copy.issuerNames =
- new HashSet<Object>(issuerNames);
+ new HashSet<>(issuerNames);
copy.issuerX500Principals =
- new HashSet<X500Principal>(issuerX500Principals);
+ new HashSet<>(issuerX500Principals);
}
return copy;
} catch (CloneNotSupportedException e) {
--- a/jdk/src/java.base/share/classes/java/security/cert/X509CertSelector.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/security/cert/X509CertSelector.java Thu Apr 23 18:51:18 2015 -0700
@@ -619,8 +619,8 @@
keyPurposeOIDSet = null;
} else {
this.keyPurposeSet =
- Collections.unmodifiableSet(new HashSet<String>(keyPurposeSet));
- keyPurposeOIDSet = new HashSet<ObjectIdentifier>();
+ Collections.unmodifiableSet(new HashSet<>(keyPurposeSet));
+ keyPurposeOIDSet = new HashSet<>();
for (String s : this.keyPurposeSet) {
keyPurposeOIDSet.add(new ObjectIdentifier(s));
}
@@ -815,12 +815,12 @@
// First, ensure that the name parses
GeneralNameInterface tempName = makeGeneralNameInterface(type, name);
if (subjectAlternativeNames == null) {
- subjectAlternativeNames = new HashSet<List<?>>();
+ subjectAlternativeNames = new HashSet<>();
}
if (subjectAlternativeGeneralNames == null) {
- subjectAlternativeGeneralNames = new HashSet<GeneralNameInterface>();
+ subjectAlternativeGeneralNames = new HashSet<>();
}
- List<Object> list = new ArrayList<Object>(2);
+ List<Object> list = new ArrayList<>(2);
list.add(Integer.valueOf(type));
list.add(name);
subjectAlternativeNames.add(list);
@@ -845,7 +845,7 @@
* @throws IOException if a parsing error occurs
*/
private static Set<GeneralNameInterface> parseNames(Collection<List<?>> names) throws IOException {
- Set<GeneralNameInterface> genNames = new HashSet<GeneralNameInterface>();
+ Set<GeneralNameInterface> genNames = new HashSet<>();
for (List<?> nameList : names) {
if (nameList.size() != 2) {
throw new IOException("name list size not 2");
@@ -1096,10 +1096,10 @@
} else {
// Snapshot set and parse it
Set<String> tempSet = Collections.unmodifiableSet
- (new HashSet<String>(certPolicySet));
+ (new HashSet<>(certPolicySet));
/* Convert to Vector of ObjectIdentifiers */
Iterator<String> i = tempSet.iterator();
- Vector<CertificatePolicyId> polIdVector = new Vector<CertificatePolicyId>();
+ Vector<CertificatePolicyId> polIdVector = new Vector<>();
while (i.hasNext()) {
Object o = i.next();
if (!(o instanceof String)) {
@@ -1267,10 +1267,10 @@
// First, ensure that the name parses
GeneralNameInterface tempName = makeGeneralNameInterface(type, name);
if (pathToGeneralNames == null) {
- pathToNames = new HashSet<List<?>>();
- pathToGeneralNames = new HashSet<GeneralNameInterface>();
+ pathToNames = new HashSet<>();
+ pathToGeneralNames = new HashSet<>();
}
- List<Object> list = new ArrayList<Object>(2);
+ List<Object> list = new ArrayList<>(2);
list.add(Integer.valueOf(type));
list.add(name);
pathToNames.add(list);
@@ -1671,10 +1671,10 @@
*/
private static Set<List<?>> cloneAndCheckNames(Collection<List<?>> names) throws IOException {
// Copy the Lists and Collection
- Set<List<?>> namesCopy = new HashSet<List<?>>();
+ Set<List<?>> namesCopy = new HashSet<>();
for (List<?> o : names)
{
- namesCopy.add(new ArrayList<Object>(o));
+ namesCopy.add(new ArrayList<>(o));
}
// Check the contents of the Lists and clone any byte arrays
@@ -2397,7 +2397,7 @@
* Convert the Vector of PolicyInformation to a Vector
* of CertificatePolicyIds for easier comparison.
*/
- List<CertificatePolicyId> policyIDs = new ArrayList<CertificatePolicyId>(policies.size());
+ List<CertificatePolicyId> policyIDs = new ArrayList<>(policies.size());
for (PolicyInformation info : policies) {
policyIDs.add(info.getPolicyIdentifier());
}
--- a/jdk/src/java.base/share/classes/javax/crypto/JceSecurity.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/JceSecurity.java Thu Apr 23 18:51:18 2015 -0700
@@ -76,7 +76,7 @@
static {
try {
AccessController.doPrivileged(
- new PrivilegedExceptionAction<Void> () {
+ new PrivilegedExceptionAction<> () {
@Override
public Void run() throws Exception {
setupJurisdictionPolicies();
@@ -225,7 +225,7 @@
URL url = codeBaseCacheRef.get(clazz);
if (url == null) {
url = AccessController.doPrivileged(
- new PrivilegedAction<URL>() {
+ new PrivilegedAction<>() {
@Override
public URL run() {
ProtectionDomain pd = clazz.getProtectionDomain();
--- a/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java Thu Apr 23 18:51:18 2015 -0700
@@ -66,7 +66,7 @@
exemptPolicy = JceSecurity.getExemptPolicy();
allPerm = CryptoAllPermission.INSTANCE;
INSTANCE = AccessController.doPrivileged(
- new PrivilegedAction<JceSecurityManager>() {
+ new PrivilegedAction<>() {
public JceSecurityManager run() {
return new JceSecurityManager();
}
--- a/jdk/src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java Thu Apr 23 18:51:18 2015 -0700
@@ -63,7 +63,7 @@
*/
public final static String getDefaultAlgorithm() {
String type;
- type = AccessController.doPrivileged(new PrivilegedAction<String>() {
+ type = AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
public String run() {
return Security.getProperty(
--- a/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/SSLSocketFactory.java Thu Apr 23 18:51:18 2015 -0700
@@ -126,7 +126,7 @@
}
static String getSecurityProperty(final String name) {
- return AccessController.doPrivileged(new PrivilegedAction<String>() {
+ return AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
public String run() {
String s = java.security.Security.getProperty(name);
--- a/jdk/src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java Thu Apr 23 18:51:18 2015 -0700
@@ -63,7 +63,7 @@
*/
public final static String getDefaultAlgorithm() {
String type;
- type = AccessController.doPrivileged(new PrivilegedAction<String>() {
+ type = AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
public String run() {
return Security.getProperty(
--- a/jdk/src/java.base/share/classes/javax/security/auth/Subject.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/Subject.java Thu Apr 23 18:51:18 2015 -0700
@@ -154,11 +154,11 @@
public Subject() {
this.principals = Collections.synchronizedSet
- (new SecureSet<Principal>(this, PRINCIPAL_SET));
+ (new SecureSet<>(this, PRINCIPAL_SET));
this.pubCredentials = Collections.synchronizedSet
- (new SecureSet<Object>(this, PUB_CREDENTIAL_SET));
+ (new SecureSet<>(this, PUB_CREDENTIAL_SET));
this.privCredentials = Collections.synchronizedSet
- (new SecureSet<Object>(this, PRIV_CREDENTIAL_SET));
+ (new SecureSet<>(this, PRIV_CREDENTIAL_SET));
}
/**
@@ -206,11 +206,11 @@
collectionNullClean(pubCredentials);
collectionNullClean(privCredentials);
- this.principals = Collections.synchronizedSet(new SecureSet<Principal>
+ this.principals = Collections.synchronizedSet(new SecureSet<>
(this, PRINCIPAL_SET, principals));
- this.pubCredentials = Collections.synchronizedSet(new SecureSet<Object>
+ this.pubCredentials = Collections.synchronizedSet(new SecureSet<>
(this, PUB_CREDENTIAL_SET, pubCredentials));
- this.privCredentials = Collections.synchronizedSet(new SecureSet<Object>
+ this.privCredentials = Collections.synchronizedSet(new SecureSet<>
(this, PRIV_CREDENTIAL_SET, privCredentials));
this.readOnly = readOnly;
}
@@ -292,7 +292,7 @@
// return the Subject from the DomainCombiner of the provided context
return AccessController.doPrivileged
- (new java.security.PrivilegedAction<Subject>() {
+ (new java.security.PrivilegedAction<>() {
public Subject run() {
DomainCombiner dc = acc.getDomainCombiner();
if (!(dc instanceof SubjectDomainCombiner)) {
@@ -555,7 +555,7 @@
return java.security.AccessController.doPrivileged
- (new java.security.PrivilegedAction<AccessControlContext>() {
+ (new java.security.PrivilegedAction<>() {
public AccessControlContext run() {
if (subject == null) {
return new AccessControlContext(acc, null);
@@ -801,7 +801,7 @@
Set<Principal> thatPrincipals;
synchronized(that.principals) {
// avoid deadlock from dual locks
- thatPrincipals = new HashSet<Principal>(that.principals);
+ thatPrincipals = new HashSet<>(that.principals);
}
if (!principals.equals(thatPrincipals)) {
return false;
@@ -810,7 +810,7 @@
Set<Object> thatPubCredentials;
synchronized(that.pubCredentials) {
// avoid deadlock from dual locks
- thatPubCredentials = new HashSet<Object>(that.pubCredentials);
+ thatPubCredentials = new HashSet<>(that.pubCredentials);
}
if (!pubCredentials.equals(thatPubCredentials)) {
return false;
@@ -819,7 +819,7 @@
Set<Object> thatPrivCredentials;
synchronized(that.privCredentials) {
// avoid deadlock from dual locks
- thatPrivCredentials = new HashSet<Object>(that.privCredentials);
+ thatPrivCredentials = new HashSet<>(that.privCredentials);
}
if (!privCredentials.equals(thatPrivCredentials)) {
return false;
@@ -970,21 +970,21 @@
// Rewrap the principals into a SecureSet
try {
- principals = Collections.synchronizedSet(new SecureSet<Principal>
+ principals = Collections.synchronizedSet(new SecureSet<>
(this, PRINCIPAL_SET, inputPrincs));
} catch (NullPointerException npe) {
// Sometimes people deserialize the principals set only.
// Subject is not accessible, so just don't fail.
principals = Collections.synchronizedSet
- (new SecureSet<Principal>(this, PRINCIPAL_SET));
+ (new SecureSet<>(this, PRINCIPAL_SET));
}
// The Credential {@code Set} is not serialized, but we do not
// want the default deserialization routine to set it to null.
this.pubCredentials = Collections.synchronizedSet
- (new SecureSet<Object>(this, PUB_CREDENTIAL_SET));
+ (new SecureSet<>(this, PUB_CREDENTIAL_SET));
this.privCredentials = Collections.synchronizedSet
- (new SecureSet<Object>(this, PRIV_CREDENTIAL_SET));
+ (new SecureSet<>(this, PRIV_CREDENTIAL_SET));
}
/**
@@ -1497,7 +1497,7 @@
Object next;
if (which == Subject.PRIV_CREDENTIAL_SET) {
next = java.security.AccessController.doPrivileged
- (new java.security.PrivilegedAction<Object>() {
+ (new java.security.PrivilegedAction<>() {
public Object run() {
return iterator.next();
}
--- a/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java Thu Apr 23 18:51:18 2015 -0700
@@ -229,7 +229,7 @@
if (configuration == null) {
String config_class = null;
config_class = AccessController.doPrivileged
- (new PrivilegedAction<String>() {
+ (new PrivilegedAction<>() {
public String run() {
return java.security.Security.getProperty
("login.configuration.provider");
@@ -242,7 +242,7 @@
try {
final String finalClass = config_class;
Configuration untrustedImpl = AccessController.doPrivileged(
- new PrivilegedExceptionAction<Configuration>() {
+ new PrivilegedExceptionAction<>() {
public Configuration run() throws ClassNotFoundException,
InstantiationException,
IllegalAccessException {
@@ -254,7 +254,7 @@
}
});
AccessController.doPrivileged(
- new PrivilegedExceptionAction<Void>() {
+ new PrivilegedExceptionAction<>() {
public Void run() {
setConfiguration(untrustedImpl);
return null;
--- a/jdk/src/java.base/share/classes/javax/security/cert/X509Certificate.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/javax/security/cert/X509Certificate.java Thu Apr 23 18:51:18 2015 -0700
@@ -142,7 +142,7 @@
static {
X509Provider = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
+ new PrivilegedAction<>() {
public String run() {
return Security.getProperty(X509_PROVIDER);
}
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS7.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS7.java Thu Apr 23 18:51:18 2015 -0700
@@ -530,7 +530,7 @@
// CRLs (optional)
if (crls != null && crls.length != 0) {
// cast to X509CRLImpl[] since X509CRLImpl implements DerEncoder
- Set<X509CRLImpl> implCRLs = new HashSet<X509CRLImpl>(crls.length);
+ Set<X509CRLImpl> implCRLs = new HashSet<>(crls.length);
for (X509CRL crl: crls) {
if (crl instanceof X509CRLImpl)
implCRLs.add((X509CRLImpl) crl);
@@ -590,7 +590,7 @@
public SignerInfo[] verify(byte[] bytes)
throws NoSuchAlgorithmException, SignatureException {
- Vector<SignerInfo> intResult = new Vector<SignerInfo>();
+ Vector<SignerInfo> intResult = new Vector<>();
for (int i = 0; i < signerInfos.length; i++) {
SignerInfo signerInfo = verify(signerInfos[i], bytes);
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attributes.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attributes.java Thu Apr 23 18:51:18 2015 -0700
@@ -85,8 +85,7 @@
DerInputStream in) throws IOException {
if (permittedAttributes != null) {
this.permittedAttributes =
- new Hashtable<ObjectIdentifier, ObjectIdentifier>(
- permittedAttributes.length);
+ new Hashtable<>(permittedAttributes.length);
for (int i = 0; i < permittedAttributes.length; i++)
this.permittedAttributes.put(permittedAttributes[i],
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java Thu Apr 23 18:51:18 2015 -0700
@@ -237,7 +237,7 @@
if (userCert == null)
return null;
- ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();
+ ArrayList<X509Certificate> certList = new ArrayList<>();
certList.add(userCert);
X509Certificate[] pkcsCerts = block.getCertificates();
--- a/jdk/src/java.base/share/classes/sun/security/provider/SeedGenerator.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SeedGenerator.java Thu Apr 23 18:51:18 2015 -0700
@@ -165,7 +165,7 @@
md.update(b);
java.security.AccessController.doPrivileged
- (new java.security.PrivilegedAction<Void>() {
+ (new java.security.PrivilegedAction<>() {
@Override
public Void run() {
try {
@@ -295,7 +295,7 @@
final ThreadGroup[] finalsg = new ThreadGroup[1];
Thread t = java.security.AccessController.doPrivileged
- (new java.security.PrivilegedAction<Thread>() {
+ (new java.security.PrivilegedAction<>() {
@Override
public Thread run() {
ThreadGroup parent, group =
@@ -501,7 +501,7 @@
final URL device = new URL(deviceName);
try {
seedStream = java.security.AccessController.doPrivileged
- (new java.security.PrivilegedExceptionAction<InputStream>() {
+ (new java.security.PrivilegedExceptionAction<>() {
@Override
public InputStream run() throws IOException {
/*
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SunJSSE.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SunJSSE.java Thu Apr 23 18:51:18 2015 -0700
@@ -148,7 +148,7 @@
}
private void registerAlgorithms(final boolean isfips) {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
public Object run() {
doRegister(isfips);
--- a/jdk/src/java.base/share/classes/sun/security/util/DerInputStream.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerInputStream.java Thu Apr 23 18:51:18 2015 -0700
@@ -394,7 +394,7 @@
/*
* Pull values out of the stream.
*/
- Vector<DerValue> vec = new Vector<DerValue>(startLen);
+ Vector<DerValue> vec = new Vector<>(startLen);
DerValue value;
do {
--- a/jdk/src/java.base/share/classes/sun/security/util/ManifestDigester.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/ManifestDigester.java Thu Apr 23 18:51:18 2015 -0700
@@ -110,7 +110,7 @@
public ManifestDigester(byte bytes[])
{
rawBytes = bytes;
- entries = new HashMap<String, Entry>();
+ entries = new HashMap<>();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
--- a/jdk/src/java.base/share/classes/sun/security/util/ManifestEntryVerifier.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/ManifestEntryVerifier.java Thu Apr 23 18:51:18 2015 -0700
@@ -77,9 +77,9 @@
*/
public ManifestEntryVerifier(Manifest man)
{
- createdDigests = new HashMap<String, MessageDigest>(11);
- digests = new ArrayList<MessageDigest>();
- manifestHashes = new ArrayList<byte[]>();
+ createdDigests = new HashMap<>(11);
+ digests = new ArrayList<>();
+ manifestHashes = new ArrayList<>();
this.man = man;
}
--- a/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java Thu Apr 23 18:51:18 2015 -0700
@@ -203,7 +203,7 @@
private MessageDigest getDigest(String algorithm)
{
if (createdDigests == null)
- createdDigests = new HashMap<String, MessageDigest>();
+ createdDigests = new HashMap<>();
MessageDigest digest = createdDigests.get(algorithm);
@@ -523,7 +523,7 @@
ArrayList<X509Certificate> chain = info.getCertificateChain(block);
CertPath certChain = certificateFactory.generateCertPath(chain);
if (signers == null) {
- signers = new ArrayList<CodeSigner>();
+ signers = new ArrayList<>();
}
// Append the new code signer
signers.add(new CodeSigner(certChain, info.getTimestamp()));
--- a/jdk/src/java.base/share/classes/sun/security/x509/AVA.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/AVA.java Thu Apr 23 18:51:18 2015 -0700
@@ -307,7 +307,7 @@
// doublequote.
int c = readChar(in, "Quoted string did not end in quote");
- List<Byte> embeddedHex = new ArrayList<Byte>();
+ List<Byte> embeddedHex = new ArrayList<>();
boolean isPrintableString = true;
while (c != '"') {
if (c == '\\') {
--- a/jdk/src/java.base/share/classes/sun/security/x509/AlgorithmId.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/AlgorithmId.java Thu Apr 23 18:51:18 2015 -0700
@@ -571,7 +571,7 @@
break;
}
if (oidTable == null) {
- oidTable = new HashMap<String,ObjectIdentifier>();
+ oidTable = new HashMap<>();
}
oidString = alias.substring(index);
String stdAlgName = provs[i].getProperty(alias);
@@ -588,7 +588,7 @@
}
if (oidTable == null) {
- oidTable = new HashMap<String,ObjectIdentifier>(1);
+ oidTable = new HashMap<>(1);
}
initOidTable = true;
}
@@ -887,7 +887,7 @@
*/
sha1WithDSA_oid = ObjectIdentifier.newInternal(dsaWithSHA1_PKIX_data);
- nameTable = new HashMap<ObjectIdentifier,String>();
+ nameTable = new HashMap<>();
nameTable.put(MD5_oid, "MD5");
nameTable.put(MD2_oid, "MD2");
nameTable.put(SHA_oid, "SHA-1");
--- a/jdk/src/java.base/share/classes/sun/security/x509/CertificatePolicySet.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/CertificatePolicySet.java Thu Apr 23 18:51:18 2015 -0700
@@ -58,7 +58,7 @@
* @exception IOException on decoding errors.
*/
public CertificatePolicySet(DerInputStream in) throws IOException {
- ids = new Vector<CertificatePolicyId>();
+ ids = new Vector<>();
DerValue[] seq = in.getSequence(5);
for (int i = 0; i < seq.length; i++) {
--- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java Thu Apr 23 18:51:18 2015 -0700
@@ -59,11 +59,11 @@
* The default constructor for the class.
*/
public GeneralSubtrees() {
- trees = new ArrayList<GeneralSubtree>();
+ trees = new ArrayList<>();
}
private GeneralSubtrees(GeneralSubtrees source) {
- trees = new ArrayList<GeneralSubtree>(source.trees);
+ trees = new ArrayList<>(source.trees);
}
/**
--- a/jdk/src/java.base/share/classes/sun/security/x509/RDN.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/RDN.java Thu Apr 23 18:51:18 2015 -0700
@@ -102,7 +102,7 @@
int quoteCount = 0;
int searchOffset = 0;
int avaOffset = 0;
- List<AVA> avaVec = new ArrayList<AVA>(3);
+ List<AVA> avaVec = new ArrayList<>(3);
int nextPlus = name.indexOf('+');
while (nextPlus >= 0) {
quoteCount += X500Name.countQuotes(name, searchOffset, nextPlus);
@@ -182,7 +182,7 @@
}
int searchOffset = 0;
int avaOffset = 0;
- List<AVA> avaVec = new ArrayList<AVA>(3);
+ List<AVA> avaVec = new ArrayList<>(3);
int nextPlus = name.indexOf('+');
while (nextPlus >= 0) {
/*
@@ -453,7 +453,7 @@
} else {
// order the string type AVA's alphabetically,
// followed by the oid type AVA's numerically
- List<AVA> avaList = new ArrayList<AVA>(assertion.length);
+ List<AVA> avaList = new ArrayList<>(assertion.length);
for (int i = 0; i < assertion.length; i++) {
avaList.add(assertion[i]);
}
--- a/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java Thu Apr 23 18:51:18 2015 -0700
@@ -342,7 +342,7 @@
public List<AVA> allAvas() {
List<AVA> list = allAvaList;
if (list == null) {
- list = new ArrayList<AVA>();
+ list = new ArrayList<>();
for (int i = 0; i < names.length; i++) {
list.addAll(names[i].avas());
}
@@ -1382,7 +1382,7 @@
*/
static {
PrivilegedExceptionAction<Object[]> pa =
- new PrivilegedExceptionAction<Object[]>() {
+ new PrivilegedExceptionAction<>() {
public Object[] run() throws Exception {
Class<X500Principal> pClass = X500Principal.class;
Class<?>[] args = new Class<?>[] { X500Name.class };
--- a/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java Wed Jul 05 20:30:11 2017 +0200
+++ b/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java Thu Apr 23 18:51:18 2015 -0700
@@ -125,7 +125,7 @@
*/
private static RandomIO initIO(final Variant v) {
return AccessController.doPrivileged(
- new PrivilegedAction<RandomIO>() {
+ new PrivilegedAction<>() {
@Override
public RandomIO run() {
@@ -440,7 +440,7 @@
if (seedOutInitialized == false) {
seedOutInitialized = true;
seedOut = AccessController.doPrivileged(
- new PrivilegedAction<OutputStream>() {
+ new PrivilegedAction<>() {
@Override
public OutputStream run() {
try {