mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8231387: java.security.Provider.getService returns random result due to race condition with mutating methods in the same class
Synchronize access to legacyMap in Provider.getService. Reviewed-by: valeriep
This commit is contained in:
parent
3fab0b8407
commit
2b56811616
2 changed files with 101 additions and 3 deletions
|
@ -1255,9 +1255,9 @@ public abstract class Provider extends Properties {
|
|||
}
|
||||
synchronized (this) {
|
||||
ensureLegacyParsed();
|
||||
}
|
||||
if (legacyMap != null && !legacyMap.isEmpty()) {
|
||||
return legacyMap.get(key);
|
||||
if (legacyMap != null && !legacyMap.isEmpty()) {
|
||||
return legacyMap.get(key);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue