>        // make sure that we don't request multiple keys simultaneously
> -      synchronized (credentialsMap) {
> -         // if there is already a keypair for the group specified, use it
> -         if (credentialsMap.containsKey(regionAndGroup))
> -            return credentialsMap.get(regionAndGroup).getKeyName();
> -
> -         // otherwise create a new keypair and key it under the group and 
> also the regular keyname
> -         keyPair = makeKeyPair.apply(new RegionAndName(region, group));
> -         credentialsMap.put(regionAndGroup, keyPair);
> +      // if there is already a keypair for the group specified, use it
> +      // otherwise create a new keypair and key it under the group and also 
> the regular keyname
> +      KeyPair origValue = credentialsMap.putIfAbsent(regionAndGroup, 
> keyPair);

Thanks for fixing this, @andrewgaul!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/498/files#r17016549

Reply via email to