< prev index next >
src/java.base/share/classes/java/security/Provider.java
Print this page
*** 709,719 ****
return false;
}
legacyChanged = true;
if (legacyStrings == null) {
! legacyStrings = new LinkedHashMap<String,String>();
}
return true;
}
/**
--- 709,719 ----
return false;
}
legacyChanged = true;
if (legacyStrings == null) {
! legacyStrings = new LinkedHashMap<>();
}
return true;
}
/**
*** 771,781 ****
@SuppressWarnings("unchecked") // Function must actually operate over strings
private void implReplaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) {
legacyChanged = true;
if (legacyStrings == null) {
! legacyStrings = new LinkedHashMap<String,String>();
} else {
legacyStrings.replaceAll((BiFunction<? super String, ? super String, ? extends String>) function);
}
super.replaceAll(function);
}
--- 771,781 ----
@SuppressWarnings("unchecked") // Function must actually operate over strings
private void implReplaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) {
legacyChanged = true;
if (legacyStrings == null) {
! legacyStrings = new LinkedHashMap<>();
} else {
legacyStrings.replaceAll((BiFunction<? super String, ? super String, ? extends String>) function);
}
super.replaceAll(function);
}
*** 903,913 ****
if ((legacyChanged == false) || (legacyStrings == null)) {
return;
}
serviceSet = null;
if (legacyMap == null) {
! legacyMap = new LinkedHashMap<ServiceKey,Service>();
} else {
legacyMap.clear();
}
for (Map.Entry<String,String> entry : legacyStrings.entrySet()) {
parseLegacyPut(entry.getKey(), entry.getValue());
--- 903,913 ----
if ((legacyChanged == false) || (legacyStrings == null)) {
return;
}
serviceSet = null;
if (legacyMap == null) {
! legacyMap = new LinkedHashMap<>();
} else {
legacyMap.clear();
}
for (Map.Entry<String,String> entry : legacyStrings.entrySet()) {
parseLegacyPut(entry.getKey(), entry.getValue());
*** 1131,1141 ****
if (s.getProvider() != this) {
throw new IllegalArgumentException
("service.getProvider() must match this Provider object");
}
if (serviceMap == null) {
! serviceMap = new LinkedHashMap<ServiceKey,Service>();
}
servicesChanged = true;
String type = s.getType();
String algorithm = s.getAlgorithm();
ServiceKey key = new ServiceKey(type, algorithm, true);
--- 1131,1141 ----
if (s.getProvider() != this) {
throw new IllegalArgumentException
("service.getProvider() must match this Provider object");
}
if (serviceMap == null) {
! serviceMap = new LinkedHashMap<>();
}
servicesChanged = true;
String type = s.getType();
String algorithm = s.getAlgorithm();
ServiceKey key = new ServiceKey(type, algorithm, true);
*** 1303,1313 ****
knownEngines.put(name.toLowerCase(ENGLISH), ed);
knownEngines.put(name, ed);
}
static {
! knownEngines = new HashMap<String,EngineDescription>();
// JCA
addEngine("AlgorithmParameterGenerator", false, null);
addEngine("AlgorithmParameters", false, null);
addEngine("KeyFactory", false, null);
addEngine("KeyPairGenerator", false, null);
--- 1303,1313 ----
knownEngines.put(name.toLowerCase(ENGLISH), ed);
knownEngines.put(name, ed);
}
static {
! knownEngines = new HashMap<>();
// JCA
addEngine("AlgorithmParameterGenerator", false, null);
addEngine("AlgorithmParameters", false, null);
addEngine("KeyFactory", false, null);
addEngine("KeyPairGenerator", false, null);
*** 1429,1446 ****
return (type != null) && (algorithm != null) && (className != null);
}
private void addAlias(String alias) {
if (aliases.isEmpty()) {
! aliases = new ArrayList<String>(2);
}
aliases.add(alias);
}
void addAttribute(String type, String value) {
if (attributes.isEmpty()) {
! attributes = new HashMap<UString,String>(8);
}
attributes.put(new UString(type), value);
}
/**
--- 1429,1446 ----
return (type != null) && (algorithm != null) && (className != null);
}
private void addAlias(String alias) {
if (aliases.isEmpty()) {
! aliases = new ArrayList<>(2);
}
aliases.add(alias);
}
void addAttribute(String type, String value) {
if (attributes.isEmpty()) {
! attributes = new HashMap<>(8);
}
attributes.put(new UString(type), value);
}
/**
*** 1469,1484 ****
this.algorithm = algorithm;
this.className = className;
if (aliases == null) {
this.aliases = Collections.<String>emptyList();
} else {
! this.aliases = new ArrayList<String>(aliases);
}
if (attributes == null) {
this.attributes = Collections.<UString,String>emptyMap();
} else {
! this.attributes = new HashMap<UString,String>();
for (Map.Entry<String,String> entry : attributes.entrySet()) {
this.attributes.put(new UString(entry.getKey()), entry.getValue());
}
}
}
--- 1469,1484 ----
this.algorithm = algorithm;
this.className = className;
if (aliases == null) {
this.aliases = Collections.<String>emptyList();
} else {
! this.aliases = new ArrayList<>(aliases);
}
if (attributes == null) {
this.attributes = Collections.<UString,String>emptyMap();
} else {
! this.attributes = new HashMap<>();
for (Map.Entry<String,String> entry : attributes.entrySet()) {
this.attributes.put(new UString(entry.getKey()), entry.getValue());
}
}
}
*** 1642,1652 ****
if (!Modifier.isPublic(clazz.getModifiers())) {
throw new NoSuchAlgorithmException
("class configured for " + type + " (provider: " +
provider.getName() + ") is not public.");
}
! classRef = new WeakReference<Class<?>>(clazz);
}
return clazz;
} catch (ClassNotFoundException e) {
throw new NoSuchAlgorithmException
("class configured for " + type + " (provider: " +
--- 1642,1652 ----
if (!Modifier.isPublic(clazz.getModifiers())) {
throw new NoSuchAlgorithmException
("class configured for " + type + " (provider: " +
provider.getName() + ") is not public.");
}
! classRef = new WeakReference<>(clazz);
}
return clazz;
} catch (ClassNotFoundException e) {
throw new NoSuchAlgorithmException
("class configured for " + type + " (provider: " +
< prev index next >