JDK 11 RFR of JDK-8196414: Update ProviderVersionCheck.java to pass on updated JDK versions

Sean Mullan sean.mullan at oracle.com
Tue Jan 30 18:29:36 UTC 2018


On 1/30/18 1:19 PM, joe darcy wrote:
> Hi Sean,
> 
> On 1/30/2018 10:03 AM, Sean Mullan wrote:
>> Does Runtime.version().feature() return the same value as the 
>> "java.specification.version" property? (see 
>> sun.security.util.SecurityConstants.PROVIDER_VER).
>>
>> That is the value that the JDK security providers use as their 
>> version. If not, this test may fail when we bump up the version to 11 
>> and we probably would want to also set SecurityConstants.PROVIDER_VER 
>> to the value of Runtime.version().feature() instead (you could include 
>> that as part of this fix).
>>
> 
> The following patch based on java.specification.version
> 
> @@ -42,7 +42,8 @@
> 
>           for (Provider p: Security.getProviders()) {
>               System.out.print(p.getName() + " ");
> -            if (p.getVersion() != 10.0d) {
> +            String specVersion = 
> System.getProperty("java.specification.version");
> +            if (p.getVersion() != Double.parseDouble(specVersion)) {
>                   System.out.println("failed. " + "Version received was " +
>                           p.getVersion());
>                   failure = true;
> 
> passes both on JDK 10 builds and an internal JDK 11 build with the 
> version updated.

Ok, good to know. I'm fine with this change.

--Sean


More information about the security-dev mailing list