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:03:23 UTC 2018


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).

--Sean

On 1/30/18 12:42 PM, joe darcy wrote:
> Hello,
> 
> The test
> 
>      java/security/Provider/ProviderVersionCheck.java
> 
> has a version-check that is hard coded; therefore, it has to be updated 
> with each major JDK update. If the test made its check based on the 
> runtime version, no explicit update would be needed.
> 
> Please review the patch below which changes the test as suggested. This 
> change is part of the set of test updates to support increasing the 
> version number in JDK 11.
> 
> Thanks,
> 
> -Joe
> 
> 
> diff -r bcce1fa183e7 
> test/jdk/java/security/Provider/ProviderVersionCheck.java
> --- a/test/jdk/java/security/Provider/ProviderVersionCheck.java Mon Jan 
> 29 17:58:12 2018 +0100
> +++ b/test/jdk/java/security/Provider/ProviderVersionCheck.java Tue Jan 
> 30 09:39:51 2018 -0800
> @@ -1,5 +1,5 @@
>   /*
> - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights 
> reserved.
> + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights 
> reserved.
>    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
>    *
>    * This code is free software; you can redistribute it and/or modify it
> @@ -27,7 +27,7 @@
> 
>   /*
>    * @test
> - * @bug 8030823 8130696
> + * @bug 8030823 8130696 8196414
>    * @run main/othervm ProviderVersionCheck
>    * @summary Verify all providers in the default Providers list have 
> the proper
>    * version for the release
> @@ -42,7 +42,7 @@
> 
>           for (Provider p: Security.getProviders()) {
>               System.out.print(p.getName() + " ");
> -            if (p.getVersion() != 10.0d) {
> +            if (p.getVersion() != (double)Runtime.version().feature()) {
>                   System.out.println("failed. " + "Version received was " +
>                           p.getVersion());
>                   failure = true;
> 


More information about the security-dev mailing list