Re: Code Review for 6998860
On 12/7/10 8:20 PM, Mandy Chung wrote: Hi Sean, On 12/7/10 12:47 PM, Sean Mullan wrote: Hi Mandy, Could I get a code review for 6998860: http://cr.openjdk.java.net/~mullan/6998860/webrev.00/ Is Providers.getSunProvider() specified to create a new instance of the provider every time it's called? I would assume that the runtime should create only one single instance of the Sun provider. Yes, makes sense but that is how it is currently implemented. In the comment of the sun.security.jca.Providers.getSunProvider() method, this method is called in two places. // Return to Sun provider or its backup. // This method should only be called by // sun.security.util.ManifestEntryVerifier and java.security.SecureRandom. public static Provider getSunProvider() { Is it correct to change this method to cache and return a singleton object? That seems plausible but I'm a bit hesitant to change that if there isn't a problem. --Sean
Re: Code Review for 6998860
On 12/8/10 6:19 AM, Sean Mullan wrote: On 12/7/10 8:20 PM, Mandy Chung wrote: Hi Sean, On 12/7/10 12:47 PM, Sean Mullan wrote: Hi Mandy, Could I get a code review for 6998860: http://cr.openjdk.java.net/~mullan/6998860/webrev.00/ Is Providers.getSunProvider() specified to create a new instance of the provider every time it's called? I would assume that the runtime should create only one single instance of the Sun provider. Yes, makes sense but that is how it is currently implemented. In the comment of the sun.security.jca.Providers.getSunProvider() method, this method is called in two places. // Return to Sun provider or its backup. // This method should only be called by // sun.security.util.ManifestEntryVerifier and java.security.SecureRandom. public static Provider getSunProvider() { Is it correct to change this method to cache and return a singleton object? That seems plausible but I'm a bit hesitant to change that if there isn't a problem. I'm fine with the change. I suggest to add a comment in the SunProviderHolder class and revisit this in jdk 8 / modularization. Mandy
Re: Code Review for 6998860
Hi Sean, On 12/7/10 12:47 PM, Sean Mullan wrote: Hi Mandy, Could I get a code review for 6998860: http://cr.openjdk.java.net/~mullan/6998860/webrev.00/ Is Providers.getSunProvider() specified to create a new instance of the provider every time it's called? I would assume that the runtime should create only one single instance of the Sun provider. In the comment of the sun.security.jca.Providers.getSunProvider() method, this method is called in two places. // Return to Sun provider or its backup. // This method should only be called by // sun.security.util.ManifestEntryVerifier and java.security.SecureRandom. public static Provider getSunProvider() { Is it correct to change this method to cache and return a singleton object? Mandy